Class CfnAppMonitor
- All Implemented Interfaces:
IConstruct,IDependable,IInspectable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
AWS::RUM::AppMonitor.
Creates a CloudWatch RUM app monitor, which you can use to collect telemetry data from your application and send it to CloudWatch RUM. The data includes performance and reliability information such as page load time, client-side errors, and user behavior.
After you create an app monitor, sign in to the CloudWatch RUM console to get the JavaScript code snippet to add to your web application. For more information, see How do I find a code snippet that I've already generated?
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.rum.*;
CfnAppMonitor cfnAppMonitor = CfnAppMonitor.Builder.create(this, "MyCfnAppMonitor")
.domain("domain")
.name("name")
// the properties below are optional
.appMonitorConfiguration(AppMonitorConfigurationProperty.builder()
.allowCookies(false)
.enableXRay(false)
.excludedPages(List.of("excludedPages"))
.favoritePages(List.of("favoritePages"))
.guestRoleArn("guestRoleArn")
.identityPoolId("identityPoolId")
.includedPages(List.of("includedPages"))
.metricDestinations(List.of(MetricDestinationProperty.builder()
.destination("destination")
// the properties below are optional
.destinationArn("destinationArn")
.iamRoleArn("iamRoleArn")
.metricDefinitions(List.of(MetricDefinitionProperty.builder()
.name("name")
// the properties below are optional
.dimensionKeys(Map.of(
"dimensionKeysKey", "dimensionKeys"))
.eventPattern("eventPattern")
.namespace("namespace")
.unitLabel("unitLabel")
.valueKey("valueKey")
.build()))
.build()))
.sessionSampleRate(123)
.telemetries(List.of("telemetries"))
.build())
.customEvents(CustomEventsProperty.builder()
.status("status")
.build())
.cwLogEnabled(false)
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThis structure contains much of the configuration data for the app monitor.static final classA fluent builder forCfnAppMonitor.static interfaceThis structure specifies whether this app monitor allows the web client to define and send custom events.static interfaceSpecifies one custom metric or extended metric that you want the CloudWatch RUM app monitor to send to a destination.static interfaceCreates or updates a destination to receive extended metrics from CloudWatch RUM.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionCfnAppMonitor(Construct scope, String id, CfnAppMonitorProps props) Create a newAWS::RUM::AppMonitor.protectedCfnAppMonitor(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnAppMonitor(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionA structure that contains much of the configuration data for the app monitor.The ID of the app monitor, such as123456ab-1234-4ca9-9d2f-a1b2c3456789.Specifies whether this app monitor allows the web client to define and send custom events.Data collected by CloudWatch RUM is kept by RUM for 30 days and then deleted.The top-level internet domain name for which your application has administrative authority.getName()A name for the app monitor.getTags()Assigns one or more tags (key-value pairs) to the app monitor.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidA structure that contains much of the configuration data for the app monitor.voidA structure that contains much of the configuration data for the app monitor.voidsetCustomEvents(IResolvable value) Specifies whether this app monitor allows the web client to define and send custom events.voidSpecifies whether this app monitor allows the web client to define and send custom events.voidsetCwLogEnabled(Boolean value) Data collected by CloudWatch RUM is kept by RUM for 30 days and then deleted.voidsetCwLogEnabled(IResolvable value) Data collected by CloudWatch RUM is kept by RUM for 30 days and then deleted.voidThe top-level internet domain name for which your application has administrative authority.voidA name for the app monitor.Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.core.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnAppMonitor
protected CfnAppMonitor(software.amazon.jsii.JsiiObjectRef objRef) -
CfnAppMonitor
protected CfnAppMonitor(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnAppMonitor
@Stability(Stable) public CfnAppMonitor(@NotNull Construct scope, @NotNull String id, @NotNull CfnAppMonitorProps props) Create a newAWS::RUM::AppMonitor.- Parameters:
scope-- scope in which this resource is defined.
id-- scoped id of the resource.
props-- resource properties.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrId
The ID of the app monitor, such as123456ab-1234-4ca9-9d2f-a1b2c3456789. -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getTags
Assigns one or more tags (key-value pairs) to the app monitor.Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.
Tags don't have any semantic meaning to AWS and are interpreted strictly as strings of characters.
You can associate as many as 50 tags with an app monitor.
For more information, see Tagging AWS resources .
-
getDomain
The top-level internet domain name for which your application has administrative authority.This parameter is required.
-
setDomain
The top-level internet domain name for which your application has administrative authority.This parameter is required.
-
getName
A name for the app monitor.This parameter is required.
-
setName
A name for the app monitor.This parameter is required.
-
getAppMonitorConfiguration
A structure that contains much of the configuration data for the app monitor.If you are using Amazon Cognito for authorization, you must include this structure in your request, and it must include the ID of the Amazon Cognito identity pool to use for authorization. If you don't include
AppMonitorConfiguration, you must set up your own authorization method. For more information, see Authorize your application to send data to AWS .If you omit this argument, the sample rate used for CloudWatch RUM is set to 10% of the user sessions.
-
setAppMonitorConfiguration
@Stability(Stable) public void setAppMonitorConfiguration(@Nullable CfnAppMonitor.AppMonitorConfigurationProperty value) A structure that contains much of the configuration data for the app monitor.If you are using Amazon Cognito for authorization, you must include this structure in your request, and it must include the ID of the Amazon Cognito identity pool to use for authorization. If you don't include
AppMonitorConfiguration, you must set up your own authorization method. For more information, see Authorize your application to send data to AWS .If you omit this argument, the sample rate used for CloudWatch RUM is set to 10% of the user sessions.
-
setAppMonitorConfiguration
A structure that contains much of the configuration data for the app monitor.If you are using Amazon Cognito for authorization, you must include this structure in your request, and it must include the ID of the Amazon Cognito identity pool to use for authorization. If you don't include
AppMonitorConfiguration, you must set up your own authorization method. For more information, see Authorize your application to send data to AWS .If you omit this argument, the sample rate used for CloudWatch RUM is set to 10% of the user sessions.
-
getCustomEvents
Specifies whether this app monitor allows the web client to define and send custom events.If you omit this parameter, custom events are
DISABLED. -
setCustomEvents
Specifies whether this app monitor allows the web client to define and send custom events.If you omit this parameter, custom events are
DISABLED. -
setCustomEvents
Specifies whether this app monitor allows the web client to define and send custom events.If you omit this parameter, custom events are
DISABLED. -
getCwLogEnabled
Data collected by CloudWatch RUM is kept by RUM for 30 days and then deleted.This parameter specifies whether CloudWatch RUM sends a copy of this telemetry data to Amazon CloudWatch Logs in your account. This enables you to keep the telemetry data for more than 30 days, but it does incur Amazon CloudWatch Logs charges.
If you omit this parameter, the default is
false. -
setCwLogEnabled
Data collected by CloudWatch RUM is kept by RUM for 30 days and then deleted.This parameter specifies whether CloudWatch RUM sends a copy of this telemetry data to Amazon CloudWatch Logs in your account. This enables you to keep the telemetry data for more than 30 days, but it does incur Amazon CloudWatch Logs charges.
If you omit this parameter, the default is
false. -
setCwLogEnabled
Data collected by CloudWatch RUM is kept by RUM for 30 days and then deleted.This parameter specifies whether CloudWatch RUM sends a copy of this telemetry data to Amazon CloudWatch Logs in your account. This enables you to keep the telemetry data for more than 30 days, but it does incur Amazon CloudWatch Logs charges.
If you omit this parameter, the default is
false.
-