This is an example of using AWS CDK to configure AWS Evidently for feature flagging. It contains the AWS cloudformation stack to run up the evidently resources and a React app to demo the feature toggles.
To build this, you need run the following commands from the /feature-flag-stack folder:
yarn -g add cdk
yarn
ENVIRONMENT=dev yarn build
This will install the necessary CDK cli, then this example's dependencies, and then build your TypeScript files and your CloudFormation template.
Run ENVIRONMENT=dev yarn deploy
. This will deploy / redeploy your Stack to your AWS Account.
To see the Cloudformation template generated by the CDK, run cdk synth
, then check the output file in the "cdk.out" directory.
This Stack contains:
- a AWS Evidently project
- a AWS Evidently feature
- a AWS Evidently segmnet
- a AWS Evidently launch
Update the /app/src/config.js file.
You should replace the tokens with your own accessKeyId & secretAccessKey that you have previously create in AWS Iam (not shown here)
To build & run the app you need run the following commands from the /app folder:
yarn
yarn start
This will install the apps dependencies, and start the app locally.