0

How to retrieve column values from redshift and send it over sns? Boto3 has this option to connect to redshift and retrieve data, but can we send this same data immediately to an sns topic? I have a list of batch ids to be sent to email endpoints using sns. Any sample code / other options which can be used are appreciated.

James Z
  • 12,209
  • 10
  • 24
  • 44
narayanan s
  • 101
  • 2
  • 11

1 Answers1

0

you can use 'psycopg2' module to connect to Redshift. You can normally query the Redshift with the query and get the result set. Redshift is based on the Postgresql.

Then using boto3 as a client, you can publish the result of the query on the sns topic.

You can follow these 2 answers:

How to Load Data into Amazon Redshift via Python Boto3?

AWS: Publish SNS message for Lambda function via boto3 (Python2)

Ishan Arora
  • 124
  • 1
  • 6