The attempt to call an AWS lambda function from Python on windows fails.
I have reset my credentials to new AWS keys. No good. I have added AWSLambdaFullAccess to my user ID and group. No workee.
import boto3,json
session = boto3.Session(
aws_access_key_id="YesSireee",
aws_secret_access_key="MySuperDuperSecretAccessKey",
)
lambda_client = boto3.client('lambda', region_name="us-east-2")
test_event = dict(key1="testme")
try:
response = lambda_client.invoke(
FunctionName='arn_copied_from_console',
InvocationType='Event',
LogType='None',
Payload=json.dumps(test_event),
)
except Exception as e: print(e)
print(response); # should be None.
The error is:
An error occurred (UnrecognizedClientException) when calling the Invoke operation: The security token included in the request is invalid.
session.client(...?