Skip to content

Commit ccfc400

Browse files
Add multi-cloud support and comprehensive documentation
Update development environment to support AWS, Azure, and GCP with necessary tools and CLIs. Add detailed USAGE.md guide for setup and configuration. Update CHANGELOG.md with version 1.2.2 features and enhancements. Improve README with additional information.
1 parent 4de9d5d commit ccfc400

File tree

3 files changed

+552
-104
lines changed

3 files changed

+552
-104
lines changed

CHANGELOG.md

Lines changed: 39 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,45 @@
1-
# Change Log
1+
# Changelog
22

3-
All notable changes to this project will be documented in this file.
3+
All notable changes to the Terraform Development Environment will be documented in this file.
44

5-
The format is based on [Keep a Changelog](http://keepachangelog.com/)
6-
and this project adheres to [Semantic Versioning](http://semver.org/).
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [1.2.1](https://github.com/awslabs/aws-terraform-dev-container/compare/v1.2.0...v1.2.1) (2023-01-06)
9-
10-
11-
### Bug Fixes
12-
13-
* remove installation of tools, since there's no tf project ([9aad887](https://github.com/awslabs/aws-terraform-dev-container/commit/9aad88774ebebb4a5772e3aa9004e14b69e4eea9))
14-
15-
## [1.2.0](https://github.com/awslabs/aws-terraform-dev-container/compare/v1.1.0...v1.2.0) (2023-01-06)
16-
17-
18-
### Features
19-
20-
* create worfklow to release project ([0e83f23](https://github.com/awslabs/aws-terraform-dev-container/commit/0e83f2321dd530cc6fb575fc492ad0e828907367))
21-
22-
23-
### Bug Fixes
24-
25-
* correct package name ([e32b5ce](https://github.com/awslabs/aws-terraform-dev-container/commit/e32b5ce3ee28e7da6421907445935275fe36d0d9))
26-
27-
## [Unreleased]
28-
29-
## [v1.1.0] - 2022-10-28
8+
## [1.2.2] - 2025-06-10
309

3110
### Added
3211

33-
- [Adopt AWS Code Habits](https://github.com/awslabs/aws-code-habits)
34-
35-
## [v1.0.0] - 2022-10-14
36-
37-
First release! 🚀
38-
39-
[unreleased]: https://github.com/awslabs/aws-terraform-dev-container/compare/v1.0.0...HEAD
40-
[1.1.0]: https://github.com/awslabs/aws-terraform-dev-container/compare/v1.0.0...v1.1.0
12+
- Initial release of the Terraform Development Environment
13+
- Multi-cloud support for AWS, Azure, and GCP
14+
- Terraform CLI v1.5.7
15+
- Supporting tools:
16+
- terraform-docs v0.16.0
17+
- tflint v0.47.0 with AWS, Azure, and GCP rulesets
18+
- tfsec v1.28.0
19+
- terrascan v1.18.3
20+
- terragrunt v0.48.0
21+
- infracost v0.10.28
22+
- checkov v2.3.360
23+
- Cloud provider CLIs:
24+
- AWS CLI v2
25+
- Azure CLI
26+
- Google Cloud SDK
27+
- Authentication helper scripts for AWS, Azure, and GCP
28+
- Pre-commit hooks for Terraform validation, formatting, and security scanning
29+
- VS Code tasks for common Terraform operations
30+
- VS Code settings and extensions for Terraform development
31+
- Persistent volume mounts for credentials and caching
32+
- Comprehensive documentation in README.md and USAGE.md
33+
34+
### Changed
35+
36+
- Updated from the base AWS Terraform Dev Container
37+
- Enhanced Dockerfile with modular installation scripts
38+
- Improved pre-commit configuration with additional hooks
39+
- Extended VS Code tasks and settings
40+
41+
### Fixed
42+
43+
- Path issues in post-start script
44+
- Permission issues with credential directories
45+
- TFLint configuration for multi-cloud support

README.md

Lines changed: 132 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,173 @@
1-
<!--
2-
** MANAGED BY AWS CODE HABITS
3-
** DO NOT EDIT THIS FILE
4-
**
5-
** 1) Make all changes to `doc/habits.yaml`
6-
** 2) Run `make doc/build` to rebuild this file
7-
**
8-
-->
1+
# Terraform Development Environment
92

10-
![logo][logo]
3+
A comprehensive VS Code Dev Container with tools to help you build and manage infrastructure with Terraform across AWS, Azure, and GCP.
114

5+
## Features
126

13-
# AWS Terraform Dev Container
7+
- **Multi-cloud Support**: Pre-installed CLIs and tools for AWS, Azure, and GCP
8+
- **Terraform Ecosystem**: Complete suite of Terraform tools including terraform-docs, tflint, tfsec, terrascan, and more
9+
- **Security Best Practices**: Pre-commit hooks for security scanning and credential management
10+
- **Developer Experience**: VS Code integration with tasks, settings, and extensions
11+
- **Performance Optimization**: Caching strategies and optimized volume mounts
1412

15-
A VSCode Dev Container with [tools][tools] to help you build and manage AWS infrastructure with Terraform
13+
## Prerequisites
1614

17-
| ![screenshot-1](doc/images/screenshot-1.gif) |
18-
|:--:|
19-
| *Develop your project in a Docker container* |
15+
- [Docker](https://www.docker.com/products/docker-desktop/) - Required for running containers
16+
- [Visual Studio Code](https://code.visualstudio.com/) - The recommended IDE
17+
- [VS Code Remote Development Extension Pack](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack) - Required for Dev Containers
2018

21-
| ![screenshot-2](doc/images/screenshot-2.gif) |
22-
|:--:|
23-
| *Increase productivity with well-defined `Make` commands* |
19+
## Getting Started
2420

25-
| ![screenshot-3](doc/images/screenshot-3.gif) |
26-
|:--:|
27-
| *Ensure every team member has all the tools on their correct versions* |
21+
1. Clone this repository:
22+
```bash
23+
git clone <repository-url>
24+
```
2825

29-
| ![screenshot-4](doc/images/screenshot-4.png) |
30-
|:--:|
31-
| *Extensions already installed for you* |
26+
2. Open the folder in VS Code:
27+
```bash
28+
code .
29+
```
3230

31+
3. When prompted, click "Reopen in Container" or use the command palette (F1) and select "Remote-Containers: Reopen in Container"
3332

34-
## Table of Contents
33+
4. Wait for the container to build and initialize (this may take a few minutes the first time)
3534

36-
- [Getting Started](#getting-started)
35+
## Included Tools
3736

38-
- [Prerequisites](#prerequisites)
37+
| Tool | Version | Description |
38+
|------|---------|-------------|
39+
| Terraform | 1.5.7 | Infrastructure as Code tool |
40+
| AWS CLI | v2 | Command line interface for AWS |
41+
| Azure CLI | Latest | Command line interface for Azure |
42+
| Google Cloud SDK | Latest | Command line interface for GCP |
43+
| terraform-docs | 0.16.0 | Documentation generator for Terraform modules |
44+
| tflint | 0.47.0 | Terraform linter |
45+
| tfsec | 1.28.0 | Security scanner for Terraform code |
46+
| terrascan | 1.18.3 | Detect compliance and security violations |
47+
| terragrunt | 0.48.0 | Thin wrapper for Terraform that provides extra tools |
48+
| infracost | 0.10.28 | Cloud cost estimates for Terraform |
49+
| checkov | 2.3.360 | Static code analysis tool for IaC |
50+
| pre-commit | Latest | Framework for managing git pre-commit hooks |
3951

52+
## Authentication
4053

41-
- [Usage](#usage)
54+
The container includes helper scripts for authenticating with each cloud provider:
4255

56+
### AWS Authentication
4357

58+
```bash
59+
.devcontainer/scripts/aws-auth.sh [--profile PROFILE] [--region REGION] [--sso]
60+
```
4461

62+
### Azure Authentication
4563

46-
## Getting Started
64+
```bash
65+
.devcontainer/scripts/azure-auth.sh [--subscription SUBSCRIPTION_ID] [--tenant TENANT_ID] [--service-principal] [--client-id CLIENT_ID] [--client-secret CLIENT_SECRET]
66+
```
67+
68+
### GCP Authentication
4769

48-
1. On a terminal, inside your Terraform project, execute the following on Mac, Linux or [WSL][wsl]:
4970
```bash
50-
curl -sL https://raw.githubusercontent.com/awslabs/aws-terraform-dev-container/main/scripts/init.sh | bash
51-
````
52-
2. Open the folder with VSCode
53-
3. Reopen in Container
71+
.devcontainer/scripts/gcp-auth.sh [--project PROJECT_ID] [--credentials FILE_PATH]
72+
```
5473

55-
To reopen in container manually, open the [command pallete](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) on VS Code and select `Rebuild and Reopen in Container`
74+
## VS Code Tasks
5675

76+
The environment includes pre-configured VS Code tasks for common operations:
5777

58-
## Prerequisites
59-
A list of things you need, or how to install them.
78+
- **Terraform: Init** - Initialize a Terraform working directory
79+
- **Terraform: Plan** - Generate and show an execution plan
80+
- **Terraform: Apply** - Build or change infrastructure
81+
- **Terraform: Destroy** - Destroy Terraform-managed infrastructure
82+
- **Terraform: Validate** - Validate the Terraform files
83+
- **Terraform: Format** - Rewrite Terraform configuration files to canonical format
84+
- **TFLint: Run** - Run TFLint for static analysis
85+
- **TFSec: Run** - Run TFSec for security scanning
86+
- **Checkov: Run** - Run Checkov for compliance checks
87+
- **Pre-commit: Run All Hooks** - Run all pre-commit hooks
6088

61-
- [Docker](https://www.docker.com/products/docker-desktop/) - The fastest way to containerize applications
62-
- [Visual Studio Code](https://code.visualstudio.com/) - Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications.
63-
- [VSCode Remote Development Extension Pack](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack) - An extension pack that lets you open any folder in a container, on a remote machine, or in WSL and take advantage of VS Code's full feature set.
89+
To run a task, press `Ctrl+Shift+P` (or `Cmd+Shift+P` on macOS) and select "Tasks: Run Task", then choose the task you want to run.
6490

91+
## Pre-commit Hooks
6592

93+
The environment includes pre-configured pre-commit hooks for Terraform validation, formatting, and security scanning. To install the hooks:
6694

67-
## Usage
68-
```bash
69-
make [tab][tab]
70-
```
71-
For example, if you want to explore the most common [terraform][terraform] commands:
7295
```bash
73-
make terraform/[tab]
74-
apply clean destroy fmt init init/ plan validate version
96+
pre-commit install
7597
```
7698

77-
To display all available commands:
78-
```bash
79-
make help
80-
```
81-
For more information about each [Make targets available](Makefile.md).
99+
## Environment Variables
82100

101+
Environment variables for Terraform and cloud providers can be configured in `.devcontainer/config/terraform.env`. The following variables are available:
83102

103+
### Terraform Configuration
84104

105+
- `TF_PLUGIN_CACHE_DIR` - Directory for caching Terraform plugins
106+
- `TF_CLI_ARGS_init` - Arguments for `terraform init`
107+
- `TF_CLI_ARGS_plan` - Arguments for `terraform plan`
108+
- `TF_CLI_ARGS_apply` - Arguments for `terraform apply`
109+
- `TF_LOG` - Terraform logging level
85110

111+
### AWS Provider Configuration
86112

87-
## References
88-
- [Terraform by HashiCorp](https://www.terraform.io) - Terraform is an open-source infrastructure as code software tool that enables you to safely and predictably create, change, and improve infrastructure.
89-
- [Changelog](CHANGELOG.md) - All notable changes.
90-
- [Code Of Conduct](CODE_OF_CONDUCT.md) - Amazon Open Source Code of Conduct
91-
- [Contributing](CONTRIBUTING.md) - Learn how to contribute
92-
- [License](LICENSE) - MIT No Attribution
93-
- [GNU Make](https://www.gnu.org/software/make/manual/make.html) - If you are new to make, or are looking for a general introduction.
113+
- `AWS_PROFILE` - AWS profile to use
114+
- `AWS_REGION` - AWS region to use
115+
- `AWS_SDK_LOAD_CONFIG` - Load config from AWS config file
94116

117+
### Azure Provider Configuration
95118

96-
## License
97-
This project is licensed under the MIT-0 License. See the [LICENSE](LICENSE) file.
119+
- `ARM_SUBSCRIPTION_ID` - Azure subscription ID
120+
- `ARM_TENANT_ID` - Azure tenant ID
121+
- `ARM_CLIENT_ID` - Azure client ID
122+
- `ARM_CLIENT_SECRET` - Azure client secret
123+
124+
### GCP Provider Configuration
125+
126+
- `GOOGLE_APPLICATION_CREDENTIALS` - Path to GCP service account key file
127+
- `CLOUDSDK_CORE_PROJECT` - GCP project ID
98128

99-
## Copyright
100-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
129+
## Customization
101130

131+
### Adding Custom Tools
102132

103-
[repo]: https://gitlab.aws.dev/proserve-labs/aws-terraform-dev-container
104-
[logo]: doc/logo.png
133+
To add custom tools to the container, modify the `.devcontainer/Dockerfile` and add your installation commands.
134+
135+
### Customizing VS Code Settings
136+
137+
VS Code settings can be customized in `.vscode/settings.json`.
138+
139+
### Customizing Pre-commit Hooks
140+
141+
Pre-commit hooks can be customized in `.pre-commit-config.yaml`.
142+
143+
## Volume Mounts
144+
145+
The container includes the following volume mounts:
146+
147+
- `~/.aws` - AWS credentials and configuration
148+
- `~/.azure` - Azure credentials and configuration
149+
- `~/.config/gcloud` - GCP credentials and configuration
150+
- `~/.ssh` - SSH keys
151+
- `terraform-cache` - Terraform plugin cache
152+
153+
## Security Considerations
154+
155+
- Credentials are mounted from the host to avoid storing them in the container
156+
- Pre-commit hooks include security scanning for Terraform code
157+
- Secret detection is enabled to prevent committing sensitive information
158+
159+
## Troubleshooting
160+
161+
### Common Issues
162+
163+
1. **Docker not running**: Ensure Docker is running on your system
164+
2. **Permission issues**: Ensure you have the necessary permissions for the mounted volumes
165+
3. **Authentication failures**: Check your credentials and ensure they are properly configured
166+
167+
### Logs
168+
169+
Container logs can be viewed in VS Code by clicking on the "Remote" indicator in the bottom-left corner and selecting "Show Container Log".
170+
171+
## License
105172

106-
[docker]: https://www.docker.com/products/docker-desktop/
107-
[vscode-dev-container]: https://code.visualstudio.com/docs/remote/containers
108-
[terraform]: https://www.terraform.io
109-
[license]: LICENSE
110-
[tools]: TOOLS
111-
[wsl]: https://learn.microsoft.com/en-us/windows/wsl/install
173+
This project is licensed under the MIT License - see the LICENSE file for details.

0 commit comments

Comments
 (0)