Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .env.aws.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# These variables are required and don't have default values
# You must provide values for these to run the deployment successfully

TERRAFORM_ENVIRONMENT=dev

AWS_PROFILE=
AWS_ACCOUNT_ID=
AWS_REGION=
Expand Down
2 changes: 1 addition & 1 deletion iac/provider-aws/init/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module "network" {
source = "../modules/network"

prefix = var.prefix
vcp_availability_zones = ["${var.region}a", "${var.region}b", "${var.region}c"]
vpc_availability_zones = ["${var.region}a", "${var.region}b", "${var.region}c"]
vpc_endpoint_ingress_subnet_ids = var.endpoint_ingress_subnet_ids
}

Expand Down
22 changes: 14 additions & 8 deletions iac/provider-aws/init/secrets.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,13 @@ resource "aws_secretsmanager_secret" "grafana" {
resource "aws_secretsmanager_secret_version" "grafana" {
secret_id = aws_secretsmanager_secret.grafana.id
secret_string = jsonencode({
"API_KEY" = " ",
"OTLP_URL" = " ",
"OTEL_COLLECTOR_TOKEN" = " ",
"USERNAME" = " ",
"API_KEY" = " ",
"OTLP_URL" = " ",
"OTEL_COLLECTOR_TOKEN" = " ",
"USERNAME" = " ",
"LOGS_USER" = " ",
"LOGS_URL" = " ",
"LOGS_COLLECTOR_API_TOKEN" = " ",
})

lifecycle {
Expand All @@ -79,10 +82,13 @@ locals {

output "grafana" {
value = {
api_key = local.grafana_raw["API_KEY"]
otlp_url = local.grafana_raw["OTLP_URL"]
otel_collector_token = local.grafana_raw["OTEL_COLLECTOR_TOKEN"]
username = local.grafana_raw["USERNAME"]
api_key = local.grafana_raw["API_KEY"]
otlp_url = local.grafana_raw["OTLP_URL"]
otel_collector_token = local.grafana_raw["OTEL_COLLECTOR_TOKEN"]
username = local.grafana_raw["USERNAME"]
logs_user = local.grafana_raw["LOGS_USER"]
logs_url = local.grafana_raw["LOGS_URL"]
logs_collector_api_token = local.grafana_raw["LOGS_COLLECTOR_API_TOKEN"]
}
sensitive = true
}
Expand Down
4 changes: 4 additions & 0 deletions iac/provider-aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ module "nomad" {
grafana_otlp_url = module.init.grafana.otlp_url
grafana_username = module.init.grafana.username

grafana_logs_user = module.init.grafana.logs_user
grafana_logs_endpoint = module.init.grafana.logs_url
grafana_logs_api_key = module.init.grafana.logs_collector_api_token

api_node_pool = local.api_pool_name
clickhouse_node_pool = local.clickhouse_pool_name
clickhouse_jobs_prefix = local.clickhouse_jobs_prefix
Expand Down
4 changes: 2 additions & 2 deletions iac/provider-aws/modules/network/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module "vpc" {
name = "${var.prefix}vpc"
cidr = var.vpc_cidr

azs = var.vcp_availability_zones
azs = var.vpc_availability_zones
public_subnets = var.vpc_public_subnets
private_subnets = var.vpc_private_subnets
elasticache_subnets = var.vpc_elasticache_subnets
Expand Down Expand Up @@ -105,7 +105,7 @@ module "vpc_endpoints" {

secrets_manager = {
service = "secretsmanager"
service_type = "Interface" // gateway endpoint nots supported
service_type = "Interface" // gateway endpoint not supported
subnet_ids = [
local.default_private_subnet_ids[0],
local.default_private_subnet_ids[1],
Expand Down
2 changes: 1 addition & 1 deletion iac/provider-aws/modules/network/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ variable "vpc_elasticache_subnets" {
default = ["10.0.21.0/24", "10.0.22.0/24", "10.0.23.0/24"]
}

variable "vcp_availability_zones" {
variable "vpc_availability_zones" {
type = list(string)
description = "List of availability zones to use for the VPC subnets"
}
Expand Down
4 changes: 4 additions & 0 deletions iac/provider-aws/nomad/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ module "logs_collector" {

vector_health_port = var.logs_health_proxy_port
vector_api_port = var.logs_proxy_port

grafana_logs_user = var.grafana_logs_user
grafana_logs_endpoint = var.grafana_logs_endpoint
grafana_api_key = var.grafana_logs_api_key
}

# ---
Expand Down
16 changes: 16 additions & 0 deletions iac/provider-aws/nomad/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,22 @@ variable "grafana_username" {
sensitive = true
}

variable "grafana_logs_user" {
type = string
default = ""
}

variable "grafana_logs_endpoint" {
type = string
default = ""
}

variable "grafana_logs_api_key" {
type = string
default = ""
sensitive = true
}

# API
variable "api_port" {
type = number
Expand Down
Loading