This is the new AWS CloudFormation Template Reference Guide. Please update your bookmarks and links. For help getting started with CloudFormation, see the AWS CloudFormation User Guide.
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" : { "AttachMissingPermission" :Boolean, "AutoConfigurationEnabled" :Boolean, "ComponentMonitoringSettings" :[ ComponentMonitoringSetting, ... ], "CustomComponents" :[ CustomComponent, ... ], "CWEMonitorEnabled" :Boolean, "GroupingType" :String, "LogPatternSets" :[ LogPatternSet, ... ], "OpsCenterEnabled" :Boolean, "OpsItemSNSTopicArn" :String, "ResourceGroupName" :String, "SNSNotificationArn" :String, "Tags" :[ Tag, ... ]} }
YAML
Type: AWS::ApplicationInsights::Application Properties: AttachMissingPermission:BooleanAutoConfigurationEnabled:BooleanComponentMonitoringSettings:- ComponentMonitoringSettingCustomComponents:- CustomComponentCWEMonitorEnabled:BooleanGroupingType:StringLogPatternSets:- LogPatternSetOpsCenterEnabled:BooleanOpsItemSNSTopicArn:StringResourceGroupName:StringSNSNotificationArn:StringTags:- Tag
Properties
AttachMissingPermission-
If set to true, the managed policies for SSM and CW will be attached to the instance roles if they are missing.
Required: No
Type: Boolean
Update requires: No interruption
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. Not required to set up default monitoring for all components. To set up default monitoring for all components, set
AutoConfigurationEnabledtotrue.Required: No
Type: Array of ComponentMonitoringSetting
Minimum:
1Update requires: No interruption
CustomComponents-
Describes a custom component by grouping similar standalone instances to monitor.
Required: No
Type: Array of CustomComponent
Minimum:
1Update 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
GroupingType-
Application Insights can create applications based on a resource group or on an account. To create an account-based application using all of the resources in the account, set this parameter to
ACCOUNT_BASED.Required: No
Type: String
Allowed values:
ACCOUNT_BASEDUpdate requires: Replacement
LogPatternSets-
The log pattern sets.
Required: No
Type: Array of LogPatternSet
Minimum:
1Update 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
Pattern:
^arn:aws(-[\w]+)*:[\w\d-]+:([\w\d-]*)?:[\w\d_-]*([:/].+)*$Minimum:
20Maximum:
300Update requires: No interruption
ResourceGroupName-
The name of the resource group used for the application.
Required: Yes
Type: String
Pattern:
[a-zA-Z0-9.-_]*Minimum:
1Maximum:
256Update requires: Replacement
SNSNotificationArn-
The SNS topic ARN that is associated with SNS notifications for updates or issues.
Required: No
Type: String
Pattern:
^arn:aws(-[\w]+)*:[\w\d-]+:([\w\d-]*)?:[\w\d_-]*([:/].+)*$Minimum:
20Maximum:
300Update requires: No interruption
-
An array of
Tags.Required: No
Type: Array of Tag
Minimum:
1Update 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 creates an Application Insights application with all components configured with recommended monitoring settings
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
AutoConfigurationEnabledtotrue, which configures all components of the application with the recommended monitoring settings for theDEFAULTtier. For more information, see DescribeComponentConfigurationRecommendation in the Amazon CloudWatch Application Insights API Reference.
YAML
--- Type: AWS::ApplicationInsights::Application Properties: ResourceGroupName: my_resource_group AutoConfigurationEnabled: true
JSON
{ "Type": "AWS::ApplicationInsights::Application", "Properties": { "ResourceGroupName": "my_resource_group", "AutoConfigurationEnabled": true } }
The following example template creates an Application Insights application that includes all of the components in the account
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
GroupingTypetoACCOUNT_BASED, which creates an account level-based application that includes all of the supported resources in the account. -
Sets
AutoConfigurationEnabledtotrue, which configures all components of the application with the recommended monitoring settings for theDEFAULTtier. For more information, see DescribeComponentConfigurationRecommendation in the Amazon CloudWatch Application Insights API Reference. -
You can specify any name for the
ResourceGroupName.
YAML
--- Type: AWS::ApplicationInsights::Application Properties: AutoConfigurationEnabled: true GroupingType: ACCOUNT_BASED ResourceGroupName: my_resource_group
JSON
{ "Type": "AWS::ApplicationInsights::Application", "Properties": { "AutoConfigurationEnabled": true, "GroupingType": ACCOUNT_BASED, "ResourceGroupName": "my_resource_group" } }
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
AutoConfigurationEnabledtotrue, which configures all components of the application with the recommended monitoring settings for theDEFAULTtier. 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_componentsetsComponentConfigurationModetoCUSTOM, which causes this component to be configured as specified inCustomComponentConfiguration. 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_componentsetsComponentConfigurationModetoDEFAULTandTiertoSQL_SERVER, which causes this component to be configured with the configuration settings that Application Insights recommends for theSQL_Servertier. 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_componentsetsComponentConfigurationModetoDEFAULT_WITH_OVERWRITEandtiertoDOT_NET_CORE, which causes this component to be configured with the configuration settings that Application Insights recommends for theDOT_NET_COREtier. Overwritten configuration settings are specified in theDefaultOverwriteComponentConfiguration:-
At the component level,
AlarmMetricssettings are overwritten. -
At the sub-component level, for the
EC2_Instancetype sub-components,Logssettings 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" } ] } } ] } } ] } }