AWS::ApplicationInsights::Application - AWS CloudFormation

AWS::ApplicationInsights::Application

The AWS::ApplicationInsights::Application resource adds an application that is created from a resource group.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::ApplicationInsights::Application", "Properties" : { "AutoConfigurationEnabled" : Boolean, "ComponentMonitoringSettings" : [ ComponentMonitoringSetting, ... ], "CustomComponents" : [ CustomComponent, ... ], "CWEMonitorEnabled" : Boolean, "LogPatternSets" : [ LogPatternSet, ... ], "OpsCenterEnabled" : Boolean, "OpsItemSNSTopicArn" : String, "ResourceGroupName" : String, "Tags" : [ Tag, ... ] } }

Properties

AutoConfigurationEnabled

If set to true, the application components will be configured with the monitoring configuration recommended by Application Insights.

Required: No

Type: Boolean

Update requires: No interruption

ComponentMonitoringSettings

The monitoring settings of the components.

Required: No

Type: List of ComponentMonitoringSetting

Update requires: No interruption

CustomComponents

Describes a custom component by grouping similar standalone instances to monitor.

Required: No

Type: List of CustomComponent

Update requires: No interruption

CWEMonitorEnabled

Indicates whether Application Insights can listen to CloudWatch events for the application resources, such as instance terminated, failed deployment, and others.

Required: No

Type: Boolean

Update requires: No interruption

LogPatternSets

The log pattern sets.

Required: No

Type: List of LogPatternSet

Update requires: No interruption

OpsCenterEnabled

Indicates whether Application Insights will create OpsItems for any problem that is detected by Application Insights for an application.

Required: No

Type: Boolean

Update requires: No interruption

OpsItemSNSTopicArn

The SNS topic provided to Application Insights that is associated with the created OpsItems to receive SNS notifications for opsItem updates.

Required: No

Type: String

Minimum: 20

Maximum: 300

Pattern: ^arn:aws(-\w+)*:[\w\d-]+:([\w\d-]*)?:[\w\d_-]*([:/].+)*$

Update requires: No interruption

ResourceGroupName

The name of the resource group used for the application.

Required: Yes

Type: String

Minimum: 1

Maximum: 256

Pattern: [a-zA-Z0-9\.\-_]*

Update requires: Replacement

Tags

An array of Tags.

Required: No

Type: List of Tag

Update requires: No interruption

Return values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the Amazon Resource Name (ARN) of the application, such as arn:aws:applicationinsights:us-east-1:123456789012:application/resource-group/my_resource_group.

For more information about using the Ref function, see Ref.

Fn::GetAtt

The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.

ApplicationARN

Returns the Amazon Resource Name (ARN) of the application, such as arn:aws:applicationinsights:us-east-1:123456789012:application/resource-group/my_resource_group.

Examples

The following example template performs the following actions:

  • Creates an Application Insights application. For more information, see CreateApplication in the Amazon CloudWatch Application Insights API Reference.

  • Sets AutoConfigurationEnabled to true, which configures all components of the application with the recommended monitoring settings for the DEFAULT tier. For more information, see DescribeComponentConfigurationRecommendation in the Amazon CloudWatch Application Insights API Reference.

--- Type: AWS::ApplicationInsights::Application Properties: ResourceGroupName: my_resource_group AutoConfigurationEnabled: true
{ "Type": "AWS::ApplicationInsights::Application", "Properties": { "ResourceGroupName": "my_resource_group", "AutoConfigurationEnabled": true } }

The following example template creates an Application Insights application with detailed settings

The following example template performs the following actions:

  • Creates an Application Insights application with CloudWatch Events notification and OpsCenter enabled. For more information, see CreateApplication in the Amazon CloudWatch Application Insights API Reference.

  • Tags the application with two tags, one of which has no tag values. For more information, see TagResource in the Amazon CloudWatch Application Insights API Reference.

  • Creates two custom instance group components. For more information, see CreateComponent in the Amazon CloudWatch Application Insights API Reference.

  • Creates two log pattern sets. For more information, see CreateLogPattern in the Amazon CloudWatch Application Insights API Reference.

  • Sets AutoConfigurationEnabled to true, which configures all components of the application with the recommended monitoring settings for the DEFAULT tier. For more information, see DescribeComponentConfigurationRecommendation in the Amazon CloudWatch Application Insights API Reference.

YAML

