Skip to content

Commit

Permalink
Add types to all TF vars, remove unused vars and fix all tflint and v…
Browse files Browse the repository at this point in the history
…alidate issues
  • Loading branch information
fgogolli committed Dec 13, 2023
1 parent 33c559c commit 9d85378
Show file tree
Hide file tree
Showing 14 changed files with 294 additions and 175 deletions.
2 changes: 1 addition & 1 deletion deployment/grid/terraform/compute_plane/aws_iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module "keda_role" {
}

cluster_service_accounts = {
"${var.cluster_name}" = ["keda:keda-operator"]
(var.cluster_name) = ["keda:keda-operator"]
}

depends_on = [
Expand Down
2 changes: 1 addition & 1 deletion deployment/grid/terraform/compute_plane/grafana_auth.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ resource "aws_cognito_user_pool_client" "grafana" {
allowed_oauth_flows_user_pool_client = true
generate_secret = true
allowed_oauth_flows = ["code"]
callback_urls = ["https://${data.kubernetes_ingress_v1.grafana_ingress.status.0.load_balancer.0.ingress.0.hostname}/oauth2/idpresponse"]
callback_urls = ["https://${data.kubernetes_ingress_v1.grafana_ingress.status[0].load_balancer[0].ingress[0].hostname}/oauth2/idpresponse"]
allowed_oauth_scopes = [
"email", "openid"
]
Expand Down
4 changes: 2 additions & 2 deletions deployment/grid/terraform/compute_plane/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ locals {
xvda = {
device_name = "/dev/xvda"
ebs = {
volume_size = 50
volume_size = var.eks_node_volume_size
volume_type = "gp3"
encrypted = true
kms_key_id = module.eks_ebs_kms_key.key_arn
Expand Down Expand Up @@ -50,7 +50,7 @@ locals {
xvda = {
device_name = "/dev/xvda"
ebs = {
volume_size = 20
volume_size = var.eks_node_volume_size
volume_type = "gp3"
encrypted = true
kms_key_id = module.eks_ebs_kms_key.key_arn
Expand Down
4 changes: 2 additions & 2 deletions deployment/grid/terraform/compute_plane/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ output "certificate_authority" {

output "nlb_influxdb" {
description = "url of the NLB in front of the influx DB"
value = data.kubernetes_service_v1.influxdb_load_balancer.status.0.load_balancer.0.ingress.0.hostname
value = data.kubernetes_service_v1.influxdb_load_balancer.status[0].load_balancer[0].ingress[0].hostname
}

output "grafana_ingress_domain" {
description = "Ingress Domain for Grafana"
value = "https://${data.kubernetes_ingress_v1.grafana_ingress.status.0.load_balancer.0.ingress.0.hostname}"
value = "https://${data.kubernetes_ingress_v1.grafana_ingress.status[0].load_balancer[0].ingress[0].hostname}"
}

output "eks_managed_node_groups" {
Expand Down
39 changes: 22 additions & 17 deletions deployment/grid/terraform/compute_plane/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

variable "region" {
description = "AWS region"
type = string
}

variable "input_role" {
Expand All @@ -17,31 +18,32 @@ variable "input_role" {

variable "kubernetes_version" {
description = "Name of EKS cluster in AWS"
}

variable "htc_agent_namespace" {
description = "kubernetes namespace for the deployment of the agent"
default = "default"
type = string
}

variable "aws_htc_ecr" {
description = "URL of Amazon ECR image repostiories"
type = string
}

variable "cluster_name" {
description = "Name of EKS cluster in AWS"
type = string
}

variable "k8s_ca_version" {
description = "Cluster autoscaler version"
type = string
}

variable "k8s_keda_version" {
description = "Keda version"
type = string
}

variable "suffix" {
description = "suffix for generating unique name for AWS resource"
type = string
default = ""
}

Expand All @@ -51,22 +53,17 @@ variable "eks_worker_groups" {

variable "vpc_private_subnet_ids" {
description = "Private subnet IDs"
type = list(string)
}

variable "vpc_public_subnet_ids" {
description = "Public subnet IDs"
}

variable "vpc_default_security_group_id" {
description = "Default SG ID"
type = list(string)
}

variable "vpc_id" {
description = "Default VPC ID"
}

variable "vpc_cidr" {
description = "Default VPC CIDR"
type = string
}

variable "enable_private_subnet" {
Expand All @@ -82,11 +79,13 @@ variable "grafana_admin_password" {

variable "kms_deletion_window" {
description = "Number of days after which KMS key will be permanently deleted"
type = number
default = 7
}

variable "kms_key_admin_roles" {
description = "List of roles to assign KMS Key Administrator permissions"
type = list(string)
default = []
}

Expand All @@ -100,10 +99,10 @@ variable "node_drainer_lambda_role_arn" {
type = string
}

variable "allowed_access_cidr_blocks" {
description = "List of CIDR blocks which are allowed ingress/egress access from/to the VPC"
type = list(string)
}
# variable "allowed_access_cidr_blocks" {
# description = "List of CIDR blocks which are allowed ingress/egress access from/to the VPC"
# type = list(string)
# }

variable "cognito_domain_name" {
description = "Cognito Domain Name"
Expand All @@ -119,3 +118,9 @@ variable "cognito_userpool_id" {
description = "Cognito User Pool ID"
type = string
}

variable "eks_node_volume_size" {
description = "Size in GB for EKS Worker Nodes"
type = number
default = 50
}
2 changes: 1 addition & 1 deletion deployment/grid/terraform/control_plane/s3.tf
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,6 @@ module "htc_data_bucket" {
}

tags = {
Tag = "${var.suffix}"
Tag = var.suffix
}
}
Loading

0 comments on commit 9d85378

Please sign in to comment.