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

@Generated(value="jsii-pacmak/1.140.0 (build 79fd58c)", date="2026-10-08T16:59:50.304Z") @Stability(Stable) public class CfnView extends CfnResource implements IInspectable, IViewRef, ITaggableV2
Resource Type definition for AWS::CloudWatch::View.

A view is a named, reusable SQL query that can be referenced from CloudWatch telemetry queries. View names must be unique within the account and region.

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.cloudwatch.*;
 CfnView cfnView = CfnView.Builder.create(this, "MyCfnView")
         .definition("definition")
         // the properties below are optional
         .description("description")
         .name("name")
         .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

    • CfnView

      protected CfnView(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnView

      protected CfnView(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnView

      @Stability(Stable) public CfnView(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnViewProps props)
      Create a new AWS::CloudWatch::View.

      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

    • arnForView

      @Stability(Stable) @NotNull public static String arnForView(@NotNull IViewRef resource)
      Parameters:
      resource - This parameter is required.
    • fromViewArn

      @Stability(Stable) @NotNull public static IViewRef fromViewArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String arn)
      Creates a new IViewRef from an ARN.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      arn - This parameter is required.
    • fromViewName

      @Stability(Stable) @NotNull public static IViewRef fromViewName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String viewName)
      Creates a new IViewRef from a viewName.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      viewName - This parameter is required.
    • isCfnView

      @Stability(Stable) @NotNull public static Boolean isCfnView(@NotNull Object x)
      Checks whether the given object is a CfnView.

      Parameters:
      x - This parameter is required.
    • 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.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      The Amazon Resource Name (ARN) of the view.
    • getAttrCreatedAt

      @Stability(Stable) @NotNull public String getAttrCreatedAt()
      The timestamp when the view was created.
    • getAttrType

      @Stability(Stable) @NotNull public String getAttrType()
      The ownership category of the view.

      Views created through CloudFormation are always USER views; MANAGED views are provisioned by AWS.

    • getAttrUpdatedAt

      @Stability(Stable) @NotNull public String getAttrUpdatedAt()
      The timestamp when the view was last updated.
    • getCdkTagManager

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

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

      @Stability(Stable) @NotNull protected Map<String,String> getCfnPropertyNames()
      Overrides:
      getCfnPropertyNames in class CfnResource
    • getViewRef

      @Stability(Stable) @NotNull public ViewReference getViewRef()
      A reference to a View resource.
      Specified by:
      getViewRef in interface IViewRef
    • getDefinition

      @Stability(Stable) @NotNull public String getDefinition()
      The SQL query that defines the view.
    • setDefinition

      @Stability(Stable) public void setDefinition(@NotNull String value)
      The SQL query that defines the view.
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      A description of the view.
    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
      A description of the view.
    • getName

      @Stability(Stable) @Nullable public String getName()
      The name of the view.
    • setName

      @Stability(Stable) public void setName(@Nullable String value)
      The name of the view.
    • getTags

      @Stability(Stable) @Nullable public List<CfnTag> getTags()
      An array of key-value pairs to apply to the view.
    • setTags

      @Stability(Stable) public void setTags(@Nullable List<CfnTag> value)
      An array of key-value pairs to apply to the view.