mcp icon indicating copy to clipboard operation
mcp copied to clipboard

feat(cloudwatch-applicationsignals-mcp-server): add cdk mock project for ec2 …

Open yiyuan-he opened this issue 1 month ago • 5 comments

Fixes

Summary

This PR adds a CDK TypeScript stack that represents infrastructure without Application Signals enabled. It serves as a baseline test fixture for evaluating the new get_enablement_guide tool - testing whether an AI agent can successfully enable Application Signals by modifying this IaC.

Changes

  • CDK stack (samples/cloudwatch-applicationsignals-mcp-server/get-enablement-guide-samples/infrastructure/ec2/cdk/) that provisions:

    • EC2 instance with Docker
    • IAM role with basic permissions (S3, SSM, ECR) - NO CloudWatchAgentServerPolicy
    • Security group and VPC configuration
    • UserData script to pull and run container from ECR
    • Missing: CloudWatch Agent, ADOT, OTel configuration, Application Signals setup
  • Single Python Flask configuration: CDK codebase with one configuration file for Python Flask runtime (will add other languages in follow-ups)

    • python-flask.json - specifies port, health check path, ECR image name
    • Each config specifies language-specific parameters (port, health check path, ECR image name, service name)

CDK Creation Process

This CDK stack was created following the AWS CDK TypeScript guide using the standard initialization command:

cdk init app --language=typescript

Testing

  • Stack successfully deploys with cdk deploy PythonFlaskCdkStack
  • EC2 instance provisions and pulls Docker image from ECR
  • Application container runs successfully
  • Verified CloudWatch Agent and Application Signals components are NOT present (as expected for baseline)

User experience

Before: No mock project infrastructure exists for evaluation testing.

After: Evaluation framework has a realistic, language-agnostic CDK stack representing infrastructure WITHOUT Application Signals. This allows automated testing of the get_enablement_guide tool across multiple language runtimes by verifying the agent can transform this baseline IaC into Application Signals-enabled infrastructure.

Checklist

If your change doesn't seem to apply, please leave them unchecked.

  • [x] I have reviewed the contributing guidelines
  • [x] I have performed a self-review of this change
  • [x] Changes have been tested
  • [x] Changes are documented

Is this a breaking change? (Y/N) N

RFC issue number:

Checklist:

  • [ ] Migration process documented
  • [ ] Implement warnings (if it can live side by side)

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.

yiyuan-he avatar Oct 28 '25 16:10 yiyuan-he

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 90.26%. Comparing base (4008452) to head (70e2216).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1598   +/-   ##
=======================================
  Coverage   90.26%   90.26%           
=======================================
  Files         781      781           
  Lines       59910    59910           
  Branches     9718     9718           
=======================================
  Hits        54075    54075           
  Misses       3646     3646           
  Partials     2189     2189           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Oct 28 '25 16:10 codecov[bot]

These may belong as ./samples/?

scottschreckengaust avatar Oct 28 '25 19:10 scottschreckengaust

These may belong as ./samples/?

Thanks for your review Scott, will move things around and address things on other PR as well.

yiyuan-he avatar Oct 28 '25 20:10 yiyuan-he

Can you add the sample to the docs site as well? Take a look at: https://github.com/awslabs/mcp/tree/main/docusaurus/docs/samples

alexa-perlov avatar Nov 07 '25 17:11 alexa-perlov

Can you add the sample to the docs site as well? Take a look at: https://github.com/awslabs/mcp/tree/main/docusaurus/docs/samples

Added - let me know if it looks good @alexa-perlov

yiyuan-he avatar Nov 07 '25 23:11 yiyuan-he