This CDK will create Athena, Glue, connecters and evthing to query a Postgress RDS
The cdk.json
file tells the CDK Toolkit how to execute your app.
npm run build
compile typescript to jsnpm run watch
watch for changes and compilenpm run test
perform the jest unit testscdk deploy
deploy this stack to your default AWS account/regioncdk diff
compare deployed stack with current statecdk synth
emits the synthesized CloudFormation template
- Amazon RDS: A PostgreSQL RDS should be already available, use this to set one up if needed: https://github.com/mim-Armand/cdk-rds-pgsql
- Amazon Athena: The interactive query service that integrates with the PostgreSQL database on RDS.
- Amazon S3: Used by Athena to store query results and can also be used to store data in a format that can be queried by Athena.
- Athena Query Federation: Allows you to run SQL queries across data stored in relational, non-relational, object, and custom data sources.
- Lambda Function: Used as a data source for Athena Federated Query. This function will connect to the PostgreSQL database and execute queries.
- IAM (Identity and Access Management): To manage permissions and grant the necessary access for Athena and Lambda function to communicate with RDS.
- AWS Glue: (Optional) To create metadata tables and making data searchable in Athena.
- AWS Secrets Manager: To store and retrieve database credentials securely when connecting from the Lambda function. The Secrets should already be there, use the RDS CDK mentioned above to deploy it if needed.
- VPC (Virtual Private Cloud): To host your RDS instance and to optionally isolate your database and control access.
- Security Group and Network ACLs: To control inbound and outbound traffic to your RDS instance.
- Subnet Group: A collection of subnets (within a VPC) to specify the network resources available to your RDS instance.
- CloudWatch: To monitor the performance of RDS, Athena, and Lambda services and to store logs generated by these services.
- AWS SDK or CLI: For scripting and automation of the setup and querying process.