mcpField
D
data-iac

data-iac

github.com/alexanderstephenthompsonCloud & DevOps37 installs
Repository

About data-iac

data-iac is a skill for writing infrastructure as code for data systems, aimed at teams using Terraform, AWS CDK, or CloudFormation. It covers reusable modules, environment consistency, state management, secret handling, and resource tagging.

Key features

  1. 01Terraform module patterns
  2. 02AWS CDK construct patterns
  3. 03Remote state and locking
  4. 04Shared code across environments
  5. 05Resource tagging and cost allocation
  6. 06Secret handling practices

Use cases

  1. 01Write reusable infrastructure modules for data systems
  2. 02Promote configurations across dev, staging, and production
  3. 03Manage Terraform remote state and locking
  4. 04Tag resources to track ownership and costs

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/alexanderstephenthompson/claude-hub --skill data-iac

After installing, type/data-iacin Claude Code to confirm it loaded.

Bundled filesassets/iac-checklist.mdreferences/terraform-modules.md

Details

From the project README

Data IaC Skill

Version: 1.0 Stack: Terraform, AWS CDK, CloudFormation

Infrastructure without code is infrastructure without memory. Manual console changes create drift that nobody notices until a deploy fails. Hardcoded values mean dev and prod diverge silently. Local state files mean one laptop death away from losing track of what's deployed.

IaC makes infrastructure reviewable, repeatable, and recoverable — the same code for every environment means what works in staging works in prod. These patterns aren't about tidiness. They're about being able to recover when things go wrong, which they always do.


Scope and Boundaries

This skill covers:

  • Terraform module patterns
  • AWS CDK constructs
  • State management
  • Environment promotion
  • Secret handling
  • Tagging and cost allocation

Defers to other skills:

  • security: IAM policies, encryption settings
  • data-aws: Service-specific configurations

Use this skill when: Writing infrastructure code for data systems.


Core Principles

  1. Modules for Reuse — Extract patterns into versioned modules.
  2. Environment Parity — Dev, staging, prod use same code, different vars.
  3. Least Privilege — IAM grants minimum required access.
  4. State is Sacred — Remote state, locking, never manual edits.
  5. Tag Everything — Cost allocation, ownership, environment.

Patterns

Terraform Module Structure
modules/
├── data-lake/
│   ├── main.tf
│   ├── variables.tf
│   ├── outputs.tf
│   └── README.md
└── glue-job/
    ├── main.tf
    ├── variables.tf
    └── outputs.tf

environments/
├── dev/
│   ├── main.tf
│   └── terraform.tfvars
├── staging/
│   └── ...
└── prod/
    └── ...
Required Tags
locals {
  common_tags = {
    Environment = var.environment
    Project     = var.project_name
    ManagedBy   = "terraform"
    Owner       = var.owner_email
    CostCenter  = var.cost_center
  }
}

resource "aws_s3_bucket" "data_lake" {
  bucket = "${var.project_name}-${var.environment}-data-lake"
  tags   = local.common_tags
}
CDK Stack Pattern
import * as cdk from 'aws-cdk-lib';
import * as s3 from 'aws-cdk-lib/aws-s3';

interface DataLakeStackProps extends cdk.StackProps {
  environment: string;
  projectName: string;
}

export class DataLakeStack extends cdk.Stack {
  public readonly rawBucket: s3.Bucket;
  public readonly curatedBucket: s3.Bucket;

  constructor(scope: Construct, id: string, props: DataLakeStackProps) {
    super(scope, id, props);

    this.rawBucket = new s3.Bucket(this, 'RawBucket', {
      bucketName: `${props.projectName}-${props.environment}-raw`,
      versioned: true,
      encryption: s3.BucketEncryption.S3_MANAGED,
    });

    this.curatedBucket = new s3.Bucket(this, 'CuratedBucket', {
      bucketName: `${props.projectName}-${props.environment}-curated`,
      versioned: true,
      encryption: s3.BucketEncryption.S3_MANAGED,
    });
  }
}
Remote State (Terraform)
terraform {
  backend "s3" {
    bucket         = "company-terraform-state"
    key            = "data-platform/${var.environment}/terraform.tfstate"
    region         = "us-east-1"
    encrypt        = true
    dynamodb_table = "terraform-locks"
  }
}

Anti-Patterns

Anti-PatternProblemFix
Local state filesLost state, no collaborationUse remote backend with locking
Hardcoded valuesCan't promote between envsUse variables, tfvars per env
No modulesCopy-paste, drift between envsExtract reusable modules
Manual console changesDrift, undocumentedImport or recreate in code
Secrets in code/stateSecurity riskUse Secrets Manager, reference by ARN
No taggingCan't track costs or ownershipTag everything

Checklist

  • Remote state with locking
  • All resources tagged (environment, project, owner)
  • No secrets in code or variables
  • Modules versioned and documented
  • Same code for all environments
  • Plan reviewed before apply

References

  • references/terraform-modules.md — Module structure and patterns

Assets

  • assets/iac-checklist.md — Infrastructure as Code best practices checklist

Comments

Markdown supported