Skip to content

Callnotes 09152025 #11

Merged
merged 4 commits into from
Nov 19, 2025
Merged

Callnotes 09152025 #11

merged 4 commits into from
Nov 19, 2025

Conversation

arnol377
Copy link
Collaborator

@arnol377 arnol377 commented Sep 16, 2025

Simplify Module Interface and Implement Call Notes Improvements

Summary

This PR implements the interface simplification and architectural improvements discussed in the September 15, 2025 call notes between David Arnold and Matthew Morgan. The primary goals were to reduce complexity for end users, consolidate naming conventions, and establish better defaults management.

🎯 Key Improvements

Interface Simplification

  • Reduced user-facing variables by ~60% - Removed redundant and static values from the public interface
  • Unified naming - Single name variable now controls both repository and cluster names (eliminating cluster_config.cluster_name)
  • Hidden implementation complexity - Static values and organizational defaults moved to internal module configuration

Architecture Changes

  • Created defaults.tf - Centralized all module defaults including EKS sizing, organization settings, and repository templates
  • Dynamic value generation - AWS profiles now built dynamically from account_name + environment_abbr
  • Template value passing - All templates now receive computed values instead of hardcoded defaults

Enhanced Artifacts

  • Added config.json generation - Each repository now includes a complete configuration artifact preserving exactly what was used to create that cluster
  • Improved template structure - All Terragrunt HCL files properly reference computed values

πŸ”§ Technical Changes

Variables Cleanup (variables.tf)

  • βœ… Removed repository_template and repository_template_owner (now in defaults)
  • βœ… Removed aws_profile from cluster_config (dynamically generated)
  • βœ… Removed enable_all_modules (defaults to true)
  • βœ… Updated default values for organization and github_server_url
  • βœ… Simplified cluster_config object to only include user-configurable values

New Defaults Management (defaults.tf)

  • βœ… Dynamic AWS profile generation: "${account_name}-${environment_abbr}"
  • βœ… Static repository template configuration (hidden from users)
  • βœ… EKS bootstrap node group defaults (for Karpenter - static values as discussed)
  • βœ… Organization defaults (FinOps project settings)

Template Updates (main.tf)

  • βœ… All templates now receive values from locals instead of hardcoded defaults
  • βœ… Added config.json to rendered files as complete configuration artifact
  • βœ… Updated template calls to pass computed values (EKS sizing, FinOps settings, etc.)

Examples Update

  • βœ… Updated examples/basic/main.tf to use simplified interface
  • βœ… Removed unnecessary organization and github_server_url parameters
  • βœ… Demonstrates clean user experience with minimal required inputs

πŸ“‹ Call Notes Alignment

This implementation directly addresses the feedback from the September 15th call:

Matthew: "Compare this to what you had previously in the config JSON... This is the only thing that should be modified... ideally we want to be able to pass and maintain an object against the module call and that would be it."

Matthew: "We don't need AWS profile because the way the modules handle it, it builds it dynamically from the other two account name and account ID"

Matthew: "This enable all modules true doesn't need to be there either. That's in default assumption."

Matthew: "These values only govern the creation of the Carpenter node group... those are relatively static values."

πŸ—οΈ Before/After Comparison

Before (Complex Interface)

module "eks_deployment" {
  source = "../../"

  name                     = "eks-test-cluster"
  environment             = "dev"
  region                  = "us-gov-east-1"
  organization            = "SCT-Engineering"        # Now default
  github_server_url       = "https://github.e.it.census.gov"  # Now default
  
  cluster_config = {
    cluster_name         = "eks-test-cluster"        # REMOVED - duplicate of name
    account_name         = "csvd-dev-ew"
    aws_account_id       = "229685449397"
    aws_profile          = "csvd-dev-ew-dev"         # REMOVED - dynamically generated
    environment_abbr     = "dev"
    vpc_name             = "vpc3-csvd-dev"
    vpc_domain_name      = "dev.inf.csp1.census.gov"
    cluster_mailing_list = "david.j.arnold.jr@census.gov"
    # Many more static/redundant fields...
  }
}

After (Simplified Interface)

module "eks_deployment" {
  source = "../../"

  name        = "eks-test-cluster"    # Single name for both repo and cluster
  environment = "dev"
  region      = "us-gov-east-1"

