In order to deploy this project, you need to have installed:
- Python 3.11 or higher
- Docker
- Git (if using code repository)
- AWS CDK Toolkit
- AWS CLI
With all installed, run this command:
$ python3 -V && cdk --version && docker info -f "{{.OperatingSystem}}"
Python 3.12.2
2.176.0 (build 899965d)
Docker DesktopAn output similar to the above indicates that all is ok to proceed.
If any of these commands fails, you can revisit the documentation and check for possible steps you have forgotten to complete. Ensure that your CDK version is using CDK V2, by checking if the second line of the output follows the pattern 2...
Having those installed, it is time to configure your environment to connect to your AWS Account. To set up your local environment to use such an AWS account you can follow the steps described at https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html
If not done already, clone this repository
git clone https://github.com/aws-samples/generative-ai-cdk-constructs-samples.gitEnter the backend directory
cd samples/multimodal-rag/backendTo manually create a virtualenv on MacOS and Linux:
python3 -m venv .venvAfter the init process completes and the virtualenv is created, you can use the following step to activate your virtualenv.
source .venv/bin/activateIf you are a Windows platform, you would activate the virtualenv like this:
.venv\Scripts\activate.batOnce the virtualenv is activated, you can install the required dependencies.
pip install -r requirements.txtRun the following
cdk bootstrap-
Run AWS CDK Toolkit to deploy the Backend stack with the runtime resources.
cdk deploy --require-approval=never
-
Any modifications made to the code can be applied to the deployed stack by running the same command again.
cdk deploy --require-approval=never
The samples folder contains samples files you can use to test the application.
First, locate the Cognito User Pool ID, through the AWS CLI:
$ aws cloudformation describe-stacks --stack-name BDAMediaSolutionBackendStack --query "Stacks[0].Outputs[?contains(OutputKey, 'UserPoolId')].OutputValue"
[
"OutputValue": "<region>_a1aaaA1Aa"
]You can then go the Amazon Cognito page at the AWS Console, search for the User Pool and add users.