Skip to content

Instantly share code, notes, and snippets.

@gbhorwood
Created May 6, 2019 21:23
Show Gist options
  • Save gbhorwood/63894fdd62c5f66e4fb721cd3fa8962d to your computer and use it in GitHub Desktop.
Save gbhorwood/63894fdd62c5f66e4fb721cd3fa8962d to your computer and use it in GitHub Desktop.
AWS lambda simple execute_sql() example, boto3
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