If you are having trouble with timeouts when implementing Slack's SlashCommand in Python on AWS Lambda

If you do this, the response will be returned immediately and the subsequent processing can be performed with the second call, so it will be difficult for a timeout to occur. Although the number of calls is doubled.

def lambda_handler(event, context):

    if "hoge" not in event:
        event["hoge"] = "fuga"
        boto3.client("lambda").invoke(
            FunctionName=context.function_name,
            InvocationType="Event",
            Payload=json.dumps(event),
        )

        return {}

    #What you really want to do below

I searched for Python but couldn't find it, so I'll write it down.

Access authority to call Lambda from Lambda needs to be set separately

Recommended Posts

If you are having trouble with timeouts when implementing Slack's SlashCommand in Python on AWS Lambda
Are you having trouble with "pipenv.exceptions.ResolutionFailure"?
Upload what you got in request to S3 with AWS Lambda Python
What are you using when testing with Python?
Check types_map when using mimetypes on AWS Lambda (Python)
Deploy Python3 function with Serverless Framework on AWS Lambda
For those who are in trouble because NFC is read infinitely when reading NFC with Python
If you want to use field names with hyphens when updating firestore data in python
I'm having trouble with instance variables being inherited in Python
[AWS] What to do when you want to pip with Lambda
For those who are having trouble drawing graphs in python
If you think that the person you put in with pip doesn't work → Maybe you are using python3?
If you get stuck in Cannot load mkl_intel_thread.dll in Python on Windows
Things to note when running Python on EC2 from AWS Lambda
Best practice for logging in JSON format on AWS Lambda / Python
Install pip in Serverless Framework and AWS Lambda with Python environment
Summary if using AWS Lambda (Python)
Write AWS Lambda function in Python
Run Python on Schedule on AWS Lambda
Notify HipChat with AWS Lambda (Python)
ImportError when trying to use gcloud package with AWS Lambda Python version
Easy server monitoring with AWS Lambda (Python) and result notification in Slack
Modules cannot be imported in Python on EC2 run from AWS Lambda
[Python] Run Headless Chrome on AWS Lambda
Connect to s3 with AWS Lambda Python
Python + Selenium + Headless Chromium with aws lambda
Execution order when multiple context managers are specified in the Python with statement
Try implementing a Cisco Spark bot with AWS Lambda + Amazon API Gateway (Python)
What I did when I got stuck in the time limit with lambda python
What to do if you get an error when installing python with pyenv
Character strings placed in GCS with python are garbled when viewed with a browser