amazon-web-servicesaws-cloudformationamazon-cloudwatchaws-cdkamazon-cloudwatch-rum

Enable "Include sub domains" in an AWS CloudWatch RUM monitor using CDK?


CloudWatch RUM in the AWS UI console has a field for "Application domain" and a separate checkbox for "Include sub domains".

Screenshot of the "Application domain" field in the CW RUM configuration UI

However, there is no corresponding boolean field in the CDK class, CfnAppMonitor, only a domain string.

How do I check that box without using the AWS UI if my infra is managed as CDK code?


Solution

  • While it's not obvious in documentation, the domain field in the CDK class accepts wildcards. If you set it to *.anyothersubdomain.example.com, the app monitor created in AWS will have its properties set like this: