Manages an Amazon Managed Service for Prometheus (AMP) Rule Group Namespace
resource "aws_prometheus_workspace" "demo" {
}
resource "aws_prometheus_rule_group_namespace" "demo" {
name = "rules"
workspace_id = aws_prometheus_workspace.demo.id
data = <<EOF
groups:
- name: test
rules:
- record: metric:recording_rule
expr: avg(rate(container_cpu_usage_seconds_total[5m]))
EOF
}
This resource supports the following arguments:
name
- (Required) The name of the rule group namespaceworkspace_id
- (Required) ID of the prometheus workspace the rule group namespace should be linked todata
- (Required) the rule group namespace data that you want to be applied. See more in AWS Docs.This resource exports no additional attributes.
In Terraform v1.5.0 and later, use an import
block to import the prometheus rule group namespace using the arn. For example:
import {
to = aws_prometheus_rule_group_namespace.demo
id = "arn:aws:aps:us-west-2:123456789012:rulegroupsnamespace/IDstring/namespace_name"
}
Using terraform import
, import the prometheus rule group namespace using the arn. For example:
% terraform import aws_prometheus_rule_group_namespace.demo arn:aws:aps:us-west-2:123456789012:rulegroupsnamespace/IDstring/namespace_name