Skip to content
GitHubXDiscord

Application

The Application resource allows you to manage AWS ApplicationInsights Applications, which automatically sets up monitoring for your applications and resources.

Create a basic ApplicationInsights application with required properties and a couple of common optional configurations.

import AWS from "alchemy/aws/control";
const appInsightsApplication = await AWS.ApplicationInsights.Application("myApplication", {
ResourceGroupName: "myResourceGroup",
AutoConfigurationEnabled: true,
OpsCenterEnabled: true
});

Configure an ApplicationInsights application with advanced settings for custom components and log pattern sets.

const advancedAppInsightsApplication = await AWS.ApplicationInsights.Application("advancedApplication", {
ResourceGroupName: "myResourceGroup",
AutoConfigurationEnabled: true,
CustomComponents: [
{
ComponentName: "myCustomComponent",
ComponentType: "AWS::EC2::Instance",
ComponentMonitoringSettings: {
LogPatternSets: [
{
Name: "ErrorLogPattern",
Pattern: "ERROR",
Rank: 1
}
]
}
}
],
LogPatternSets: [
{
Name: "GeneralLogPattern",
Pattern: "INFO",
Rank: 0
}
],
SNSNotificationArn: "arn:aws:sns:us-east-1:123456789012:MyTopic"
});

Use the adoption feature to manage existing resources without causing failure if they are already present.

const adoptedApplication = await AWS.ApplicationInsights.Application("existingApplication", {
ResourceGroupName: "myResourceGroup",
adopt: true
});

Set up an ApplicationInsights application with an SNS topic for notifications.

const notifiedAppInsightsApplication = await AWS.ApplicationInsights.Application("notifiedApplication", {
ResourceGroupName: "myResourceGroup",
AutoConfigurationEnabled: true,
SNSNotificationArn: "arn:aws:sns:us-west-2:123456789012:MyNotifications"
});