From 5e41ae816ccafab21e527f1e189344168c97c752 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Mon, 16 Dec 2024 19:59:02 -0800 Subject: [PATCH] docs(examples): update aws lambda tooling and iam role names (#1224) --- examples/aws_lambda/aws_lambda.py | 2 +- examples/aws_lambda/aws_lambda_config.yaml | 9 ++++----- examples/aws_lambda/aws_lambda_oauth.py | 2 +- .../aws_lambda/aws_lambda_oauth_config.yaml | 17 +++++++---------- examples/aws_lambda/deploy.sh | 4 ++-- examples/aws_lambda/deploy_lazy.sh | 2 +- examples/aws_lambda/deploy_oauth.sh | 2 +- examples/aws_lambda/lazy_aws_lambda.py | 4 ++-- examples/aws_lambda/lazy_aws_lambda_config.yaml | 11 ++++------- 9 files changed, 23 insertions(+), 30 deletions(-) diff --git a/examples/aws_lambda/aws_lambda.py b/examples/aws_lambda/aws_lambda.py index 8ca79a82c..171de6e2e 100644 --- a/examples/aws_lambda/aws_lambda.py +++ b/examples/aws_lambda/aws_lambda.py @@ -31,5 +31,5 @@ def handler(event, context): # export SLACK_BOT_TOKEN=xoxb-*** # rm -rf vendor && cp -pr ../../src/* vendor/ -# pip install python-lambda +# pip install git+https://github.com/nficano/python-lambda # lambda deploy --config-file aws_lambda_config.yaml --requirements requirements.txt diff --git a/examples/aws_lambda/aws_lambda_config.yaml b/examples/aws_lambda/aws_lambda_config.yaml index 5f158892e..5c7c7a6de 100644 --- a/examples/aws_lambda/aws_lambda_config.yaml +++ b/examples/aws_lambda/aws_lambda_config.yaml @@ -4,7 +4,7 @@ function_name: bolt_py_function handler: aws_lambda.handler description: My first lambda function runtime: python3.8 -# role: lambda_basic_execution +role: bolt_python_lambda_invocation # S3 upload requires appropriate role with s3:PutObject permission # (ex. basic_s3_upload), a destination bucket, and the key prefix @@ -20,12 +20,11 @@ aws_secret_access_key: # timeout: 15 # memory_size: 512 # concurrency: 500 -# -# Experimental Environment variables +# Lambda environment variables environment_variables: - SLACK_BOT_TOKEN: ${SLACK_BOT_TOKEN} - SLACK_SIGNING_SECRET: ${SLACK_SIGNING_SECRET} + SLACK_BOT_TOKEN: ${SLACK_BOT_TOKEN} + SLACK_SIGNING_SECRET: ${SLACK_SIGNING_SECRET} # If `tags` is uncommented then tags will be set at creation or update # time. During an update all other tags will be removed except the tags diff --git a/examples/aws_lambda/aws_lambda_oauth.py b/examples/aws_lambda/aws_lambda_oauth.py index 06b2572a6..f8fd175d5 100644 --- a/examples/aws_lambda/aws_lambda_oauth.py +++ b/examples/aws_lambda/aws_lambda_oauth.py @@ -46,5 +46,5 @@ def handler(event, context): # - AWSLambdaRole # rm -rf latest_slack_bolt && cp -pr ../../src latest_slack_bolt -# pip install python-lambda +# pip install git+https://github.com/nficano/python-lambda # lambda deploy --config-file aws_lambda_oauth_config.yaml --requirements requirements_oauth.txt diff --git a/examples/aws_lambda/aws_lambda_oauth_config.yaml b/examples/aws_lambda/aws_lambda_oauth_config.yaml index b491a54e2..e5e837566 100644 --- a/examples/aws_lambda/aws_lambda_oauth_config.yaml +++ b/examples/aws_lambda/aws_lambda_oauth_config.yaml @@ -4,7 +4,6 @@ function_name: bolt_py_oauth_function handler: aws_lambda_oauth.handler description: My first lambda function runtime: python3.8 -# role: lambda_basic_execution role: bolt_python_s3_storage # S3 upload requires appropriate role with s3:PutObject permission @@ -21,17 +20,15 @@ aws_secret_access_key: # timeout: 15 # memory_size: 512 # concurrency: 500 -# -# Experimental Environment variables +# Lambda environment variables environment_variables: - SLACK_SIGNING_SECRET: ${SLACK_SIGNING_SECRET} - SLACK_CLIENT_ID: ${SLACK_CLIENT_ID} - SLACK_CLIENT_SECRET: ${SLACK_CLIENT_SECRET} - SLACK_SCOPES: ${SLACK_SCOPES} - SLACK_INSTALLATION_S3_BUCKET_NAME: ${SLACK_INSTALLATION_S3_BUCKET_NAME} - SLACK_STATE_S3_BUCKET_NAME: ${SLACK_STATE_S3_BUCKET_NAME} - + SLACK_SIGNING_SECRET: ${SLACK_SIGNING_SECRET} + SLACK_CLIENT_ID: ${SLACK_CLIENT_ID} + SLACK_CLIENT_SECRET: ${SLACK_CLIENT_SECRET} + SLACK_SCOPES: ${SLACK_SCOPES} + SLACK_INSTALLATION_S3_BUCKET_NAME: ${SLACK_INSTALLATION_S3_BUCKET_NAME} + SLACK_STATE_S3_BUCKET_NAME: ${SLACK_STATE_S3_BUCKET_NAME} # If `tags` is uncommented then tags will be set at creation or update # time. During an update all other tags will be removed except the tags diff --git a/examples/aws_lambda/deploy.sh b/examples/aws_lambda/deploy.sh index 0a8f13197..54ca3abdc 100755 --- a/examples/aws_lambda/deploy.sh +++ b/examples/aws_lambda/deploy.sh @@ -1,6 +1,6 @@ #!/bin/bash rm -rf vendor && mkdir -p vendor/slack_bolt && cp -pr ../../slack_bolt/* vendor/slack_bolt/ -pip install python-lambda -U +pip install git+https://github.com/nficano/python-lambda lambda deploy \ --config-file aws_lambda_config.yaml \ - --requirements requirements.txt \ No newline at end of file + --requirements requirements.txt diff --git a/examples/aws_lambda/deploy_lazy.sh b/examples/aws_lambda/deploy_lazy.sh index 61a1e3ab4..a76c8165f 100755 --- a/examples/aws_lambda/deploy_lazy.sh +++ b/examples/aws_lambda/deploy_lazy.sh @@ -1,6 +1,6 @@ #!/bin/bash rm -rf slack_bolt && mkdir slack_bolt && cp -pr ../../slack_bolt/* slack_bolt/ -pip install python-lambda -U +pip install git+https://github.com/nficano/python-lambda lambda deploy \ --config-file lazy_aws_lambda_config.yaml \ --requirements requirements.txt diff --git a/examples/aws_lambda/deploy_oauth.sh b/examples/aws_lambda/deploy_oauth.sh index d8f05c501..266aae0f8 100755 --- a/examples/aws_lambda/deploy_oauth.sh +++ b/examples/aws_lambda/deploy_oauth.sh @@ -1,6 +1,6 @@ #!/bin/bash rm -rf slack_bolt && mkdir slack_bolt && cp -pr ../../slack_bolt/* slack_bolt/ -pip install python-lambda -U +pip install git+https://github.com/nficano/python-lambda lambda deploy \ --config-file aws_lambda_oauth_config.yaml \ --requirements requirements_oauth.txt diff --git a/examples/aws_lambda/lazy_aws_lambda.py b/examples/aws_lambda/lazy_aws_lambda.py index dcc47498f..185e33347 100644 --- a/examples/aws_lambda/lazy_aws_lambda.py +++ b/examples/aws_lambda/lazy_aws_lambda.py @@ -46,5 +46,5 @@ def handler(event, context): # export SLACK_BOT_TOKEN=xoxb-*** # rm -rf vendor && cp -pr ../../src/* vendor/ -# pip install python-lambda -# lambda deploy --config-file aws_lambda_config.yaml --requirements requirements.txt +# pip install git+https://github.com/nficano/python-lambda +# lambda deploy --config-file lazy_aws_lambda_config.yaml --requirements requirements.txt diff --git a/examples/aws_lambda/lazy_aws_lambda_config.yaml b/examples/aws_lambda/lazy_aws_lambda_config.yaml index f992f8684..a1ee748d3 100644 --- a/examples/aws_lambda/lazy_aws_lambda_config.yaml +++ b/examples/aws_lambda/lazy_aws_lambda_config.yaml @@ -4,9 +4,7 @@ function_name: bolt_py_function handler: lazy_aws_lambda.handler description: My first lambda function runtime: python3.8 -# role: lambda_basic_execution -# Have lambda:InvokeFunction & lambda:GetFunction in the allowed actions -role: bolt_python_lambda_invocation +role: bolt_python_lambda_invocation # S3 upload requires appropriate role with s3:PutObject permission # (ex. basic_s3_upload), a destination bucket, and the key prefix @@ -22,12 +20,11 @@ aws_secret_access_key: # timeout: 15 # memory_size: 512 # concurrency: 500 -# -# Experimental Environment variables +# Lambda environment variables environment_variables: - SLACK_BOT_TOKEN: ${SLACK_BOT_TOKEN} - SLACK_SIGNING_SECRET: ${SLACK_SIGNING_SECRET} + SLACK_BOT_TOKEN: ${SLACK_BOT_TOKEN} + SLACK_SIGNING_SECRET: ${SLACK_SIGNING_SECRET} # If `tags` is uncommented then tags will be set at creation or update # time. During an update all other tags will be removed except the tags