Class CfnAppMonitor

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-18T17:54:23.972Z") @Stability(Stable) public class CfnAppMonitor extends CfnResource implements IInspectable, ITaggable
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();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String 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 software.constructs.Construct scope, @NotNull String id, @NotNull CfnAppMonitorProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties. This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrId

      @Stability(Stable) @NotNull public String getAttrId()
      The ID of the app monitor, such as 123456ab-1234-4ca9-9d2f-a1b2c3456789 .
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getTags in interface ITaggable
    • getDomain

      @Stability(Stable) @NotNull public String getDomain()
      The top-level internet domain name for which your application has administrative authority.
    • setDomain

      @Stability(Stable) public void setDomain(@NotNull String value)
      The top-level internet domain name for which your application has administrative authority.
    • getName

      @Stability(Stable) @NotNull public String getName()
      A name for the app monitor.
    • setName

      @Stability(Stable) public void setName(@NotNull String value)
      A name for the app monitor.
    • getAppMonitorConfiguration

      @Stability(Stable) @Nullable public Object getAppMonitorConfiguration()
      A structure that contains much of the configuration data for the app monitor.
    • setAppMonitorConfiguration

      @Stability(Stable) public void setAppMonitorConfiguration(@Nullable IResolvable value)
      A structure that contains much of the configuration data for the app monitor.
    • setAppMonitorConfiguration

      @Stability(Stable) public void setAppMonitorConfiguration(@Nullable CfnAppMonitor.AppMonitorConfigurationProperty value)
      A structure that contains much of the configuration data for the app monitor.
    • getCustomEvents

      @Stability(Stable) @Nullable public Object getCustomEvents()
      Specifies whether this app monitor allows the web client to define and send custom events.
    • setCustomEvents

      @Stability(Stable) public void setCustomEvents(@Nullable IResolvable value)
      Specifies whether this app monitor allows the web client to define and send custom events.
    • setCustomEvents

      @Stability(Stable) public void setCustomEvents(@Nullable CfnAppMonitor.CustomEventsProperty value)
      Specifies whether this app monitor allows the web client to define and send custom events.
    • getCwLogEnabled

      @Stability(Stable) @Nullable public Object getCwLogEnabled()
      Data collected by CloudWatch RUM is kept by RUM for 30 days and then deleted.
    • setCwLogEnabled

      @Stability(Stable) public void setCwLogEnabled(@Nullable Boolean value)
      Data collected by CloudWatch RUM is kept by RUM for 30 days and then deleted.
    • setCwLogEnabled

      @Stability(Stable) public void setCwLogEnabled(@Nullable IResolvable value)
      Data collected by CloudWatch RUM is kept by RUM for 30 days and then deleted.
    • getTagsRaw

      @Stability(Stable) @Nullable public List<CfnTag> getTagsRaw()
      Assigns one or more tags (key-value pairs) to the app monitor.
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable List<CfnTag> value)
      Assigns one or more tags (key-value pairs) to the app monitor.