Skip to content

Latest commit

 

History

History
53 lines (32 loc) · 1.43 KB

File metadata and controls

53 lines (32 loc) · 1.43 KB

Feature flag demo using AWS Evidently & AWS CDK

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.

Build & deploy the stack

Build

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.

Deploy

Run ENVIRONMENT=dev yarn deploy. This will deploy / redeploy your Stack to your AWS Account.

Synthesize Cloudformation Template

To see the Cloudformation template generated by the CDK, run cdk synth, then check the output file in the "cdk.out" directory.

The Component Structure

This Stack contains:

  • a AWS Evidently project
  • a AWS Evidently feature
  • a AWS Evidently segmnet
  • a AWS Evidently launch

Build & run the app

Update the config

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)

Build & run the app

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.