Skip to content

Boto3 custom endpoint_url is never found when running a Lambda function #3264

Answered by dgard1981
dgard1981 asked this question in Q&A
Discussion options

You must be logged in to vote

OK, so this question is now closed...

I found out after posting this that each invocation of my Lambda function is run in a docker container when using sam local start-api. It then because obvious that the SAM container couldn't talk to S3 Ninja on localhost, and that the issue was not related to boto3 in anyway.

Happily I found a Stack Overflow answer that suggested using the default network gateway IP address in place of localhost, so now everything works.

import boto3

def lambda_handler(event, context):

    client = boto3.client(
        service_name='s3',
        aws_access_key_id='AKIAIOSFODNN7EXAMPLE',
        aws_secret_access_key='wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY',
        

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dgard1981
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant