Created
May 6, 2019 21:23
-
-
Save gbhorwood/63894fdd62c5f66e4fb721cd3fa8962d to your computer and use it in GitHub Desktop.
AWS lambda simple execute_sql() example, boto3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sql = "select * from registrations" | |
awsSecretStoreArn=getDotEnv("AWSSECRETSTOREARN") | |
dbClusterOrInstanceArn=getDotEnv("DBCLUSTERORINSTANCEARN") | |
database=getDotEnv("DATABASE") | |
# call data-api to execute sql | |
response = client.execute_sql( | |
awsSecretStoreArn=awsSecretStoreArn, | |
database=database, | |
dbClusterOrInstanceArn=dbClusterOrInstanceArn, | |
sqlStatements=sql, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment