You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<imgsrc="doc/logo.png"alt="Terraform Development Environment Logo"width="200"/>
2
+
1
3
# Terraform Development Environment
2
4
3
-
A comprehensive VS Code Dev Container that provides a consistent, pre-configured environment for developing, testing, and deploying infrastructure as code with Terraform across AWS, Azure, and GCP.
A comprehensive VS Code Dev Container providing a consistent, pre-configured environment for developing, testing, and deploying infrastructure as code with Terraform across AWS, Azure, and GCP.
4
10
5
11
> **Boost your infrastructure development productivity with a ready-to-use, standardized environment that works the same way for everyone on your team, across all major cloud providers.**
6
12
7
-
This project eliminates the pain of setting up and maintaining development environments for Terraform, allowing you to focus on writing high-quality infrastructure code instead of wrestling with tool installations and configurations.
8
-
9
-
## Table of Contents
10
-
11
-
-[The Problem We're Solving](#the-problem-were-solving)
12
-
-[Why Use This Dev Container?](#why-use-this-dev-container)
Infrastructure as code (IaC) development with Terraform presents several challenges:
36
24
37
-
-**Environment Setup Complexity**: Setting up a development environment with all necessary tools, versions, and configurations is time-consuming and error-prone
38
-
-**Cross-Cloud Development**: Working across multiple cloud providers requires managing different CLIs, authentication methods, and best practices
39
-
-**Security and Compliance**: Ensuring infrastructure code meets security standards and follows best practices requires specialized tools
40
-
-**Team Consistency**: Maintaining consistent development environments across team members is difficult
41
-
-**Onboarding Friction**: New team members often spend days configuring their environment before becoming productive
25
+
-**Environment Setup Complexity**: Time-consuming and error-prone setup process
26
+
-**Cross-Cloud Development**: Managing different CLIsand authentication methods
27
+
-**Security and Compliance**: Ensuring code meets security standards
28
+
-**Team Consistency**: Maintaining consistent environments across team members
29
+
-**Onboarding Friction**: New team members often spend days configuring their environment
42
30
43
31
This development container solves these problems by providing a ready-to-use, standardized environment with all necessary tools pre-configured.
44
32
45
-
## Why Use This Dev Container?
33
+
---
46
34
47
-
-**Instant Productivity**: Start developing Terraform code immediately without spending time on environment setup
48
-
-**Standardized Tooling**: Ensures everyone on your team uses the same versions of tools and follows the same practices
49
-
-**Built-in Best Practices**: Includes pre-configured security scanning, linting, and validation tools
50
-
-**Multi-Cloud Ready**: Supports AWS, Azure, and GCP development out of the box
51
-
-**Reduced Onboarding Time**: New team members can be productive within minutes instead of days
52
-
-**Consistent Experience**: Works the same way on any operating system that supports Docker and VS Code
35
+
## 🌟 Features
53
36
54
-
## Features
37
+
- ☁️ **Multi-cloud Support**: Pre-installed CLIs and tools for AWS, Azure, and GCP
38
+
- 🛠️ **Complete Terraform Ecosystem**: Comprehensive suite of tools including terraform-docs, tflint, tfsec, and more
39
+
- 🔒 **Security and Compliance**: Pre-commit hooks for security scanning and compliance checking
40
+
- 💻 **Enhanced Developer Experience**: VS Code integration with tasks, settings, and extensions
41
+
- ⚡ **Performance Optimization**: Caching strategies and optimized volume mounts
42
+
- 🧪 **Testing and Validation**: Built-in tools for testing infrastructure code
43
+
- 💰 **Cost Management**: Integrated cost estimation with Infracost
55
44
56
-
-**Multi-cloud Support**: Pre-installed CLIs and tools for AWS, Azure, and GCP with streamlined authentication
57
-
-**Complete Terraform Ecosystem**: Comprehensive suite of tools including terraform-docs, tflint, tfsec, terrascan, terragrunt, terratest, and more
58
-
-**Security and Compliance**: Pre-commit hooks for security scanning, compliance checking, and credential management
59
-
-**Enhanced Developer Experience**: VS Code integration with tasks, settings, extensions, and snippets
60
-
-**Performance Optimization**: Caching strategies and optimized volume mounts for faster operations
61
-
-**Testing and Validation**: Built-in tools for testing infrastructure code and validating changes
62
-
-**Cost Management**: Integrated cost estimation with Infracost
45
+
---
63
46
64
-
## Prerequisites
47
+
## 🔍 Prerequisites
65
48
66
49
-[Docker](https://www.docker.com/products/docker-desktop/) - Required for running containers
67
50
-[Visual Studio Code](https://code.visualstudio.com/) - The recommended IDE
68
51
-[VS Code Remote Development Extension Pack](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack) - Required for Dev Containers
The environment includes pre-configured VS Code tasks for common operations:
171
164
@@ -182,59 +175,70 @@ The environment includes pre-configured VS Code tasks for common operations:
182
175
183
176
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.
184
177
185
-
## Pre-commit Hooks
178
+
---
179
+
180
+
## 🔄 Pre-commit Hooks
186
181
187
182
The environment includes pre-configured pre-commit hooks for Terraform validation, formatting, and security scanning. To install the hooks:
188
183
189
184
```bash
190
185
pre-commit install
191
186
```
192
187
193
-
## Environment Variables
188
+
---
189
+
190
+
## ⚙️ Configuration
191
+
192
+
### Environment Variables
194
193
195
194
Environment variables for Terraform and cloud providers can be configured in `.devcontainer/config/terraform.env`. The following variables are available:
196
195
197
-
### Terraform Configuration
196
+
####Terraform Configuration
198
197
199
198
-`TF_PLUGIN_CACHE_DIR` - Directory for caching Terraform plugins
200
199
-`TF_CLI_ARGS_init` - Arguments for `terraform init`
201
200
-`TF_CLI_ARGS_plan` - Arguments for `terraform plan`
202
201
-`TF_CLI_ARGS_apply` - Arguments for `terraform apply`
203
202
-`TF_LOG` - Terraform logging level
204
203
205
-
### AWS Provider Configuration
204
+
####AWS Provider Configuration
206
205
207
206
-`AWS_PROFILE` - AWS profile to use
208
207
-`AWS_REGION` - AWS region to use
209
208
-`AWS_SDK_LOAD_CONFIG` - Load config from AWS config file
210
209
211
-
### Azure Provider Configuration
210
+
####Azure Provider Configuration
212
211
213
212
-`ARM_SUBSCRIPTION_ID` - Azure subscription ID
214
213
-`ARM_TENANT_ID` - Azure tenant ID
215
214
-`ARM_CLIENT_ID` - Azure client ID
216
215
-`ARM_CLIENT_SECRET` - Azure client secret
217
216
218
-
### GCP Provider Configuration
217
+
####GCP Provider Configuration
219
218
220
219
-`GOOGLE_APPLICATION_CREDENTIALS` - Path to GCP service account key file
221
220
-`CLOUDSDK_CORE_PROJECT` - GCP project ID
222
221
223
-
## Customization
222
+
###Customization
224
223
225
-
### Adding Custom Tools
224
+
####Adding Custom Tools
226
225
227
226
To add custom tools to the container, modify the `.devcontainer/Dockerfile` and add your installation commands.
228
227
229
-
### Customizing VS Code Settings
228
+
####Customizing VS Code Settings
230
229
231
230
VS Code settings can be customized in `.vscode/settings.json`.
232
231
233
-
### Customizing Pre-commit Hooks
232
+
####Customizing Pre-commit Hooks
234
233
235
234
Pre-commit hooks can be customized in `.pre-commit-config.yaml`.
236
235
237
-
## Advanced Usage
236
+
---
237
+
238
+
## 💻 Advanced Usage
239
+
240
+
<details>
241
+
<summary>Click to expand Advanced Usage details</summary>
238
242
239
243
### Tool Integration
240
244
@@ -284,7 +288,14 @@ You can extend this development environment to suit your specific needs:
284
288
- Export configurations from the dev container to CI/CD
285
289
- Ensure consistency between development and automation
286
290
287
-
## Use Cases
291
+
</details>
292
+
293
+
---
294
+
295
+
## 📊 Use Cases
296
+
297
+
<details>
298
+
<summary>Click to expand Use Cases</summary>
288
299
289
300
### Enterprise Infrastructure Teams
290
301
- Standardize development environments across large teams
@@ -310,7 +321,14 @@ You can extend this development environment to suit your specific needs:
310
321
- Follow industry best practices from day one
311
322
- Focus on code rather than tooling
312
323
313
-
## Productivity Benefits
324
+
</details>
325
+
326
+
---
327
+
328
+
## 📈 Productivity Benefits
329
+
330
+
<details>
331
+
<summary>Click to expand Productivity Benefits</summary>
314
332
315
333
### Time Savings
316
334
-**Environment Setup**: Save 4-8 hours per developer on initial setup
@@ -330,33 +348,11 @@ You can extend this development environment to suit your specific needs:
330
348
-**Knowledge Sharing**: Common toolset makes it easier to share techniques and solutions
331
349
-**Cross-Platform**: Works the same way on Windows, macOS, and Linux
332
350
333
-
## Real-World Success Stories
334
-
335
-
### Enterprise Adoption
336
-
337
-
A Fortune 500 company implemented this development environment across their infrastructure team of 50+ engineers. Results included:
338
-
- 75% reduction in environment-related issues
339
-
- 40% faster onboarding for new team members
340
-
- 30% increase in code quality metrics
341
-
- Standardized practices across 3 cloud platforms
351
+
</details>
342
352
343
-
### DevOps Transformation
353
+
---
344
354
345
-
A mid-sized SaaS company used this container as part of their DevOps transformation:
346
-
- Reduced infrastructure deployment errors by 65%
347
-
- Decreased time to provision new environments by 50%
348
-
- Improved security compliance from 70% to 98%
349
-
- Enabled developers to self-service infrastructure needs
350
-
351
-
### Educational Impact
352
-
353
-
A technical training organization adopted this container for their Terraform courses:
354
-
- Eliminated 90% of setup-related issues in classes
355
-
- Provided consistent learning environment across all student machines
356
-
- Allowed focus on teaching concepts rather than troubleshooting
357
-
- Enabled students to continue learning with the same environment after the course
358
-
359
-
## Volume Mounts
355
+
## 💾 Volume Mounts
360
356
361
357
The container includes the following volume mounts:
362
358
@@ -366,15 +362,19 @@ The container includes the following volume mounts:
366
362
-`~/.ssh` - SSH keys
367
363
-`terraform-cache` - Terraform plugin cache
368
364
369
-
## Security Considerations
365
+
---
366
+
367
+
## 🔒 Security Considerations
370
368
371
369
-**Credential Isolation**: Credentials are mounted from the host to avoid storing them in the container
372
370
-**Automated Scanning**: Pre-commit hooks include security scanning for Terraform code
373
371
-**Secret Detection**: Automated detection is enabled to prevent committing sensitive information
374
372
-**Compliance Checking**: Built-in tools validate infrastructure against compliance standards
375
373
-**Least Privilege**: Authentication helpers encourage following least privilege principles
376
374
377
-
## Troubleshooting
375
+
---
376
+
377
+
## ❓ Troubleshooting
378
378
379
379
### Common Issues
380
380
@@ -388,7 +388,9 @@ The container includes the following volume mounts:
388
388
389
389
Container logs can be viewed in VS Code by clicking on the "Remote" indicator in the bottom-left corner and selecting "Show Container Log".
390
390
391
-
## Getting Help
391
+
---
392
+
393
+
## ❓ Getting Help
392
394
393
395
### Documentation and Resources
394
396
@@ -403,22 +405,20 @@ Container logs can be viewed in VS Code by clicking on the "Remote" indicator in
0 commit comments