--- Type: AWS::ApplicationInsights::Application Properties: ResourceGroupName: my_resource_group CWEMonitorEnabled: true OpsCenterEnabled: true OpsItemSNSTopicArn: arn:aws:sns:us-east-1:123456789012:my_topic AutoConfigurationEnabled: true Tags: - Key: key1 Value: value1 - Key: key2 Value: '' CustomComponents: - ComponentName: test_component_1 ResourceList: - arn:aws:ec2:us-east-1:123456789012:instance/i-XXXXX - ComponentName: test_component_2 ResourceList: - arn:aws:ec2:us-east-1:123456789012:instance/i-YYYYY - arn:aws:ec2:us-east-1:123456789012:instance/i-ZZZZZ LogPatternSets: - PatternSetName: pattern_set_1 LogPatterns: - PatternName: deadlock_pattern Pattern: ".*\\sDeadlocked\\sSchedulers(([^\\w].*)|($))" Rank: 1 - PatternSetName: pattern_set_2 LogPatterns: - PatternName: error_pattern Pattern: ".*[\\s\\[]ERROR[\\s\\]].*" Rank: 1 - PatternName: warning_pattern Pattern: ".*[\\s\\[]WARN(ING)?[\\s\\]].*" Rank: 10

JSON

{ "Type": "AWS::ApplicationInsights::Application", "Properties": { "ResourceGroupName": "my_resource_group", "CWEMonitorEnabled": true, "OpsCenterEnabled": true, "OpsItemSNSTopicArn": "arn:aws:sns:us-east-1:123456789012:my_topic", "AutoConfigurationEnabled": true, "Tags": [ { "Key": "key1", "Value": "value1" }, { "Key": "key2", "Value": "" } ], "CustomComponents": [ { "ComponentName": "test_component_1", "ResourceList": [ "arn:aws:ec2:us-east-1:123456789012:instance/i-XXXXX" ] }, { "ComponentName": "test_component_2", "ResourceList": [ "arn:aws:ec2:us-east-1:123456789012:instance/i-YYYYY", "arn:aws:ec2:us-east-1:123456789012:instance/i-ZZZZZ" ] } ], "LogPatternSets": [ { "PatternSetName": "pattern_set_1", "LogPatterns": [ { "PatternName": "deadlock_pattern", "Pattern": ".*\\sDeadlocked\\sSchedulers(([^\\w].*)|($))", "Rank": 1 } ] }, { "PatternSetName": "pattern_set_2", "LogPatterns": [ { "PatternName": "error_pattern", "Pattern": ".*[\\s\\[]ERROR[\\s\\]].*", "Rank": 1 }, { "PatternName": "warning_pattern", "Pattern": ".*[\\s\\[]WARN(ING)?[\\s\\]].*", "Rank": 10 } ] } ] } }

The following example template creates an Application Insights application with CUSTOM mode component configuration

The following example template performs the following actions:

  • Creates an Application Insights application. For more information, see CreateApplication in the Amazon CloudWatch Application Insights API Reference.

  • Component my_component sets ComponentConfigurationMode to CUSTOM, which causes this component to be configured as specified in CustomComponentConfiguration. For more information, see UpdateComponentConfiguration in the Amazon CloudWatch Application Insights API Reference.

YAML

--- Type: AWS::ApplicationInsights::Application Properties: ResourceGroupName: my_resource_group ComponentMonitoringSettings: - ComponentARN: my_component Tier: SQL_SERVER ComponentConfigurationMode: CUSTOM CustomComponentConfiguration: ConfigurationDetails: AlarmMetrics: - AlarmMetricName: StatusCheckFailed ... Logs: - LogGroupName: my_log_group_1 LogPath: C:\LogFolder_1\* LogType: DOT_NET_CORE Encoding: utf-8 PatternSet: my_pattern_set_1 ... WindowsEvents: - LogGroupName: my_windows_event_log_group_1 EventName: Application EventLevels: - ERROR - WARNING ... Encoding: utf-8 PatternSet: my_pattern_set_2 ... Alarms: - AlarmName: my_alarm_name Severity: HIGH ... SubComponentTypeConfigurations: - SubComponentType: EC2_INSTANCE SubComponentConfigurationDetails: AlarmMetrics: - AlarmMetricName: DiskReadOps ... Logs: - LogGroupName: my_log_group_2 LogPath: C:\LogFolder_2\* LogType: IIS Encoding: utf-8 PatternSet: my_pattern_set_3 ... WindowsEvents: - LogGroupName: my_windows_event_log_group_2 EventName: Application EventLevels: - ERROR - WARNING ... Encoding: utf-8 PatternSet: my_pattern_set_4 ...

JSON

