![](/img/trans.png)
[英]An error occurred (413) when calling the BatchExecuteStatement operation using AWS Aurora Serverless DATA API
[英]Python: AWS Aurora Serverless Data API: password authentication failed for user
我的想法不多了。
我創建了一個啟用了數據 API 的 Aurora Serverless RDS(版本 1)。 I now wish to execute SQL statements against it using the Data API ( https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html )
import boto3
session = boto3.Session(region_name="eu-central-1")
rds = session.client("rds-data")
secret = session.client("secretsmanager")
cluster_arn = "arn:aws:rds:eu-central-1:<accountID>:cluster:aurorapostgres"
secret_arn = "arn:aws:secretsmanager:eu-central-1:<accountID>:secret:dbsecret-xNMeQc"
secretvalue = secret.get_secret_value(
SecretId = secret_arn
)
print(secretvalue)
SQL = "SELECT * FROM pipelinedb.dataset"
res = rds.execute_statement(
resourceArn = cluster_arn,
secretArn = secret_arn,
database = "pipelinedb",
sql = SQL
)
print(res)
但是我收到錯誤消息: BadRequestException: An error occurred (BadRequestException) when calling the ExecuteStatement operation: FATAL: password authentication failed for user "bjarki"; SQLState: 28P01
BadRequestException: An error occurred (BadRequestException) when calling the ExecuteStatement operation: FATAL: password authentication failed for user "bjarki"; SQLState: 28P01
我已經驗證了以下內容:
我不知道為什么會出現這個錯誤 - 有什么好主意嗎?
試試這個位於AWS 示例代碼庫中的 AWS 教程。 It shows how to use the AWS SDK for Python (Boto3) to create a web application that tracks work items in an Amazon Aurora database and emails reports by using Amazon Simple Email Service (Amazon SES). 此示例使用使用 React.js 構建的前端與 Flask-RESTful Python 后端進行交互。
將 React.js web 應用程序與 AWS 服務集成。
列出、添加和更新 Aurora 表中的項目。
使用 Amazon SES 發送已過濾工作項的 email 報告。
使用隨附的 AWS CloudFormation 腳本部署和管理示例資源。
https://docs.aws.amazon.com/code-library/latest/ug/cross_RDSDataTracker_python_3_topic.html
嘗試運行 CDK 以正確設置數據庫。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.