Skip to content

Commit

Permalink
Testing optional AMP region
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Woffenden <[email protected]>
  • Loading branch information
jacobwoffenden committed Nov 26, 2024
1 parent 48392a9 commit f686e3d
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,13 @@ locals {
athena_enabled = false
}
"analytical-platform-production" = {
cloudwatch_enabled = true
prometheus_push_enabled = false
amazon_prometheus_query_enabled = true
amazon_prometheus_workspace_id = "ws-a7b353be-244a-47e7-8054-436b41c050d932"
xray_enabled = false
athena_enabled = false
cloudwatch_enabled = true
prometheus_push_enabled = false
amazon_prometheus_query_enabled = true
amazon_prometheus_workspace_region = "eu-west-1"
amazon_prometheus_workspace_id = "ws-a7b353be-244a-47e7-8054-436b41c050d932"
xray_enabled = false
athena_enabled = false
},
"analytical-platform-data-development" = {
cloudwatch_enabled = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ resource "grafana_data_source" "this" {
sigV4Auth = true
sigV4AuthType = "ec2_iam_role"
sigV4AssumeRoleArn = "arn:aws:iam::${var.account_id}:role/observability-platform"
sigV4Region = "eu-west-2"
sigV4Region = var.amazon_prometheus_workspace_region
sigV4ExternalId = var.name
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ variable "account_id" {
type = string
}

variable "amazon_prometheus_workspace_region" {
type = string
}

variable "amazon_prometheus_workspace_id" {
type = string
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ module "amazon_prometheus_query_source" {

source = "../../grafana/amazon-prometheus-query-source"

name = each.key
account_id = var.environment_management.account_ids[each.key]
amazon_prometheus_workspace_id = each.value.amazon_prometheus_workspace_id
name = each.key
account_id = var.environment_management.account_ids[each.key]
amazon_prometheus_workspace_region = try(each.value.amazon_prometheus_workspace_region, "eu-west-2")
amazon_prometheus_workspace_id = each.value.amazon_prometheus_workspace_id
}

locals {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ variable "identity_centre_team" {

variable "aws_accounts" {
type = map(object({
cloudwatch_enabled = optional(bool)
cloudwatch_custom_namespaces = optional(string)
prometheus_push_enabled = optional(bool)
amazon_prometheus_query_enabled = optional(bool)
amazon_prometheus_workspace_id = optional(string)
xray_enabled = optional(bool)
athena_enabled = optional(bool)
cloudwatch_enabled = optional(bool)
cloudwatch_custom_namespaces = optional(string)
prometheus_push_enabled = optional(bool)
amazon_prometheus_query_enabled = optional(bool)
amazon_prometheus_workspace_region = optional(string)
amazon_prometheus_workspace_id = optional(string)
xray_enabled = optional(bool)
athena_enabled = optional(bool)
athena_config = optional(map(object({
database = string
workgroup = string
Expand Down

0 comments on commit f686e3d

Please sign in to comment.