Regenerate all MDC rules with fresh Exa data and December 2025 best practices

- Refreshed all 241 library rules with current best practices
- Updated Exa search results for all libraries with 2025 content
- Fixed --regenerate-all flag logic to properly process all libraries
- Removed duplicate astro entry in rules.json (merged tags)
- Added missing docker.mdc and vim.mdc files
- All rules now include modern patterns and anti-patterns
- Updated with framework-specific recommendations for 2025

Technical improvements:
- Fixed retry_failed_only logic in generate_mdc_files.py
- Improved progress tracking for regeneration scenarios
- Ensured proper handling of --refresh-exa flag
This commit is contained in:
sanjeed5
2025-12-17 22:40:28 +05:30
parent 331fb6ffac
commit 8fbf269085
244 changed files with 66701 additions and 52708 deletions
+203 -310
View File
@@ -1,349 +1,242 @@
---
description: This rule provides comprehensive guidance on best practices for developing and managing AWS resources using the AWS CLI, covering code organization, security, performance, and testing.
globs: *.sh,*.py,*.yml,*.yaml,*.tf,*.json,*.md
description: Definitive guidelines for secure, reproducible, and efficient use of the AWS CLI, emphasizing modern DevOps practices and automation.
globs: **/*
---
# AWS CLI Best Practices and Coding Standards
# aws-cli Best Practices
This document provides guidelines and recommendations for developing and managing AWS resources using the AWS CLI. Following these practices enhances code quality, security, and operational efficiency.
The AWS CLI is your primary interface for programmatic interaction with AWS. Adhering to these best practices ensures your CLI usage is secure, reproducible, and efficient, aligning with modern DevOps principles.
## 1. Code Organization and Structure
### 1.1. Directory Structure
Organize your AWS CLI interactions into well-defined scripts or functions. Avoid one-off commands for anything beyond simple queries.
A well-organized directory structure promotes maintainability and readability.
### 1.1. Use Named Profiles for Environment Segregation
Always define multiple named profiles for different environments (e.g., `dev`, `test`, `prod`) and projects. This prevents accidental operations in the wrong account.
❌ BAD: Relying on `default` profile or constantly switching credentials.
```bash
# Easy to accidentally target production
aws s3 rm s3://my-prod-bucket --recursive
```
project-root/
├── scripts/ # Shell scripts for common AWS CLI operations
│ ├── create-s3-bucket.sh
│ ├── deploy-lambda.sh
│ └── ...
├── modules/ # Reusable modules (e.g., Python scripts)
│ ├── s3_utils.py # S3 utility functions
│ ├── iam_utils.py # IAM utility functions
│ └── ...
├── config/ # Configuration files
│ ├── aws_config.yml # AWS CLI configuration
│ └── ...
├── terraform/ # Infrastructure as Code (IaC) using Terraform (optional)
│ ├── main.tf
│ ├── variables.tf
│ └── ...
├── tests/ # Test scripts
│ ├── test_s3_utils.py
│ └── ...
├── README.md # Project documentation
└── .gitignore # Git ignore file
✅ GOOD: Explicitly using named profiles.
```bash
# ~/.aws/config
# [profile dev]
# region = us-east-1
# output = json
# [profile prod]
# region = us-east-1
# output = json
### 1.2. File Naming Conventions
# In your script or terminal
aws s3 ls --profile dev
aws s3 rm s3://my-dev-bucket --recursive --profile dev
```
* **Scripts:** Use descriptive names (e.g., `create-ec2-instance.sh`). Suffix with `.sh` for shell scripts.
* **Modules:** Use descriptive names (e.g., `s3_utils.py`). Suffix with `.py` for Python modules.
* **Configuration:** Use `.yml` or `.yaml` for YAML configuration files (e.g., `aws_config.yml`).
* **Terraform:** Follow Terraform conventions (`main.tf`, `variables.tf`).
* **Tests:** Prefix test files with `test_` (e.g., `test_s3_utils.py`).
### 1.2. Pin AWS CLI Version in CI/CD
Ensure consistent behavior by pinning the AWS CLI version in automated environments. Use `awscli-v2` for modern features and stability.
### 1.3. Module Organization
❌ BAD: Relying on the latest available version in CI/CD.
```yaml
# .github/workflows/deploy.yml
# ...
# - name: Install AWS CLI
# run: pip install awscli # Installs latest, potentially breaking changes
```
* **Purpose-Driven Modules:** Group related functionalities into modules (e.g., `s3_utils.py` for S3 operations).
* **Avoid Circular Dependencies:** Design modules to minimize inter-dependencies.
* **Clear Interfaces:** Define clear function signatures and API contracts for each module.
* **Documentation:** Include docstrings to explain the purpose and usage of each function within a module.
### 1.4. Component Architecture
For larger projects, consider a component-based architecture. Each component encapsulates specific AWS-related functionalities. This approach promotes modularity, testability, and reusability.
Example:
components/
├── s3/
│ ├── s3_component.py
│ ├── ...
├── iam/
│ ├── iam_component.py
│ ├── ...
└── ...
### 1.5. Code Splitting
* **Break Down Complex Scripts:** Split large, complex scripts into smaller, more manageable functions or modules.
* **Configuration-Driven Scripts:** Use configuration files to drive script behavior, making them more flexible and reusable.
* **Parameterization:** Parameterize scripts to accept input variables, reducing hardcoding and improving adaptability.
✅ GOOD: Using a specific, tested version (e.g., via Docker).
```yaml
# .github/workflows/deploy.yml
# ...
- name: Deploy with AWS CLI v2
uses: docker://amazon/aws-cli:2.15.30 # Pin to a specific, validated version
with:
args: s3 sync ./app s3://my-bucket-name --delete --profile prod
```
## 2. Common Patterns and Anti-patterns
### 2.1. Design Patterns
Adopt patterns that promote automation, idempotency, and machine-readability.
* **Facade:** Create a facade to simplify complex AWS CLI operations.
* **Adapter:** Use adapters to translate between different data formats (e.g., JSON and YAML).
* **Strategy:** Implement different strategies for error handling or retry mechanisms.
* **Command Pattern:** Encapsulate AWS CLI commands as objects, facilitating command queuing, logging, and undo operations.
### 2.1. Prefer JSON Output and `jq` for Parsing
Always output in `json` format and use `jq` for robust, idempotent parsing. Avoid parsing human-readable formats like `text` or `table`.
### 2.2. Recommended Approaches
❌ BAD: Parsing `text` output is brittle and prone to breakage from CLI updates.
```bash
# Output format can change, breaking script
aws ec2 describe-instances --output text | grep "running" | awk '{print $NF}'
```
* **Configuration Management:** Use environment variables, configuration files, or AWS Systems Manager Parameter Store to manage AWS credentials and configurations.
* **Idempotent Scripts:** Design scripts to be idempotent, meaning that running them multiple times has the same effect as running them once.
* **Logging:** Implement comprehensive logging to track script execution and identify issues.
* **Error Handling:** Use appropriate error handling mechanisms to gracefully handle exceptions.
* **Progress Indicators:** Add progress indicators to provide feedback during long-running operations.
✅ GOOD: Using `json` and `jq` for reliable, structured parsing.
```bash
# Get running instance IDs
aws ec2 describe-instances --filters "Name=instance-state-name,Values=running" \
--query 'Reservations[*].Instances[*].InstanceId' --output json | jq -r '.[] | .[]'
```
### 2.3. Anti-patterns
### 2.2. Embed Validation Steps
Include explicit validation steps in your scripts to catch misconfigurations or permission issues early, preventing costly failures.
* **Hardcoding Credentials:** Avoid hardcoding AWS credentials directly in scripts.
* **Lack of Error Handling:** Failing to handle exceptions can lead to unexpected script termination.
* **Overly Complex Scripts:** Overly complex scripts are difficult to maintain and debug.
* **Ignoring Security Best Practices:** Neglecting security best practices can lead to vulnerabilities.
* **Not using IaC:** Managing infrastructure manually instead of using Infrastructure as Code (IaC) tools such as CloudFormation or Terraform.
❌ BAD: Assuming credentials are correct and permissions are sufficient.
```bash
# Script proceeds even if credentials are bad or lack permissions
aws s3 cp local.txt s3://my-bucket/
```
### 2.4. State Management
* **AWS Systems Manager Parameter Store:** Use Parameter Store to store and manage configuration data and secrets.
* **DynamoDB:** Use DynamoDB to store application state data.
* **S3:** Store state data in S3 buckets, ensuring proper access control.
* **CloudFormation Stack Outputs:** If using CloudFormation, use stack outputs to manage state information.
* **Terraform State:** If using Terraform, properly manage the Terraform state file (e.g., using S3 backend with DynamoDB lock). Never commit the state file to version control.
### 2.5. Error Handling
* **Try-Except Blocks:** Use `try-except` blocks in Python to handle exceptions.
* **Error Codes:** Check for specific error codes returned by AWS CLI commands.
* **Retry Mechanisms:** Implement retry mechanisms with exponential backoff for transient errors.
* **Alerting:** Set up alerting to notify administrators of critical errors.
* **Consistent Error Messages:** Provide clear, informative error messages that help in debugging.
✅ GOOD: Validating caller identity before critical operations.
```bash
if ! aws sts get-caller-identity --profile prod > /dev/null 2>&1; then
echo "ERROR: Failed to authenticate with 'prod' profile. Check credentials and IAM role."
exit 1
fi
aws s3 cp local.txt s3://my-bucket/ --profile prod
```
## 3. Performance Considerations
### 3.1. Optimization Techniques
Optimize CLI commands for speed and resource usage, especially when dealing with large datasets.
### 3.1. Filter at the Source with `--query` and `--filters`
Reduce network traffic and processing by filtering results directly in the CLI command rather than fetching all data and post-processing with `jq`.
* **Parallel Execution:** Use parallel processing to execute multiple AWS CLI commands concurrently.
* **Caching:** Cache frequently accessed data to reduce API calls.
* **Pagination:** Use pagination to retrieve large datasets in smaller chunks.
* **Filtering:** Filter data on the server-side to reduce the amount of data transferred.
* **Asynchronous Operations:** Utilize asynchronous operations when possible to avoid blocking the main thread of execution.
❌ BAD: Fetching all data then filtering locally.
```bash
aws ec2 describe-instances --output json | jq -r '.Reservations[].Instances[] | select(.State.Name=="running") | .InstanceId'
```
### 3.2. Memory Management
✅ GOOD: Filtering on the AWS side using `--filters` and `--query`.
```bash
aws ec2 describe-instances --filters "Name=instance-state-name,Values=running" \
--query 'Reservations[*].Instances[*].InstanceId' --output json | jq -r '.[] | .[]'
```
### 3.2. Leverage Pagination and Batch Operations
For commands that return many results, use `--page-size` and `--max-items` for controlled pagination. For write operations, use batch commands when available to reduce API calls.
* **Large Datasets:** Avoid loading large datasets into memory at once. Use iterators or generators to process data in chunks.
* **Resource Cleanup:** Ensure that resources are properly released after use to prevent memory leaks.
* **Efficient Data Structures:** Use efficient data structures to minimize memory consumption.
✅ GOOD: Efficiently listing many S3 objects.
```bash
# List 1000 objects at a time, then continue, up to 5000 total
aws s3api list-objects-v2 --bucket my-large-bucket --page-size 1000 --max-items 5000 --output json
```
### 3.3. Rendering Optimization (If applicable)
## 4. Common Pitfalls and Gotchas
N/A - The AWS CLI is not a rendering library.
Avoid common mistakes that lead to security vulnerabilities or operational failures.
### 3.4. Bundle Size Optimization (If applicable)
### 4.1. Never Hardcode Credentials
Store credentials securely outside of scripts and version control. Hardcoding is the weakest link in cloud security.
N/A - Bundle size optimization is not directly relevant to the AWS CLI itself, but it might be relevant for tools built on top of it that are distributed as standalone applications.
❌ BAD: Hardcoding `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` in scripts.
```bash
export AWS_ACCESS_KEY_ID="AKIA..." # NEVER DO THIS
export AWS_SECRET_ACCESS_KEY="wJalr..." # NEVER DO THIS
aws s3 ls
```
### 3.5. Lazy Loading
✅ GOOD: Using named profiles, IAM roles, or temporary credentials.
```bash
# Credentials managed in ~/.aws/credentials or assumed via IAM role
aws s3 ls --profile dev
```
### 4.2. Validate Configuration Files
Regularly validate your `~/.aws/config` and `~/.aws/credentials` files, especially after manual edits or when troubleshooting.
✅ GOOD: Using the built-in validation.
```bash
aws configure list --profile dev # Verifies profile exists and lists its configuration
```
## 5. Configuration Management
Centralize and secure your AWS CLI configuration.
### 5.1. Use `~/.aws/config` and `~/.aws/credentials`
These are the standard, secure locations for CLI configuration and credentials. Keep them separate for clarity and security.
```ini
# ~/.aws/config (for profile-specific settings like region, output, role assumption)
[profile dev]
region = us-east-1
output = json
role_arn = arn:aws:iam::123456789012:role/DevRole
source_profile = default
# ~/.aws/credentials (for actual access keys, typically for base profile)
[default]
aws_access_key_id = AKIA...
aws_secret_access_key = wJalr...
```
### 5.2. Store Secrets in AWS Secrets Manager or Parameter Store
For sensitive values (API keys, database passwords) used by CLI scripts, retrieve them dynamically at runtime. Never embed them in scripts or config files directly.
✅ GOOD: Fetching secrets at runtime.
```bash
DB_PASSWORD=$(aws secretsmanager get-secret-value --secret-id my-db-secret --query SecretString --output text --profile dev)
echo "Connecting with password: $DB_PASSWORD"
```
## 6. Environment Variables
Leverage environment variables for dynamic configuration without modifying scripts, enabling portable automation.
### 6.1. Explicitly Set `AWS_PROFILE` and `AWS_REGION`
Control which profile and region your commands target without requiring `--profile` and `--region` flags on every command. This is crucial for CI/CD.
❌ BAD: Forgetting `--profile` or `--region` and relying on defaults.
```bash
aws s3 ls # Might use default profile or wrong region
```
✅ GOOD: Setting environment variables for script context.
```bash
# In a script or shell session
export AWS_PROFILE=prod
export AWS_REGION=us-west-2
aws s3 ls # Will use 'prod' profile in 'us-west-2'
```
## 7. Logging
Implement robust logging for auditability, debugging, and compliance.
### 7.1. Log CLI Commands and Outputs
Capture command invocations and their responses, especially in automated scripts. This provides a clear audit trail.
* **Import Modules on Demand:** Import modules only when they are needed to reduce startup time.
* **Load Configuration As Needed:** Load configuration data only when it is required.
✅ GOOD: Logging to a file or standard output.
```bash
LOG_FILE="aws_script_$(date +%Y%m%d_%H%M%S).log"
echo "Executing: aws s3 ls --profile dev" | tee -a "$LOG_FILE"
aws s3 ls --profile dev | tee -a "$LOG_FILE"
```
### 7.2. Integrate with CloudWatch Logs for CI/CD
In automated pipelines, ensure CLI output is captured and sent to CloudWatch Logs for centralized monitoring, alerting, and long-term retention.
## 8. Testing Approaches
## 4. Security Best Practices
Ensure the reliability and correctness of your AWS CLI scripts through systematic testing.
### 4.1. Common Vulnerabilities
### 8.1. Local Testing with Mocks
For complex scripts, use tools like `moto` (for Python-based AWS interactions) to mock AWS services locally. This enables faster unit testing without incurring AWS costs or hitting actual endpoints.
* **Credential Exposure:** Exposing AWS credentials in code or configuration files.
* **Insufficient Access Control:** Granting excessive permissions to IAM roles or users.
* **SQL Injection (if applicable):** If constructing SQL queries dynamically, protect against SQL injection.
* **Cross-Site Scripting (XSS) (if applicable):** If the CLI interacts with web interfaces, sanitize inputs to prevent XSS.
* **Command Injection:** If constructing shell commands dynamically from user inputs, sanitize inputs to prevent command injection.
### 8.2. CI/CD Integration Tests
Run your CLI scripts as part of your CI/CD pipeline against dedicated, isolated non-production AWS accounts. This validates end-to-end functionality and permissions.
✅ GOOD: Automated pipeline step.
```yaml
# .github/workflows/test.yml
# ...
- name: Run AWS CLI integration tests
run: |
./scripts/validate_s3_bucket.sh --profile test
./scripts/check_lambda_status.sh --profile test
env:
AWS_PROFILE: test # Ensure test profile is used for integration tests
```
### 4.2. Input Validation
* **Sanitize Inputs:** Sanitize all user inputs to prevent malicious code injection.
* **Validate Data Types:** Validate that input data conforms to expected data types.
* **Limit Input Lengths:** Limit the length of input strings to prevent buffer overflows.
* **Regular Expressions:** Use regular expressions to validate input patterns.
* **Whitelist Allowed Values:** If applicable, use a whitelist of allowed values rather than a blacklist.
### 4.3. Authentication and Authorization
* **IAM Roles:** Use IAM roles to grant permissions to AWS resources.
* **Least Privilege:** Follow the principle of least privilege when granting permissions.
* **Multi-Factor Authentication (MFA):** Enable MFA for all IAM users.
* **Credential Rotation:** Rotate AWS credentials regularly.
* **IAM Policies:** Implement granular IAM policies to control access to resources.
### 4.4. Data Protection
* **Encryption:** Encrypt sensitive data at rest and in transit.
* **Access Control Lists (ACLs):** Use ACLs to control access to S3 buckets and objects.
* **Data Masking:** Mask sensitive data to prevent unauthorized access.
* **Regular Backups:** Create regular backups of critical data.
* **Secure Logging:** Ensure that logs do not contain sensitive information and are stored securely.
### 4.5. Secure API Communication
* **HTTPS:** Use HTTPS for all API communication.
* **TLS:** Enforce TLS 1.2 or higher for secure connections.
* **API Gateway:** Use API Gateway to secure and manage API endpoints.
* **Rate Limiting:** Implement rate limiting to prevent denial-of-service attacks.
* **WAF (Web Application Firewall):** Use WAF to protect against common web exploits.
## 5. Testing Approaches
### 5.1. Unit Testing
* **Mock AWS CLI Calls:** Use mocking libraries to simulate AWS CLI calls and verify expected behavior.
* **Test Individual Functions:** Write unit tests for each function or module.
* **Boundary Conditions:** Test boundary conditions and edge cases.
* **Assertion Libraries:** Use assertion libraries to verify expected results.
### 5.2. Integration Testing
* **Test End-to-End Workflows:** Test complete workflows that involve multiple AWS services.
* **Use Real AWS Resources:** Use real AWS resources in a test environment.
* **Automated Test Execution:** Automate integration tests as part of the CI/CD pipeline.
* **Verify Resource Creation and Deletion:** Ensure that resources are created and deleted correctly during testing.
### 5.3. End-to-End Testing
* **Simulate Real-World Scenarios:** Simulate real-world scenarios to test the application's overall behavior.
* **Automated Test Scripts:** Create automated test scripts to verify functionality.
* **Monitor System Behavior:** Monitor system behavior during end-to-end tests.
### 5.4. Test Organization
* **Dedicated Test Directory:** Store test files in a dedicated directory (e.g., `tests/`).
* **Test Naming Conventions:** Follow consistent test naming conventions.
* **Test Suites:** Group related tests into test suites.
* **Test Reports:** Generate test reports to track test results.
### 5.5. Mocking and Stubbing
* **Mock AWS CLI:** Use mocking libraries to simulate AWS CLI behavior.
* **Stub External Dependencies:** Stub external dependencies to isolate components during testing.
* **Control Test Data:** Use controlled test data to ensure predictable test results.
## 6. Common Pitfalls and Gotchas
### 6.1. Frequent Mistakes
* **Incorrect IAM Permissions:** Granting insufficient or excessive IAM permissions.
* **Missing Configuration:** Failing to configure the AWS CLI properly.
* **Hardcoding Values:** Hardcoding values instead of using configuration files or environment variables.
* **Ignoring Error Messages:** Ignoring error messages can lead to unexpected behavior.
* **Not Using Pagination:** Retrieving incomplete datasets due to lack of pagination.
### 6.2. Edge Cases
* **Rate Limiting:** Handling API rate limits gracefully.
* **Service Outages:** Handling service outages or transient errors.
* **Data Consistency:** Ensuring data consistency across multiple AWS services.
* **Concurrency Issues:** Managing concurrency issues when multiple scripts access the same resources.
### 6.3. Version-Specific Issues
* **API Changes:** Handling API changes across different AWS CLI versions.
* **Deprecated Features:** Avoiding deprecated features.
* **Compatibility Issues:** Addressing compatibility issues between different AWS CLI versions and AWS services.
### 6.4. Compatibility Concerns
* **Operating Systems:** Ensuring compatibility across different operating systems (e.g., Linux, Windows, macOS).
* **Programming Languages:** Addressing compatibility issues with different programming languages.
* **Third-Party Libraries:** Managing dependencies on third-party libraries.
### 6.5. Debugging Strategies
* **Logging:** Use comprehensive logging to track script execution.
* **Debugging Tools:** Use debugging tools to step through code and inspect variables.
* **Error Messages:** Analyze error messages carefully to identify the root cause of issues.
* **Verbose Mode:** Use verbose mode to print detailed information about AWS CLI commands.
* **AWS CloudTrail:** Use AWS CloudTrail to track API calls and identify potential issues.
## 7. Tooling and Environment
### 7.1. Recommended Development Tools
* **AWS CLI:** The core command-line interface for interacting with AWS services.
* **Text Editor/IDE:** A suitable text editor or IDE for writing scripts (e.g., VS Code, Sublime Text, PyCharm).
* **Version Control:** Git for version control.
* **Shell:** Bash, Zsh, or PowerShell for running scripts.
* **Python (if applicable):** Python for scripting and automation.
* **jq:** A command-line JSON processor.
* **yq:** A command-line YAML processor.
### 7.2. Build Configuration
* **Makefile:** Use Makefiles to automate common build tasks.
* **Build Scripts:** Create build scripts to package and deploy applications.
* **Dependency Management:** Use appropriate dependency management tools (e.g., pip for Python).
### 7.3. Linting and Formatting
* **Shellcheck:** Use Shellcheck to lint shell scripts.
* **Pylint:** Use Pylint to lint Python code.
* **Black:** Use Black to format Python code.
* **YAML Lint:** Use a YAML linter to validate YAML files.
### 7.4. Deployment
* **AWS CloudFormation:** Deploy infrastructure as code using AWS CloudFormation.
* **AWS CodeDeploy:** Automate application deployments using AWS CodeDeploy.
* **AWS Lambda:** Deploy serverless functions using AWS Lambda.
* **Docker:** Containerize applications using Docker.
### 7.5. CI/CD Integration
* **AWS CodePipeline:** Use AWS CodePipeline to automate the CI/CD process.
* **Jenkins:** Integrate with Jenkins for continuous integration.
* **GitHub Actions:** Use GitHub Actions for CI/CD.
* **Automated Testing:** Integrate automated testing into the CI/CD pipeline.
## Infrastructure as Code (IaC)
* Treat your infrastructure as code using tools like AWS CloudFormation or Terraform. This allows for version control, consistent deployments, and easier management of infrastructure changes.
## Continuous Integration/Continuous Deployment (CI/CD)
* Implement CI/CD pipelines using AWS CodePipeline, ensuring that all code changes are automatically tested and deployed. This includes defining clear stages for building, testing, and deploying applications, and incorporating security checks throughout the pipeline.
## Security
* Employ least-privilege access controls using IAM, enforce multi-factor authentication (MFA), and regularly review permissions. Security should be integrated at every stage of the development and deployment process.
## Automate tasks
* Automate repetitive tasks to increase efficiency and reduce errors.
## Version control
* Ensure robust version control for all code and configuration files.
## Prioritize testing
* Integrate comprehensive testing at every stage to ensure code quality.
## Maintain and adapt
* Regularly update and adapt the pipeline to evolving requirements.
## Monitor and analyze
* Continuously monitor and analyze pipeline performance and outcomes.
## IAM Best Practices:
* Require human users to use federation with an identity provider to access AWS using temporary credentials
* Require workloads to use temporary credentials with IAM roles to access AWS
* Require multi-factor authentication (MFA)
* Update access keys when needed for use cases that require long-term credentials
* Follow best practices to protect your root user credentials
* Apply least-privilege permissions
* Get started with AWS managed policies and move toward least-privilege permissions
* Use IAM Access Analyzer to generate least-privilege policies based on access activity
* Regularly review and remove unused users, roles, permissions, policies, and credentials
* Use conditions in IAM policies to further restrict access
* Verify public and cross-account access to resources with IAM Access Analyzer
* Use IAM Access Analyzer to validate your IAM policies to ensure secure and functional permissions
* Establish permissions guardrails across multiple accounts
* Use permissions boundaries to delegate permissions management within an account
By adhering to these best practices, you can develop robust, secure, and efficient AWS CLI applications.
### 8.3. Policy-as-Code Validation
Before deployment, use tools like AWS Config conformance packs or Open Policy Agent (OPA) to validate that IAM policies and resource configurations (often managed via IaC and CLI) adhere to security and operational best practices.