Skip to content

Commit b5f8c1b

Browse files
committed
feat!: Add tags to workspace and bump min supported version of AWS provider to support
1 parent d3164ee commit b5f8c1b

File tree

9 files changed

+47
-12
lines changed

9 files changed

+47
-12
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.56.0
3+
rev: v1.64.1
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_validate
@@ -23,7 +23,7 @@ repos:
2323
- '--args=--only=terraform_standard_module_structure'
2424
- '--args=--only=terraform_workspace_remote'
2525
- repo: https://github.com/pre-commit/pre-commit-hooks
26-
rev: v4.0.1
26+
rev: v4.2.0
2727
hooks:
2828
- id: check-merge-conflict
2929
- id: end-of-file-fixer

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ Examples codified under the [`examples`](./examples) are intended to give users
5757
| Name | Version |
5858
|------|---------|
5959
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
60-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.64 |
60+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.1 |
6161

6262
## Providers
6363

6464
| Name | Version |
6565
|------|---------|
66-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.64 |
66+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.1 |
6767

6868
## Modules
6969

@@ -84,6 +84,7 @@ No modules.
8484
| <a name="input_alert_manager_definition"></a> [alert\_manager\_definition](#input\_alert\_manager\_definition) | The alert manager definition that you want to be applied. See more in the [AWS Docs](https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-alert-manager.html) | `string` | `null` | no |
8585
| <a name="input_create"></a> [create](#input\_create) | Determines whether a resources will be created | `bool` | `true` | no |
8686
| <a name="input_rule_group_namespaces"></a> [rule\_group\_namespaces](#input\_rule\_group\_namespaces) | A map of one or more rule group namespace definitions | `map(any)` | `{}` | no |
87+
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to add to all resources | `map(string)` | `{}` | no |
8788
| <a name="input_workspace_alias"></a> [workspace\_alias](#input\_workspace\_alias) | The alias of the prometheus workspace. See more in the [AWS Docs](https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-onboard-create-workspace.html) | `string` | `null` | no |
8889

8990
## Outputs

examples/complete/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Note that this example may create resources which will incur monetary charges on
2424
| Name | Version |
2525
|------|---------|
2626
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
27-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.64 |
27+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.1 |
2828

2929
## Providers
3030

examples/complete/outputs.tf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
# aws_prometheus_workspace
1+
################################################################################
2+
# Workspace
3+
################################################################################
4+
25
output "workspace_arn" {
36
description = "Amazon Resource Name (ARN) of the workspace"
47
value = module.prometheus.workspace_arn

examples/complete/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 3.64"
7+
version = ">= 4.1"
88
}
99
}
1010
}

main.tf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,29 @@
1+
################################################################################
2+
# Workspace
3+
################################################################################
4+
15
resource "aws_prometheus_workspace" "this" {
26
count = var.create ? 1 : 0
37

48
alias = var.workspace_alias
9+
tags = var.tags
510
}
611

12+
################################################################################
13+
# Alert Manager Definition
14+
################################################################################
15+
716
resource "aws_prometheus_alert_manager_definition" "this" {
817
count = var.create ? 1 : 0
918

1019
workspace_id = aws_prometheus_workspace.this[0].id
1120
definition = var.alert_manager_definition
1221
}
1322

23+
################################################################################
24+
# Rule Group Namespace
25+
################################################################################
26+
1427
resource "aws_prometheus_rule_group_namespace" "this" {
1528
for_each = var.create ? var.rule_group_namespaces : {}
1629

outputs.tf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
# aws_prometheus_workspace
1+
################################################################################
2+
# Workspace
3+
################################################################################
4+
25
output "workspace_arn" {
36
description = "Amazon Resource Name (ARN) of the workspace"
47
value = try(aws_prometheus_workspace.this[0].arn, "")

variables.tf

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,36 @@ variable "create" {
44
default = true
55
}
66

7-
# aws_prometheus_workspace
7+
variable "tags" {
8+
description = "A map of tags to add to all resources"
9+
type = map(string)
10+
default = {}
11+
}
12+
13+
################################################################################
14+
# Workspace
15+
################################################################################
16+
817
variable "workspace_alias" {
918
description = "The alias of the prometheus workspace. See more in the [AWS Docs](https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-onboard-create-workspace.html)"
1019
type = string
1120
default = null
1221
}
1322

14-
# aws_prometheus_alert_manager_definition
23+
################################################################################
24+
# Alert Manager Definition
25+
################################################################################
26+
1527
variable "alert_manager_definition" {
1628
description = "The alert manager definition that you want to be applied. See more in the [AWS Docs](https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-alert-manager.html)"
1729
type = string
1830
default = null
1931
}
2032

21-
# aws_prometheus_rule_group_namespace
33+
################################################################################
34+
# Rule Group Namespace
35+
################################################################################
36+
2237
variable "rule_group_namespaces" {
2338
description = "A map of one or more rule group namespace definitions"
2439
type = map(any)

versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 3.64"
7+
version = ">= 4.1"
88
}
99
}
1010
}

0 commit comments

Comments
 (0)