Skip to content

Commit

Permalink
🩻 Add AWS X-Ray (#5)
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 19, 2023
1 parent 48c76c5 commit 0ec3ddc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ resource "aws_iam_role_policy_attachment" "cloudwatch_readonly_access" {
role = aws_iam_role.this.name
policy_arn = "arn:aws:iam::aws:policy/CloudWatchReadOnlyAccess"
}

resource "aws_iam_role_policy_attachment" "xray_readonly_access" {
count = var.enable_xray ? 1 : 0

role = aws_iam_role.this.name
policy_arn = "arn:aws:iam::aws:policy/AWSXrayReadOnlyAccess"
}
8 changes: 7 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ variable "observability_platform_account_id" {
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 "enable_xray" {
type = bool
description = "Enable AWS X-Ray's read only managed policy"
default = false
}

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

0 comments on commit 0ec3ddc

Please sign in to comment.