Skip to content

feat: add AMI build and environment management commands to CLI#84

Merged
l50 merged 6 commits into
mainfrom
chore/rebrand-goad-to-dreadgoad
Apr 7, 2026
Merged

feat: add AMI build and environment management commands to CLI#84
l50 merged 6 commits into
mainfrom
chore/rebrand-goad-to-dreadgoad

Conversation

@l50
Copy link
Copy Markdown
Contributor

@l50 l50 commented Apr 7, 2026

Key Changes:

  • Introduced new ami subcommands for AMI build, purge, and resource listing
  • Added env subcommands for environment creation and listing with variant support
  • Updated infrastructure AMI filters to use tag:Name for improved AMI selection
  • Enhanced Terragrunt runner and module dependencies to support new workflows

Added:

  • AMI management CLI:
    • ami build, ami purge, and ami list-resources commands to handle EC2
      Image Builder pipelines and AMI creation, including parallel builds,
      progress display, and resource cleanup (cli/cmd/ami.go)
  • Environment management CLI:
    • env create to scaffold new deployment environments, supporting randomized
      config variants and copying infra templates
    • env list to enumerate available environments and their status
      (cli/cmd/env_cmd.go)

Changed:

  • AMI filter logic in infrastructure:
    • Updated all relevant terragrunt.hcl files to use tag:Name instead of
      name for AMI selection, ensuring precise matching for custom-built AMIs
    • Adjusted module logic (data.tf) to recognize tag:Name in addition to
      name and image-id for all OS types
  • Terragrunt runner improvements:
    • Changed run-all command invocation from run-all to run --all to match
      updated Terragrunt usage
    • Updated binary path environment variable to TG_TF_PATH for compatibility
      (cli/internal/terragrunt/runner.go)
  • Documentation and naming:
    • Rebranded CLI help text and comments from "GOAD" to "DreadGOAD" throughout
      CLI commands and config defaults for consistency
    • Updated module comments for clarity and accuracy

Removed:

  • Ansible-lint configuration:
    • Deleted legacy .ansible-lint config in favor of updated exclusions in
      .hooks/linters/ansible-lint.yaml

l50 added 2 commits April 6, 2026 19:32
**Added:**

- Introduced new `ami` CLI command for AMI image management, including subcommands
  for building, purging, and listing EC2 Image Builder pipeline resources
  (`cli/cmd/ami.go`)
- Added `env` CLI command for managing deployment environments, supporting
  creation (with variant config generation) and listing of environments
  (`cli/cmd/env_cmd.go`)

**Changed:**

- Updated `go.mod` and `go.sum` to include dependencies for warpgate v3,
  AWS Image Builder, and related tooling
- Upgraded various indirect dependencies to match requirements for AMI and
  variant config features
- Modified `terragrunt/runner.go` to:
  - Change run-all invocation to `terragrunt run --all` instead of `run-all`
  - Use `TG_TF_PATH` environment variable for Terraform binary override
  - Remove redundant or outdated comments for clarity
  - Improve argument handling and logging for consistency with new commands
…stance modules

**Changed:**

- Standardized all user-facing references from "GOAD" to "DreadGOAD" in CLI
  commands, help texts, config defaults, and code comments to reflect new
  branding
- Updated Exchange extension description to reference "DreadGOAD lab" for
  consistency in configuration defaults
- Adjusted logic for AMI lookup in the terraform-aws-instance-factory module:
  now considers "tag:Name" in addition to "name" and "image-id" when checking
  for custom filters, improving flexibility in AMI selection for Linux,
  Windows, and macOS instances
- Modified Terragrunt configurations for staging and test environments to use
  "tag:Name" with specific values (e.g., "goad-dc-base") in
  `additional_windows_ami_filters` to align with updated AMI filter logic
- Removed references to the old `.ansible-lint` config file and ensured
  Ansible linting excludes the `infra/` directory through the central linter
  YAML configuration

**Removed:**

- Deleted the legacy `.ansible-lint` configuration file, consolidating linting
  paths and exclusions in `.hooks/linters/ansible-lint.yaml`
@dreadnode-renovate-bot dreadnode-renovate-bot Bot added the area/pre-commit Changes made to pre-commit hooks label Apr 7, 2026
l50 added 4 commits April 6, 2026 20:50
…eate

**Added:**

- Generate an Ansible inventory file (`{env}-inventory`) when creating a new
  environment, using a reference inventory as a template and updating variables
- Introduced `generateInventory` function to handle inventory customization,
  replacing env, region, bucket, and instance IDs, and stripping IP fields

**Changed:**

- Updated help text and next steps output to document creation and review of the
  new inventory file as part of the environment provisioning workflow
- Adjusted step numbers and instructions in the environment creation output to
  include inventory review and syncing instance IDs after infra apply
…-dreadgoad

# Conflicts:
#	cli/cmd/ami.go
#	cli/cmd/env_cmd.go
**Changed:**

- Increased the range from 10 to 20 lines when scanning for "...ignoring" after
  a "fatal:" log line, improving handling of lengthy multi-line YAML outputs in
  ansible log parsing logic (logparser.go)
@l50 l50 merged commit 154af82 into main Apr 7, 2026
6 checks passed
@l50 l50 deleted the chore/rebrand-goad-to-dreadgoad branch April 7, 2026 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/pre-commit Changes made to pre-commit hooks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant