Skip to content
GitHubXDiscordRSS

AppMonitor

Learn how to create, update, and manage AWS RUM AppMonitors using Alchemy Cloud Control.

The AppMonitor resource lets you create and manage AWS RUM AppMonitors for monitoring the performance of web applications.

Create a basic AppMonitor with required properties and a couple of common optional settings.

import AWS from "alchemy/aws/control";
const appMonitor = await AWS.RUM.AppMonitor("myAppMonitor", {
name: "MyWebAppMonitor",
domain: "mywebapp.com",
DomainList: ["mywebapp.com", "www.mywebapp.com"],
CwLogEnabled: true
});

Configure an AppMonitor with a custom events settings and a resource policy.

const customAppMonitor = await AWS.RUM.AppMonitor("customAppMonitor", {
name: "CustomWebAppMonitor",
domain: "customwebapp.com",
CustomEvents: {
Events: [
{
EventName: "ButtonClick",
EventType: "click",
Selector: "#myButton"
}
]
},
ResourcePolicy: {
Version: "2012-10-17",
Statement: [
{
Effect: "Allow",
Principal: "*",
Action: "rum:PutRumEvents",
Resource: "*",
Condition: {
"StringEquals": {
"rum:AppMonitor": "CustomWebAppMonitor"
}
}
}
]
}
});

Set up an AppMonitor with deobfuscation configuration for JavaScript error tracking.

const deobfuscatedAppMonitor = await AWS.RUM.AppMonitor("deobfuscatedAppMonitor", {
name: "DeobfuscatedWebAppMonitor",
domain: "deobfuscatedwebapp.com",
DeobfuscationConfiguration: {
S3Bucket: "my-deobfuscation-bucket",
S3KeyPrefix: "deobfuscation/"
}
});

Create an AppMonitor with tags for better resource management.

const taggedAppMonitor = await AWS.RUM.AppMonitor("taggedAppMonitor", {
name: "TaggedWebAppMonitor",
domain: "taggedwebapp.com",
Tags: [
{ Key: "Environment", Value: "Production" },
{ Key: "Project", Value: "WebApp" }
]
});