Skip to content

Commit

Permalink
docs(examples): update aws lambda tooling and iam role names (#1224)
Browse files Browse the repository at this point in the history
  • Loading branch information
zimeg authored Dec 17, 2024
1 parent 5f4c847 commit 5e41ae8
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 30 deletions.
2 changes: 1 addition & 1 deletion examples/aws_lambda/aws_lambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 4 additions & 5 deletions examples/aws_lambda/aws_lambda_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/aws_lambda/aws_lambda_oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 7 additions & 10 deletions examples/aws_lambda/aws_lambda_oauth_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/aws_lambda/deploy.sh
Original file line number Diff line number Diff line change
@@ -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
--requirements requirements.txt
2 changes: 1 addition & 1 deletion examples/aws_lambda/deploy_lazy.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion examples/aws_lambda/deploy_oauth.sh
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions examples/aws_lambda/lazy_aws_lambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 4 additions & 7 deletions examples/aws_lambda/lazy_aws_lambda_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 5e41ae8

Please sign in to comment.