feat: add AMI build and environment management commands to CLI#84
Merged
Conversation
**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`
…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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Key Changes:
amisubcommands for AMI build, purge, and resource listingenvsubcommands for environment creation and listing with variant supporttag:Namefor improved AMI selectionAdded:
ami build,ami purge, andami list-resourcescommands to handle EC2Image Builder pipelines and AMI creation, including parallel builds,
progress display, and resource cleanup (
cli/cmd/ami.go)env createto scaffold new deployment environments, supporting randomizedconfig variants and copying infra templates
env listto enumerate available environments and their status(
cli/cmd/env_cmd.go)Changed:
terragrunt.hclfiles to usetag:Nameinstead ofnamefor AMI selection, ensuring precise matching for custom-built AMIsdata.tf) to recognizetag:Namein addition tonameandimage-idfor all OS typesrun-alltorun --allto matchupdated Terragrunt usage
TG_TF_PATHfor compatibility(
cli/internal/terragrunt/runner.go)CLI commands and config defaults for consistency
Removed:
.ansible-lintconfig in favor of updated exclusions in.hooks/linters/ansible-lint.yaml