Skip to content

Commit

Permalink
udpating stuff and things
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Sep 17, 2025
1 parent e63bb01 commit 6eac959
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 43 deletions.
11 changes: 4 additions & 7 deletions defaults.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ locals {
template_owner = "SCT-Engineering"
}

# Default module enablement
enable_all_modules = true

# Static EKS configuration for Karpenter bootstrap node group
eks_defaults = {
instance_disk_size = 200
Expand All @@ -23,10 +20,10 @@ locals {
enable_cluster_creator_admin_permissions = true
}

# Default organization settings
# Organization settings - now configurable through finops variable
organization_defaults = {
finops_project_name = "csvd_platformbaseline"
finops_project_number = "fs0000000078"
finops_project_role = "csvd_platformbaseline_app"
finops_project_name = var.finops.project_name
finops_project_number = var.finops.project_number
finops_project_role = var.finops.project_role
}
}
33 changes: 0 additions & 33 deletions locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -120,40 +120,7 @@ locals {
namespaces = local.all_namespaces
}

# Updated config_json to use new simplified interface and local defaults
config_json = jsonencode({
environment = var.environment
region = var.region
cluster_dir = "platform-cluster"
enable_all_modules = local.enable_all_modules
account = {
account_name = var.cluster_config.account_name
aws_account_id = var.cluster_config.aws_account_id
aws_profile = local.aws_profile
environment_abbr = var.cluster_config.environment_abbr
}
vpc = {
vpc_name = var.cluster_config.vpc_name
vpc_domain_name = var.cluster_config.vpc_domain_name
}
cluster = {
cluster_name = var.name
cluster_mailing_list = var.cluster_config.cluster_mailing_list
eks_instance_disk_size = local.eks_defaults.instance_disk_size
eks_ng_desired_size = local.eks_defaults.ng_desired_size
eks_ng_max_size = local.eks_defaults.ng_max_size
eks_ng_min_size = local.eks_defaults.ng_min_size
enable_cluster_creator_admin_permissions = local.eks_defaults.enable_cluster_creator_admin_permissions
tags = var.cluster_config.tags
}
modules = var.enable_modules
})

managed_extra_files = concat([
{
path = "config.json"
content = local.config_json
},
{
path = "_envcommon/default-versions.hcl"
content = templatefile("${path.module}/templates/default-versions.hcl", local.default_versions)
Expand Down
30 changes: 30 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
locals {
rendered_files = {
"config.json" : jsonencode({
environment = var.environment
region = var.region
cluster_dir = var.name
enable_all_modules = true
account = {
account_name = var.cluster_config.account_name
aws_account_id = var.cluster_config.aws_account_id
aws_profile = local.aws_profile
environment_abbr = var.cluster_config.environment_abbr
}
vpc = {
vpc_name = var.cluster_config.vpc_name
vpc_domain_name = var.cluster_config.vpc_domain_name
}
cluster = {
cluster_name = var.name
cluster_mailing_list = var.cluster_config.cluster_mailing_list
eks_instance_disk_size = local.eks_defaults.instance_disk_size
eks_ng_desired_size = local.eks_defaults.ng_desired_size
eks_ng_max_size = local.eks_defaults.ng_max_size
eks_ng_min_size = local.eks_defaults.ng_min_size
organization = var.cluster_config.organization
finops_project_name = local.organization_defaults.finops_project_name
finops_project_number = local.organization_defaults.finops_project_number
finops_project_role = local.organization_defaults.finops_project_role
tags = var.cluster_config.tags
}
modules = var.enable_modules
}),
"root.hcl" : templatefile("${path.module}/templates/root.hcl.tf.tpl", {
environment = var.environment
}),
Expand Down
17 changes: 14 additions & 3 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ variable "name" {
variable "organization" {
description = "The organization to create the repository in."
type = string
default = "HappyPathway"
default = "SCT-Engineering"
}

variable "environment" {
Expand All @@ -33,6 +33,17 @@ variable "cluster_config" {
})
}

# Organization/FinOps settings - configurable per usage
variable "finops" {
description = "FinOps configuration for cost tracking and billing"
type = object({
project_name = optional(string, "csvd_platformbaseline")
project_number = optional(string, "fs0000000078")
project_role = optional(string, "csvd_platformbaseline_app")
})
default = {}
}

variable "repository_teams" {
description = "A map of teams and their permissions to grant on the repository."
type = map(string)
Expand All @@ -42,13 +53,13 @@ variable "repository_teams" {
variable "github_server_url" {
description = "GitHub Enterprise server URL (e.g., https://github.e.it.census.gov)"
type = string
default = "https://api.github.com"
default = "https://github.e.it.census.gov"
}

variable "is_private" {
description = "Whether the repository should be private."
type = bool
default = true
default = false
}

variable "force_name" {
Expand Down

0 comments on commit 6eac959

Please sign in to comment.