# Evidently Client-side Evaluation ECS --- ![Stability: Stable](https://img.shields.io/badge/stability-Stable-success.svg?style=for-the-badge) > **This is a stable example. It should successfully build out of the box** > > This examples is built on Construct Libraries marked "Stable" and does not have any infrastructure prerequisites to build. --- [Amazon CloudWatch Evidently](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Evidently.html) is an AWS service that enables you to safely validate new features by serving them to a specified percentage of your users while you roll out the feature. To do this, we create an Evidently [feature](https://docs.aws.amazon.com/cloudwatchevidently/latest/APIReference/API_CreateFeature.html), which defines *what* we're rolling out. We also define a [launch](https://docs.aws.amazon.com/cloudwatchevidently/latest/APIReference/API_CreateLaunch.html), which defines *how* we're rolling out the feature. Your application can then call the [EvaluateFeature API](https://docs.aws.amazon.com/cloudwatchevidently/latest/APIReference/API_EvaluateFeature.html) to determine which version (or variation) of the feature to show to an individual user. Normally, we must call the Evidently server for this, but many applications cannot afford the latency of a network call for this API, so [Client-side evaluation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Evidently-client-side-evaluation.html) removes this dependency by evaluating the feature locally using the [AWS AppConfig agent](https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-integration-containers-agent.html). For this to work, we set up three things: - An Evidently launch - An AppConfig environment for Evidently to use - A ECS service which calls the AppConfig agent locally to evaluate a Feature ## Build To build this app, you need to be in this example's root folder. Then run the following: ```bash npm install -g aws-cdk npm install npm run build ``` This will install the necessary CDK, then this example's dependencies, and then build your TypeScript files and your CloudFormation template. ## Deploy Run `cdk deploy`. This will deploy / redeploy your Stack to your AWS Account. After deploying, you should see the `FargateServiceServiceURL` output. Example: ```shell ✅ EvidentlyClientSideEvaluationEcs ✨ Deployment time: 324.53s Outputs: EvidentlyClientSideEvaluationEcs.FargateServiceServiceURL47701F35 = http://Evide-Farga-1EQJT4AV8H48Q-1421534726.us-east-1.elb.amazonaws.com ``` Visit this URL in your browser, and you should see the feature variation: ```json oldSearchBar ``` Under the hood, we called the ECS service which in turn called `EvaluateFeature` via the AppConfig agent. ## 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.