Resource: aws_prometheus_workspace

Manages an Amazon Managed Service for Prometheus (AMP) Workspace.

Example Usage

resource "aws_prometheus_workspace" "example" {
  alias = "example"

  tags = {
    Environment = "production"
  }
}

CloudWatch Logging

resource "aws_cloudwatch_log_group" "example" {
  name = "example"
}

resource "aws_prometheus_workspace" "example" {
  logging_configuration {
    log_group_arn = "${aws_cloudwatch_log_group.example.arn}:*"
  }
}

AWS KMS Customer Managed Keys (CMK)

resource "aws_prometheus_workspace" "example" {
  alias       = "example"
  kms_key_arn = aws_kms_key.example.arn
}

resource "aws_kms_key" "example" {
  description             = "example"
  deletion_window_in_days = 7
}

Argument Reference

This resource supports the following arguments:

Logging Configuration

The logging_configuration block supports the following arguments:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import AMP Workspaces using the identifier. For example:

import {
  to = aws_prometheus_workspace.demo
  id = "ws-C6DCB907-F2D7-4D96-957B-66691F865D8B"
}

Using terraform import, import AMP Workspaces using the identifier. For example:

% terraform import aws_prometheus_workspace.demo ws-C6DCB907-F2D7-4D96-957B-66691F865D8B