Skip to content

feat(atlas-terraform-aws-harden): add AWS hardening skill for existing Atlas clusters - #42

Draft
marcosuma wants to merge 1 commit into
mongodb:mainfrom
marcosuma:feat/atlas-terraform-aws-harden
Draft

feat(atlas-terraform-aws-harden): add AWS hardening skill for existing Atlas clusters#42
marcosuma wants to merge 1 commit into
mongodb:mainfrom
marcosuma:feat/atlas-terraform-aws-harden

Conversation

@marcosuma

Copy link
Copy Markdown

Summary

  • Adds the atlas-terraform-aws-harden skill: edits a user's existing Terraform project to add AWS security hardening to an Atlas cluster using the official atlas-aws Landing Zone Module
  • Skill edits files in place (no separate subfolder) — appends to versions.tf, variables.tf, main.tf, outputs.tf, and terraform.tfvars.example
  • Supports BYO or module-created networking (VPC/subnets), KMS key, and S3 bucket
  • Resolves mongodbatlas provider version dynamically (MCP → gh API → WebSearch)
  • Inspects module interface via GitHub API before generating HCL to avoid invalid argument names
  • Runs terraform validate against the user's project directory before presenting edits
  • Includes Terraform < 1.12 compatibility patches for atlas-aws v0.3.x
  • Includes 6 eval scenarios and 17 skill-boundary test cases

Validation prompts tested

  1. "I have an Atlas cluster running. How do I add AWS PrivateLink to it using Terraform?"
  2. "Add KMS encryption at rest to my Atlas cluster on AWS with Terraform"
  3. "I have an Atlas cluster called prod-cluster in project abc123. I want to add PrivateLink, KMS, and S3 backup export using Terraform. I already have subnets subnet-aaa111 and subnet-bbb222 in us-east-1. Let the module create the KMS key and S3 bucket."
  4. "I just deployed my Atlas cluster with Terraform using the getting-started guide. Now I want to add PrivateLink and KMS encryption on AWS."
  5. "I want to create a new MongoDB Atlas cluster on AWS with PrivateLink enabled from the start." (should NOT trigger this skill — redirects to atlas-terraform-getting-started)

Checklist

  • ./tools/validate-skills.sh skills/atlas-terraform-aws-harden/ passes
  • Self-review completed
  • Skill boundary tests added (testing/skills-boundaries/atlas-terraform-harden-vs-skills.json)
  • Eval tests added (testing/atlas-terraform-aws-harden/evals/evals.json)

…g Atlas clusters

Adds atlas-terraform-aws-harden skill that edits a user's existing Terraform
project to add AWS security hardening to an Atlas cluster using the official
terraform-mongodbatlas-modules/atlas-aws/mongodbatlas Landing Zone module.

Features:
- Edits existing project files in place (versions.tf, variables.tf, main.tf,
  outputs.tf, terraform.tfvars.example) — no separate subfolder generated
- AWS PrivateLink private endpoints (BYO subnets or create new VPC/subnets)
- AWS KMS encryption at rest (BYO key ARN or module-created key)
- IAM role for Cloud Provider Access (always module-managed)
- S3 backup export (BYO bucket or module-created bucket)
- Dynamic mongodbatlas provider version resolution via MCP/gh/WebSearch
- Module interface inspection via GitHub API before generating HCL
- terraform validate run against user's project path before presenting edits
- Terraform < 1.12 compatibility patches for atlas-aws v0.3.x
- Eval tests (6 scenarios) and skill boundary tests (17 cases)
terraform version -no-color | head -1
```

If below 1.12, apply using the Edit tool:

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

unsure about leaving this or just forcing to upgrade tf to 1.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant