John Stephen Soriao
04/19/2022, 12:04 AM[profile myprofile]
mfa_serial=arn:aws:iam::***:mfa/****
region=ap-southeast-1
output=json
I can also run the live lambda development properly and the stacks are deployed to our aws account. These are the commands I run
aws-vault exec myprofile
npx sst start --stage <mystage>
My lambda code looks like this
import boto3
ddb = boto3.resource("dynamodb")
table = ddb.Table(MY_TABLE_NAME)
// do some operation on the table
When I invoke the lambda from the SST Console, this is what I get
An error occurred (UnrecognizedClientException) when calling the DescribeTable operation: The security token included in the request is invalid.
I have the proper permissions to the dynamodb table on my lambdaJohn Stephen Soriao
04/19/2022, 12:13 AM# .aws/credentials
[myprofile-nomfa]
aws_access_key_id = ***
aws_secret_access_key = ***
then ran
AWS_PROFILE=myprofile-nomfa npx sst start --stage <mystage>
when I invoke my lambda calling the dynamodb with boto3, this worksFrank
John Stephen Soriao
04/19/2022, 1:26 AMFrank
John Stephen Soriao
04/21/2022, 2:07 PMAWS_SECURITY_TOKEN
environment variable. So I unset while using live lambda development
if os.getenv("IS_LOCAL"):
os.environ.pop("AWS_SECURITY_TOKEN")
Frank
v1.0.0-beta.23
Frank
os.environ.pop
workaround.