Home

Awesome

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!

<!-- BEGIN_TF_DOCS -->

Requirements

NameVersion
<a name="requirement_terraform"></a> terraform>= 1.3
<a name="requirement_aws"></a> aws>= 5.32

Providers

NameVersion
<a name="provider_aws"></a> aws>= 5.32

Modules

No modules.

Resources

NameType
aws_prometheus_alert_manager_definition.thisresource
aws_prometheus_rule_group_namespace.thisresource
aws_prometheus_workspace.thisresource

Inputs

NameDescriptionTypeDefaultRequired
<a name="input_alert_manager_definition"></a> alert_manager_definitionThe alert manager definition that you want to be applied. See more in the AWS Docsstring`"alertmanager_config:\n route:\n receiver: 'default'\n receivers:\n - name: 'default'\n"`
<a name="input_create"></a> createDetermines whether a resources will be createdbooltrueno
<a name="input_create_workspace"></a> create_workspaceDetermines whether a workspace will be created or to use an existing workspacebooltrueno
<a name="input_kms_key_arn"></a> kms_key_arnThe ARN of the KMS Key to for encryption at reststringnullno
<a name="input_logging_configuration"></a> logging_configurationThe logging configuration of the prometheus workspace.map(string){}no
<a name="input_rule_group_namespaces"></a> rule_group_namespacesA map of one or more rule group namespace definitionsmap(any){}no
<a name="input_tags"></a> tagsA map of tags to add to all resourcesmap(string){}no
<a name="input_workspace_alias"></a> workspace_aliasThe alias of the prometheus workspace. See more in the AWS Docsstringnullno
<a name="input_workspace_id"></a> workspace_idThe ID of an existing workspace to use when create_workspace is falsestring""no

Outputs

NameDescription
<a name="output_workspace_arn"></a> workspace_arnAmazon Resource Name (ARN) of the workspace
<a name="output_workspace_id"></a> workspace_idIdentifier of the workspace
<a name="output_workspace_prometheus_endpoint"></a> workspace_prometheus_endpointPrometheus endpoint available for this workspace
<!-- END_TF_DOCS -->

License

Apache-2.0 Licensed. See LICENSE.