Package com.pulumi.aws.cloudwatch
Class OtelEnrichment
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.cloudwatch.OtelEnrichment
-
public class OtelEnrichment extends com.pulumi.resources.CustomResourceManages AWS CloudWatch OTel enrichment. This is a singleton resource that enables OTel enrichment at the account level. > **NOTE:** This resource requires the `aws.observabilityadmin.TelemetryEnrichment` resource to be configured first. Without telemetry enrichment enabled, OTel enrichment will not function properly even if the API accepts the configuration. > **NOTE:** Creating this Terraform resource starts AWS CloudWatch OTel enrichment and deleting this Terraform resource stops AWS CloudWatch OTel enrichment. Filters are evaluated as follows. `includeFilter` is applied first, then the `excludeFilter` match set is subtracted from the result. Exclusion always wins, so a metric matched by both is not enriched. An inactive direction is permissive: with no `includeFilter`, every supported namespace is in scope, and with no `excludeFilter`, nothing is removed. Namespaces and metric names are matched exactly and case-sensitively, with no wildcards or prefixes, so `AWS/EC2` matches only `AWS/EC2`. At most 100 selectors are allowed across `includeFilter` and `excludeFilter` **combined**. Two lists of 60 selectors each satisfy the per-list limit but are rejected together. ## Example Usage ### Enable OTel Enrichment
### Filter Enrichment by Namespace and Metric By default every namespace that CloudWatch supports is enriched. Narrow that scope with `includeFilter` and `excludeFilter`. The configuration below enriches all of `AWS/EC2` except two network metrics, plus exactly two `AWS/RDS` metrics, and nothing else.package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.observabilityadmin.TelemetryEnrichment; import com.pulumi.aws.cloudwatch.OtelEnrichment; import com.pulumi.aws.cloudwatch.OtelEnrichmentArgs; import com.pulumi.resources.CustomResourceOptions; 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 TelemetryEnrichment("example"); var exampleOtelEnrichment = new OtelEnrichment("exampleOtelEnrichment", OtelEnrichmentArgs.Empty, CustomResourceOptions.builder() .dependsOn(Arrays.asList(example)) .build()); } }
## Import ### Identity Schema #### Required No required attributes for singleton identity. #### Optional * `accountId` (String) AWS Account where this resource is managed. * `region` (String) Region where this resource is managed. Using `pulumi import`, import CloudWatch OTel Enrichment using the region. For example: ```sh $ pulumi import aws:cloudwatch/otelEnrichment:OtelEnrichment example us-west-2 ```package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.observabilityadmin.TelemetryEnrichment; import com.pulumi.aws.cloudwatch.OtelEnrichment; import com.pulumi.aws.cloudwatch.OtelEnrichmentArgs; import com.pulumi.aws.cloudwatch.inputs.OtelEnrichmentExcludeFilterArgs; import com.pulumi.aws.cloudwatch.inputs.OtelEnrichmentIncludeFilterArgs; import com.pulumi.resources.CustomResourceOptions; 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 TelemetryEnrichment("example"); var exampleOtelEnrichment = new OtelEnrichment("exampleOtelEnrichment", OtelEnrichmentArgs.builder() .excludeFilters(OtelEnrichmentExcludeFilterArgs.builder() .namespace("AWS/EC2") .metricNames( "NetworkPacketsIn", "NetworkPacketsOut") .build()) .includeFilters( OtelEnrichmentIncludeFilterArgs.builder() .namespace("AWS/EC2") .build(), OtelEnrichmentIncludeFilterArgs.builder() .namespace("AWS/RDS") .metricNames( "CPUUtilization", "DatabaseConnections") .build()) .build(), CustomResourceOptions.builder() .dependsOn(example) .build()); } }
-
-
Constructor Summary
Constructors Constructor Description OtelEnrichment(java.lang.String name)OtelEnrichment(java.lang.String name, OtelEnrichmentArgs args)OtelEnrichment(java.lang.String name, OtelEnrichmentArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.util.Optional<java.util.List<OtelEnrichmentExcludeFilter>>>excludeFilters()static OtelEnrichmentget(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, OtelEnrichmentState 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.util.Optional<java.util.List<OtelEnrichmentIncludeFilter>>>includeFilters()com.pulumi.core.Output<java.lang.String>region()com.pulumi.core.Output<java.util.Optional<OtelEnrichmentTimeouts>>timeouts()
-
-
-
Constructor Detail
-
OtelEnrichment
public OtelEnrichment(java.lang.String name)
- Parameters:
name- The _unique_ name of the resulting resource.
-
OtelEnrichment
public OtelEnrichment(java.lang.String name, @Nullable OtelEnrichmentArgs args)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
OtelEnrichment
public OtelEnrichment(java.lang.String name, @Nullable OtelEnrichmentArgs 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
-
excludeFilters
public com.pulumi.core.Output<java.util.Optional<java.util.List<OtelEnrichmentExcludeFilter>>> excludeFilters()
- Returns:
- Namespaces and metric names to leave unenriched. See below.
-
includeFilters
public com.pulumi.core.Output<java.util.Optional<java.util.List<OtelEnrichmentIncludeFilter>>> includeFilters()
- Returns:
- Namespaces and metric names to enrich. See below.
-
region
public com.pulumi.core.Output<java.lang.String> region()
- Returns:
- AWS region where this resource is managed.
-
timeouts
public com.pulumi.core.Output<java.util.Optional<OtelEnrichmentTimeouts>> timeouts()
-
get
public static OtelEnrichment get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable OtelEnrichmentState 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.
-
-