Package com.pulumi.aws.cloudwatchomni
Class View
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.cloudwatchomni.View
-
public class View extends com.pulumi.resources.CustomResourceManages an Amazon CloudWatch Omni view. A view is a named, reusable SQL query over CloudWatch telemetry. It stores the query, not the data: each time the view is queried, its definition runs against the underlying data. See the [CloudWatch SQL query reference](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/omni-sql-query-reference.html) for the query syntax. ## Example Usage ### Basic Usage
### With Description and Tagspackage generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.cloudwatchomni.View; import com.pulumi.aws.cloudwatchomni.ViewArgs; import java.util.ArrayList; import java.util.Arrays; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App{public static void main(String[] args){Pulumi.run(App::stack);}public static void stack(Context ctx){var example = new View("example", ViewArgs.builder() .name("view.app_errors") .definition("SELECT `@timestamp`, `@message` FROM \"logs.default\" WHERE `@logGroupName` = '/my/app'") .build());}}
### Querying a View Reference a view by name in the `FROM` clause of a telemetry query, quoting the name because it contains a dot (for example, `FROM "view.app_errors"`). Bound `@timestamp` on both sides in the `WHERE` clause; the service rejects queries with an open-ended time range. ## Import ### Identity Schema #### Required * `name` (String) Name of the view. #### Optional * `accountId` (String) AWS Account where this resource is managed. * `region` (String) Region where this resource is managed. Using `pulumi import`, import CloudWatch Omni views using the `name`. For example: ```sh $ pulumi import aws:cloudwatchomni/view:View example view.app_errors ```package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.cloudwatchomni.View; import com.pulumi.aws.cloudwatchomni.ViewArgs; import java.util.ArrayList; import java.util.Arrays; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App{public static void main(String[] args){Pulumi.run(App::stack);}public static void stack(Context ctx){var example = new View("example", ViewArgs.builder() .name("view.app_errors") .definition("SELECT `@timestamp`, `@message` FROM \"logs.default\" WHERE `@logGroupName` = '/my/app'") .description("Error lines from /my/app") .tags(Map.of("team", "payments")) .build());}}
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.lang.String>arn()com.pulumi.core.Output<java.lang.String>definition()com.pulumi.core.Output<java.util.Optional<java.lang.String>>description()static Viewget(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, ViewState state, com.pulumi.resources.CustomResourceOptions options)Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.lang.String>name()com.pulumi.core.Output<java.lang.String>region()com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>>tags()com.pulumi.core.Output<java.util.Map<java.lang.String,java.lang.String>>tagsAll()com.pulumi.core.Output<java.lang.String>type()
-
-
-
Constructor Detail
-
View
public View(java.lang.String name)
- Parameters:
name- The _unique_ name of the resulting resource.
-
View
public View(java.lang.String name, ViewArgs args)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
View
public View(java.lang.String name, ViewArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.options- A bag of options that control this resource's behavior.
-
-
Method Detail
-
arn
public com.pulumi.core.Output<java.lang.String> arn()
- Returns:
- ARN of the view. Contains an identifier generated by CloudWatch, in the form `arn:aws:cloudwatch:<region>:<account>:view/<name>/<id>`.
-
definition
public com.pulumi.core.Output<java.lang.String> definition()
- Returns:
- SQL query that defines the view. Must be 1 to 10000 characters. The service validates the query when the view is created or updated.
-
description
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()
- Returns:
- Description of the view. Must be 1 to 1024 characters.
-
name
public com.pulumi.core.Output<java.lang.String> name()
- Returns:
- Name of the view. Must start with `view.` followed by a lowercase letter or digit, contain only lowercase letters, digits, underscores and hyphens, and be 6 to 256 characters long. Unique within the account and Region. Changing this value forces replacement. The following arguments are optional:
-
region
public com.pulumi.core.Output<java.lang.String> region()
- Returns:
- Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
-
tags
public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>> tags()
- Returns:
- Map of tags assigned to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
-
tagsAll
public com.pulumi.core.Output<java.util.Map<java.lang.String,java.lang.String>> tagsAll()
- Returns:
- Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
-
type
public com.pulumi.core.Output<java.lang.String> type()
- Returns:
- Type of the view. Views created with Terraform are `USER` views.
-
get
public static View get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable ViewState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name- The _unique_ name of the resulting resource.id- The _unique_ provider ID of the resource to lookup.state-options- Optional settings to control the behavior of the CustomResource.
-
-