Sign inSign up

mejatos/cdktf

By mejatos

•Updated 10 months ago

This repository contains a CDK for Terraform devcontainer for use with PyCharm projects.

Image
Developer tools
0

1.4K

mejatos/cdktf repository overview

This repository contains a Docker image specifically designed for development environments that require Python 3.11, AWS CLI v2, Azure CLI, Google Cloud SDK, Node.js, and Terraform, with support for both ARM64 and AMD64 architectures. The image includes a pre-installed CDK for Terraform and provides a clean, minimal environment tailored for multi-cloud Infrastructure as Code (IaC) workflows.

The image is optimized for developers using tools like PyCharm and is intended to be used as a Dev Container to streamline the development process for cloud-based projects.

This Docker image is ideal for developers who need:

  • Multi-architecture support for ARM64 (e.g., M1/M2/M3 Macs) and AMD64.
  • AWS CLI v2, Azure CLI, and Google Cloud SDK for seamless multi-cloud operations.
  • Python 3.11 with virtual environment (venv) support.
  • Node.js 20 installed via NVM, specifically for CDK development.
  • Terraform and CDK for Terraform pre-installed.

⁠Features

⁠Base Image
  • Ubuntu latest
    • A stable and reliable foundation for the image.
⁠Included Software and Tools
  1. Python 3.11
    • Default Python version.
    • Includes python3-venv and pip for managing Python environments and packages.
  2. Node.js 20.x
    • Installed using NVM for version flexibility.
  3. AWS CLI v2
    • Installed with architecture-specific binaries.
  4. Azure CLI
    • Enables management of Azure resources.
  5. Google Cloud SDK
    • Provides tools for interacting with Google Cloud services.
  6. Terraform & Terraform Stacks
    • Core tool for provisioning infrastructure.
  7. CDK for Terraform
    • Latest version installed globally via npm.
  8. Utilities
    • Includes essential tools like Git, curl, unzip, and bash.

⁠Intended Purpose

This image is designed for use as a development container in tools like PyCharm or other IDEs. It simplifies development workflows by providing a pre-configured environment, ensuring compatibility across different architectures, and reducing setup time for local development environments.

Using this container ensures that all dependencies for IaC workflows are isolated and containerized, enabling:

  • Quick setup for AWS, Azure, and Google Cloud development.
  • Seamless IaC workflows using Terraform and CDK.
  • Consistent development environments across teams and systems.

⁠How to Use

⁠Pull the Docker Image
docker pull cloud-iac-tools:latest
⁠Run the Container
docker run -it cloud-iac-tools:latest bash
⁠Example devcontainer.json Configuration

To use this Docker image in a development container setup, add the following devcontainer.json configuration file to your project:

{
  "name": "DEVCONTAINER-NAME",
  "image": "mejatos/cdktf:latest",
  "settings": {
    "terminal.integrated.shell.linux": "/bin/bash"
  },
  "extensions": [],
  "forwardPorts": [],
  "mounts": [],
  "postCreateCommand": "echo 'Container ready!'",
  "remoteUser": "root"
}

This configuration file tells the development environment to use the cloud-iac-tools:latest image, sets Bash as the default terminal, and includes a post-creation command to indicate readiness. You can customize this configuration further as needed.

Run JetBrains Gateway DevContainer Setup:

  • The best workflow is to use PyCharm to clone your project from Version Control System (VCS) (e.g., GitHub, GitLab).
  • Once the project is cloned, create a folder called .devcontainer in the project root, and add the devcontainer.json configuration file to this folder (sample provided below).
  • Commit the .devcontainer folder and its contents to your VCS.
  • After that, launch the JetBrains Gateway and use the New Dev Container wizard to set up the environment.
  • The wizard works with both HTTPS and SSH endpoints, allowing you to seamlessly connect to your VCS.
  • JetBrains Gateway will automatically use the Docker image and configuration from the devcontainer.json file to set up your development container.
  • Once the setup is complete, you'll be ready to start coding with the pre-configured CDKTF and Python environment inside your development container.
⁠AWS Configuration and Authentication
  • Run aws configure to set up AWS credentials.
  • Alternatively, use environment variables like AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_SESSION_TOKEN for authentication.

⁠Supported Architectures

  • linux/arm64
  • linux/amd64

⁠Maintainer

This image is maintained by https://github.com/flyingsquirrelcloud/cdktf-devcontainer⁠


Tag summary

Content type

Image

Digest

sha256:f9629b350…

Size

706.8 MB

Last updated

10 months ago

docker pull mejatos/cdktf