Skip to content

Resource: awsPrometheusRuleGroupNamespace

Manages an Amazon Managed Service for Prometheus (AMP) Rule Group Namespace

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const awsPrometheusWorkspaceDemo =
  new aws.prometheusWorkspace.PrometheusWorkspace(this, "demo", {});
const awsPrometheusRuleGroupNamespaceDemo =
  new aws.prometheusRuleGroupNamespace.PrometheusRuleGroupNamespace(
    this,
    "demo_1",
    {
      data: "groups:\n  - name: test\n    rules:\n    - record: metric:recording_rule\n      expr: avg(rate(container_cpu_usage_seconds_total[5m]))\n",
      name: "rules",
      workspaceId: awsPrometheusWorkspaceDemo.id,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsPrometheusRuleGroupNamespaceDemo.overrideLogicalId("demo");

Argument Reference

The following arguments are supported:

  • name - (Required) The name of the rule group namespace
  • workspaceId - (Required) ID of the prometheus workspace the rule group namespace should be linked to
  • data - (Required) the rule group namespace data that you want to be applied. See more in AWS Docs.

Attributes Reference

No additional attributes are exported.

Import

The prometheus rule group namespace can be imported using the arn, e.g.,

$ terraform import aws_prometheus_rule_group_namespace.demo arn:aws:aps:us-west-2:123456789012:rulegroupsnamespace/IDstring/namespace_name