{ "Type": "AWS::ApplicationInsights::Application", "Properties": { "ResourceGroupName": "my_resource_group", "ComponentMonitoringSettings": [ { "ComponentARN": "my_component", "Tier": "SQL_SERVER", "ComponentConfigurationMode": "CUSTOM", "CustomComponentConfiguration": { "ConfigurationDetails": { "AlarmMetrics": [ { "AlarmMetricName": "StatusCheckFailed" }, ... ], "Logs": [ { "LogGroupName": "my_log_group_1", "LogPath": "C:\\LogFolder_1\\*", "LogType": "DOT_NET_CORE", "Encoding": "utf-8", "PatternSet": "my_pattern_set_1" }, ... ], "WindowsEvents": [ { "LogGroupName": "my_windows_event_log_group_1", "EventName": "Application", "EventLevels": [ "ERROR", "WARNING", ... ], "Encoding": "utf-8", "PatternSet": "my_pattern_set_2" }, ... ], "Alarms": [ { "AlarmName": "my_alarm_name", "Severity": "HIGH" }, ... ] }, "SubComponentTypeConfigurations": [ { "SubComponentType": "EC2_INSTANCE", "SubComponentConfigurationDetails": { "AlarmMetrics": [ { "AlarmMetricName": "DiskReadOps" }, ... ], "Logs": [ { "LogGroupName": "my_log_group_2", "LogPath": "C:\\LogFolder_2\\*", "LogType": "IIS", "Encoding": "utf-8", "PatternSet": "my_pattern_set_3" }, ... ], "WindowsEvents": [ { "LogGroupName": "my_windows_event_log_group_2", "EventName": "Application", "EventLevels": [ "ERROR", "WARNING", ... ], "Encoding": "utf-8", "PatternSet": "my_pattern_set_4" }, ... ] } } ] } } ] } }

The following example template creates an Application Insights application with DEFAULT mode component configuration

The following example template performs the following actions:

  • Creates an Application Insights application. For more information, see CreateApplication in the Amazon CloudWatch Application Insights API Reference.

  • Component my_component sets ComponentConfigurationMode to DEFAULT and Tier to SQL_SERVER, which causes this component to be configured with the configuration settings that Application Insights recommends for the SQL_Server tier. For more information, see DescribeComponentConfiguration and UpdateComponentConfiguration in the Amazon CloudWatch Application Insights API Reference.

YAML

--- Type: AWS::ApplicationInsights::Application Properties: ResourceGroupName: my_resource_group ComponentMonitoringSettings: - ComponentARN: my_component Tier: SQL_SERVER ComponentConfigurationMode: DEFAULT

JSON

{ "Type": "AWS::ApplicationInsights::Application", "Properties": { "ResourceGroupName": "my_resource_group", "ComponentMonitoringSettings": [ { "ComponentARN": "my_component", "Tier": "SQL_SERVER", "ComponentConfigurationMode": "DEFAULT" } ] } }

The following example template creates an Application Insights application with DEFAULT_WITH_OVERWRITE mode component configuration

The following example template performs the following actions:

  • Creates an Application Insights application. For more information, see CreateApplication in the Amazon CloudWatch Application Insights API Reference.

  • Component my_component sets ComponentConfigurationMode to DEFAULT_WITH_OVERWRITE and tier to DOT_NET_CORE, which causes this component to be configured with the configuration settings that Application Insights recommends for the DOT_NET_CORE tier. Overwritten configuration settings are specified in the DefaultOverwriteComponentConfiguration:

    • At the component level, AlarmMetrics settings are overwritten.

    • At the sub-component level, for the EC2_Instance type sub-components, Logs settings are overwritten.

    For more information, see UpdateComponentConfiguration in the Amazon CloudWatch Application Insights API Reference.

YAML

--- Type: AWS::ApplicationInsights::Application Properties: ResourceGroupName: my_resource_group ComponentMonitoringSettings: - ComponentName: my_component Tier: DOT_NET_CORE ComponentConfigurationMode: DEFAULT_WITH_OVERWRITE DefaultOverwriteComponentConfiguration: ConfigurationDetails: AlarmMetrics: - AlarmMetricName: StatusCheckFailed SubComponentTypeConfigurations: - SubComponentType: EC2_INSTANCE SubComponentConfigurationDetails: Logs: - LogGroupName: my_log_group LogPath: C:\LogFolder\* LogType: IIS Encoding: utf-8 PatternSet: my_pattern_set

JSON

{ "Type": "AWS::ApplicationInsights::Application", "Properties": { "ResourceGroupName": "my_resource_group", "ComponentMonitoringSettings": [ { "ComponentName": "my_component", "Tier": "DOT_NET_CORE", "ComponentConfigurationMode": "DEFAULT_WITH_OVERWRITE", "DefaultOverwriteComponentConfiguration": { "ConfigurationDetails": { "AlarmMetrics": [ { "AlarmMetricName": "StatusCheckFailed" } ] }, "SubComponentTypeConfigurations": [ { "SubComponentType": "EC2_INSTANCE", "SubComponentConfigurationDetails": { "Logs": [ { "LogGroupName": "my_log_group", "LogPath": "C:\\LogFolder\\*", "LogType": "IIS", "Encoding": "utf-8", "PatternSet": "my_pattern_set" } ] } } ] } } ] } }