Amazon DocumentDB vending machine
POC of an application that deploys an Amazon DocumntDB cluster into an existing VPC defined by the user.
A DocumentDB cluster inside the specified VPC.
A secret will be stored in Secrets Manager containing the password of the user.
A bastion ec2 instance with pre-installed mongo shell inside the same VPC (to test connection).
A lambda function that will read the secret password and connect to the DocumentDB cluster.
- Ensure CDK is installed
$ npm install -g aws-cdk
- Create a Python virtual environment
$ python3 -m venv .venv
- Activate virtual environment
On MacOS or Linux
$ source .venv/bin/activate
On Windows
% .venv\Scripts\activate.bat
- Install the required dependencies.
$ pip install -r requirements.txt
- Synthesize (
cdk synth
) or deploy (cdk deploy
) the example
$ cdk deploy
update account number at top of file and the target VPC name.
$ cdk destroy