Skip to content

Commit

Permalink
✨ Add tags variable (#4)
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Woffenden <jacob.woffenden@digital.justice.gov.uk>
  • Loading branch information
Jacob Woffenden authored Dec 11, 2023
1 parent 4113f33 commit 48c76c5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ This Terraform module provisions the required resources for Observability Platfo

```hcl
module "observability_platform_tenant" {
source = "ministryofjustice/observability-platform-tenant/aws"
source = "ministryofjustice/observability-platform-tenant/aws"
version = "X.X.X"
observability_platform_account_id = local.environment_management.account_ids["observability-platform-production"]
tags = local.tags
}
```
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ resource "aws_iam_role" "this" {
name = var.role_name
path = "/"
assume_role_policy = data.aws_iam_policy_document.assume.json

tags = var.tags
}

resource "aws_iam_role_policy_attachment" "cloudwatch_readonly_access" {
Expand Down
14 changes: 11 additions & 3 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
variable "role_name" {
type = string
default = "observability-platform"
type = string
description = "Name of the role to create, This is set as a variable but Observability Platform requires this to be set to 'observability-platform'"
default = "observability-platform"
}

variable "observability_platform_account_id" {
type = string
type = string
description = "Account ID of the Observability Platform environment. If you are running on Modernisation Platform you can use 'local.environment_management.account_ids[\"observability-platform-production\"]"
}

variable "tags" {
type = map(string)
default = {}
description = "Tags to apply to resources"
}

0 comments on commit 48c76c5

Please sign in to comment.