Skip to content

terraform-aws-modules/terraform-aws-managed-service-prometheus

AWS Managed Service for Prometheus (AMP) Terraform module

Terraform module which creates AWS Managed Service for Prometheus (AMP) resources.

Usage

See examples directory for working examples to reference:

module "prometheus" {
  source = "terraform-aws-modules/managed-service-prometheus/aws"

  workspace_alias = "example"

  alert_manager_definition = <<-EOT
  alertmanager_config: |
    route:
      receiver: 'default'
    receivers:
      - name: 'default'
  EOT

  rule_group_namespaces = {
    first = {
      name = "rule-01"
      data = <<-EOT
      groups:
        - name: test
          rules:
          - record: metric:recording_rule
            expr: avg(rate(container_cpu_usage_seconds_total[5m]))
      EOT
    }
    second = {
      name = "rule-02"
      data = <<-EOT
      groups:
        - name: test
          rules:
          - record: metric:recording_rule
            expr: avg(rate(container_cpu_usage_seconds_total[5m]))
      EOT
    }
  }
}

Examples

Examples codified under the examples are intended to give users references for how to use the module(s) as well as testing/validating changes to the source code of the module. If contributing to the project, please be sure to make any appropriate updates to the relevant examples to allow maintainers to test your changes and to keep the examples up to date for users. Thank you!

Requirements

Name Version
terraform >= 1.3
aws >= 5.32

Providers

Name Version
aws >= 5.32

Modules

No modules.

Resources

Name Type
aws_prometheus_alert_manager_definition.this resource
aws_prometheus_rule_group_namespace.this resource
aws_prometheus_workspace.this resource

Inputs

Name Description Type Default Required
alert_manager_definition The alert manager definition that you want to be applied. See more in the AWS Docs string `"alertmanager_config: \n route:\n receiver: 'default'\n receivers:\n - name: 'default'\n"`
create Determines whether a resources will be created bool true no
create_workspace Determines whether a workspace will be created or to use an existing workspace bool true no
kms_key_arn The ARN of the KMS Key to for encryption at rest string null no
logging_configuration The logging configuration of the prometheus workspace. map(string) {} no
rule_group_namespaces A map of one or more rule group namespace definitions map(any) {} no
tags A map of tags to add to all resources map(string) {} no
workspace_alias The alias of the prometheus workspace. See more in the AWS Docs string null no
workspace_id The ID of an existing workspace to use when create_workspace is false string "" no

Outputs

Name Description
workspace_arn Amazon Resource Name (ARN) of the workspace
workspace_id Identifier of the workspace
workspace_prometheus_endpoint Prometheus endpoint available for this workspace

License

Apache-2.0 Licensed. See LICENSE.