### Install and Run Pre-commit Hooks Source: https://github.com/cloudposse-terraform-components/aws-ecr/blob/main/AGENTS.md Installs the pre-commit framework locally and then runs all configured hooks, including terraform_fmt, terraform_docs, and tflint. Ensures code is formatted and linted before committing. ```bash pre-commit install && pre-commit run -a ``` -------------------------------- ### Initialize TFLint Source: https://github.com/cloudposse-terraform-components/aws-ecr/blob/main/AGENTS.md Initializes the TFLint static analysis tool based on the configuration defined in the .tflint.hcl file. This step is necessary before running TFLint checks. ```bash tflint --init ``` -------------------------------- ### Explore Additional Atmos Test Options Source: https://github.com/cloudposse-terraform-components/aws-ecr/blob/main/README.md View available options and commands for running Terraform tests with Atmos. Use this to understand advanced configurations and parameters. ```bash atmos test --help ``` -------------------------------- ### Generate Simple README.md with Atmos Source: https://github.com/cloudposse-terraform-components/aws-ecr/blob/main/AGENTS.md Regenerates a simplified README.md file specifically for the src/ directory using README.yaml and Terraform source. This is useful for component-level documentation. ```bash atmos docs generate readme-simple ``` -------------------------------- ### Generate README.md with Atmos Source: https://github.com/cloudposse-terraform-components/aws-ecr/blob/main/AGENTS.md Regenerates the main README.md file from README.yaml and Terraform source files. Ensure README.yaml is updated when inputs or outputs change. ```bash atmos docs generate readme ``` -------------------------------- ### Run Terratest Suite with Atmos Source: https://github.com/cloudposse-terraform-components/aws-ecr/blob/main/AGENTS.md Executes the Terratest suite located in the test/ directory. This command creates and destroys real AWS resources, so ensure AWS credentials are configured. Tests may incur costs. ```bash atmos test run ``` -------------------------------- ### Format Terraform Code Recursively Source: https://github.com/cloudposse-terraform-components/aws-ecr/blob/main/AGENTS.md Applies Terraform formatting rules recursively to all .tf files within the current directory and its subdirectories. This ensures consistent code style. ```bash terraform fmt -recursive ``` -------------------------------- ### Configure ECR Component Source: https://github.com/cloudposse-terraform-components/aws-ecr/blob/main/src/README.md Use this configuration to define ECR repositories, lifecycle policies, and image tag mutability settings. Specify images to be created and configure account role mappings for read/write and read-only access. ```yaml components: terraform: ecr: vars: ecr_user_enabled: false enable_lifecycle_policy: true max_image_count: 500 scan_images_on_push: true protected_tags: - prod # Tag mutability supports: MUTABLE, IMMUTABLE, IMMUTABLE_WITH_EXCLUSION, MUTABLE_WITH_EXCLUSION image_tag_mutability: IMMUTABLE_WITH_EXCLUSION # When using *_WITH_EXCLUSION, specify exclusions to allow certain tags to be mutable image_tag_mutability_exclusion_filter: - filter: "latest" filter_type: "WILDCARD" - filter: "dev-" filter_type: "WILDCARD" images: - infrastructure - microservice-a - microservice-b - microservice-c read_write_account_role_map: identity: - admin - cicd automation: - admin read_only_account_role_map: corp: ["*"] dev: ["*"] prod: ["*"] stage: ["*"] ``` -------------------------------- ### Clean Up Terraform Test Artifacts with Atmos Source: https://github.com/cloudposse-terraform-components/aws-ecr/blob/main/README.md Remove temporary files and artifacts generated during Terraform test runs. This command helps maintain a clean testing environment. ```bash atmos test clean ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.