applications/photo-asset-manager/cdk/README.md
The Photo Asset Management (PAM) example app is a React website that supports the upload of photographic images to Amazon S3, automatic categorization of those images using Amazon Rekognition, and retrieval of zipped batches of images matching a provided category.
You will deploy this CDK project using any of the supported language implementations.
This project will create the following in your AWS Cloud environment:
Requirements:
First, you will need to install the dependencies in this project:
npm install
You can check the toolkit version with this command:
$ cdk --version
Export these variables:
| Name | Usage |
|---|---|
| PAM_NAME | Short one-word name to identify this stack. |
| PAM_EMAIL | Email address for the pre-verified default user account. |
| PAM_LANG | Programming language for the Lambdas in this deployment. |
Current languages: Java, Python, Dotnet
bash/zsh
export PAM_NAME=
export PAM_EMAIL=
export PAM_LANG=
Windows cmd
set PAM_NAME=
set PAM_EMAIL=
set PAM_LANG=
Windows Powershell
$Env:PAM_NAME =
$Env:PAM_EMAIL =
$Env:PAM_LANG =
There are three stacks that need to be deployed:
At this point you can now synthesize the AWS CloudFormation template for this code. Run cdk ls to see
a list of available stacks to synth/deploy.
cdk synth {PAM_NAME}-FE-Infra-PAM
If everything looks good, go ahead and deploy. This step will make changes to your AWS Cloud environment.
$ cdk bootstrap # Only required once for the lifetime of your account.
$ cdk deploy {STACK_NAME} # Deploy each of the three preceding stacks in order.
After deploying the PamFrontEndInfraStack, your terminal should have a Cloudfront distribution URL. Navigate to that URL to see the deployed app.
To clean up, delete the CDK stacks in reverse creation order. Run the following command for each stack:
$ cdk destroy {STACK_NAME}
cdk ls List the stacks based on your name and programming languagecdk deploy Deploy this stack to your default AWS account/regioncdk diff Compare the deployed stack with the current statecdk synth Emits the synthesized CloudFormation template