  cluster_config = {
    account_name         = "csvd-dev-ew"
    aws_account_id       = "229685449397"
    environment_abbr     = "dev"
    vpc_name             = "vpc3-csvd-dev"
    vpc_domain_name      = "dev.inf.csp1.census.gov"
    cluster_mailing_list = "david.j.arnold.jr@census.gov"
    tags = {
      Owner       = "Platform Team"
      Environment = "Development"
      CostCenter  = "123-456"
    }
    organization = "census:ocio:csvd"
  }

  repository_teams = {
    "platform-team" = "admin"
    "developers"    = "push"
  }
}

πŸ§ͺ Testing

  • βœ… Terraform validation: All configurations validate successfully
  • βœ… Template rendering: All templates generate correct output with computed values
  • βœ… Plan generation: Successfully creates expected resources including config.json
  • βœ… Example functionality: Basic example works with simplified interface

πŸ“Š Generated Artifacts

The module now generates a complete config.json artifact in each repository:

{
  "environment": "dev",
  "region": "us-gov-east-1",
  "cluster_dir": "eks-test-cluster",
  "enable_all_modules": true,
  "account": {
    "account_name": "csvd-dev-ew",
    "aws_account_id": "229685449397",
    "aws_profile": "csvd-dev-ew-dev",  // Dynamically generated
    "environment_abbr": "dev"
  },
  "vpc": {
    "vpc_name": "vpc3-csvd-dev",
    "vpc_domain_name": "dev.inf.csp1.census.gov"
  },
  "cluster": {
    "cluster_name": "eks-test-cluster",
    "cluster_mailing_list": "david.j.arnold.jr@census.gov",
    "eks_instance_disk_size": 200,    // From defaults
    "eks_ng_desired_size": 3,         // From defaults
    "eks_ng_max_size": 10,            // From defaults
    "eks_ng_min_size": 3,             // From defaults
    "organization": "census:ocio:csvd",
    "finops_project_name": "csvd_platformbaseline",     // From defaults
    "finops_project_number": "fs0000000078",            // From defaults
    "finops_project_role": "csvd_platformbaseline_app", // From defaults
    "tags": { /* user-provided tags */ }
  },
  "modules": { /* module enablement settings */ }
}

πŸš€ Impact

  • User Experience: Dramatically simplified interface - users only configure what they actually need to change
  • Maintainability: Centralized defaults make it easier to update static values across all clusters
  • Consistency: Dynamic value generation ensures consistent naming patterns
  • Documentation: Generated config.json serves as complete record of cluster configuration

πŸ”— Related Work

  • Companion workspace implementation in terraform-eks-workspace for multi-cluster management
  • Updated examples demonstrating simplified workflow
  • Implementation plan documented in docs/callnote-09152025-implementation.md

βœ… Checklist

  • Interface simplified based on call notes feedback
  • Static values moved to centralized defaults
  • Dynamic value generation implemented
  • Templates updated to use computed values
  • Examples updated with simplified interface
  • Config.json artifact generation added
  • All tests passing
  • Documentation updated

🎯 Next Steps

  1. Multi-cluster workspace - Complete the terraform-eks-workspace setup for managing multiple clusters
  2. Demo preparation - Ready for September 17th team demonstration
  3. Migration guide - Document migration path for existing users

This PR implements the architectural improvements discussed in the September 15, 2025 call between David Arnold and Matthew Morgan, focusing on interface simplification and better defaults management.

Your Name and others added 4 commits September 16, 2025 13:44
- Created defaults.tf with centralized module defaults
- Updated variables.tf to remove redundant variables (repository_template, etc.)
- Fixed main.tf to pass local values to templates instead of hardcoded defaults
- Updated locals.tf to use new simplified variable structure
- Fixed validation errors and template variable references
- Updated examples to demonstrate simplified user interface
- Consolidated repository and cluster naming to single 'name' variable
- Hidden implementation complexity from users per call notes discussion

Implements Phase 1 of callnotes-09152025 implementation plan.
Ready for Phase 2: eks-clusters-workspace creation.
Copy link

@nangu001 nangu001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nangu001 nangu001 merged commit 71d5719 into main Nov 19, 2025
1 check failed
@nangu001 nangu001 deleted the callnotes_09152025 branch November 19, 2025 22:53
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
3 participants