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!
Requirements
Name | Version |
---|---|
<a name="requirement_terraform"></a> terraform | >= 1.3 |
<a name="requirement_aws"></a> aws | >= 5.32 |
Providers
Name | Version |
---|---|
<a name="provider_aws"></a> 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 |
---|---|---|---|---|
<a name="input_alert_manager_definition"></a> 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"` |
<a name="input_create"></a> create | Determines whether a resources will be created | bool | true | no |
<a name="input_create_workspace"></a> create_workspace | Determines whether a workspace will be created or to use an existing workspace | bool | true | no |
<a name="input_kms_key_arn"></a> kms_key_arn | The ARN of the KMS Key to for encryption at rest | string | null | no |
<a name="input_logging_configuration"></a> logging_configuration | The logging configuration of the prometheus workspace. | map(string) | {} | no |
<a name="input_rule_group_namespaces"></a> rule_group_namespaces | A map of one or more rule group namespace definitions | map(any) | {} | no |
<a name="input_tags"></a> tags | A map of tags to add to all resources | map(string) | {} | no |
<a name="input_workspace_alias"></a> workspace_alias | The alias of the prometheus workspace. See more in the AWS Docs | string | null | no |
<a name="input_workspace_id"></a> workspace_id | The ID of an existing workspace to use when create_workspace is false | string | "" | no |
Outputs
Name | Description |
---|---|
<a name="output_workspace_arn"></a> workspace_arn | Amazon Resource Name (ARN) of the workspace |
<a name="output_workspace_id"></a> workspace_id | Identifier of the workspace |
<a name="output_workspace_prometheus_endpoint"></a> workspace_prometheus_endpoint | Prometheus endpoint available for this workspace |
License
Apache-2.0 Licensed. See LICENSE.