在圣杯路由中,我使用 boto3 对我的 RDS Aurora Serverless 数据库集群执行查询。这在本地($ chalice local
)按预期工作,但是当部署在 lamdba 上时,我收到错误:An error occurred (BadRequestException) when calling the ExecuteStatement operation: Failed to fetch secret arn:aws:secretsmanager:us-west-2...
我已按照https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html?icmpid=docs_lambda_help此处的说明更新了 VPC 之间的各种策略。
boto3.client('rds-data').execute_statement( resourceArn = cluster_arn, secretArn = secret_arn, database = 'XXX', sql = sql, # sql string )