Sign inSign up

sinfallas/terraform-all-in-one

By sinfallas

โ€ขUpdated about 2 months ago

Ubuntu image with Terraform, awscli, google-cloud-cli, semaphoreui and other complementary tools.

Image
Developer tools
0

755

sinfallas/terraform-all-in-one repository overview

โ Terraform All-in-One ๐Ÿš€

Maintainer

An Ubuntu-based Docker image designed for DevOps, CI/CD, and Infrastructure as Code (IaC) environments. It integrates essential tools into a single container, such as Terraform, AWS CLI, Google Cloud CLI, Ansible, and a graphical management interface via SemaphoreUI.

Additionally, the image includes a local cache of the AWS provider for Terraform, significantly speeding up project initialization.


โ ๐Ÿ› ๏ธ Included Tools & Packages

The container comes with the following pre-installed and ready-to-use tools:

  • Infrastructure & Cloud: terraform, awscli (v2), google-cloud-cli, ansible.
  • Automation Interface: semaphoreui.
  • Networking & Connectivity: ssh, sshpass, sshfs, samba-client, curl, wget, rsync, iputils-ping.
  • System Utilities: git, jq, gnupg, tar, zip, unzip, nano, s3fs, swaks, expect, python3-pip, tzdata, software-properties-common, ca-certificates.

โ ๐Ÿš€ Quick Start

โ 1. Deployment with Docker Compose

The recommended way to deploy this environment is by using docker-compose. Below is an example docker-compose.yml file:

networks:
  terraform:
    enable_ipv6: true
    driver: bridge
    driver_opts:
      com.docker.network.enable_ipv6: 1

services:
  terraform:
    image: sinfallas/terraform-all-in-one:latest
    container_name: terraform
    hostname: terraform
    pull_policy: always
    restart: always
    ports:
      - "3000:3000"
    environment:
      # AWS Credentials
      - AWS_ACCESS_KEY_ID=your_access_key
      - AWS_SECRET_ACCESS_KEY=your_secret_key
      - AWS_DEFAULT_REGION=us-east-1
      
      # Terraform environment variables (TF_VAR_ prefix)
      - TF_VAR_aws_region=us-east-1
      - TF_VAR_aws_vpc=vpc-XXXXXXXXXXXX
      - TF_VAR_aws_subnet=subnet-XXXXXXX
      - TF_VAR_rnombre=example
      - TF_VAR_url=[https://example.com](https://example.com)
      - TF_VAR_rtag=example
      - TF_VAR_rtoken=XXXXXXXXXXXXXXXXXXXXXX
      - TF_VAR_ubuntupass=example
      - TF_VAR_gitlabpass=example
      - TF_VAR_nombreinstancia=example
      - TF_VAR_nombregruposeguridad=example
    volumes:
      - ./semaphore_data:/app          # Semaphore persistent data
      - ./recursos:/recursos           # Directory for project resources
    logging:
      driver: "json-file"
      options:
        max-size: "1m"
        max-file: "1"
    networks:
      - terraform

Run the following command to start the container in the background:

docker compose up -d
โ 2. Semaphore UI Access

Once the container is running, you can access the Semaphore web interface from your browser:

(It is highly recommended to change the password after the first login).


โ โš™๏ธ Additional Configurations

โ AWS Helper (configuraraws)

The image includes an internal script named configuraraws that automatically configures the AWS CLI using the injected environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_DEFAULT_REGION). You can run it inside the container to quickly validate your credentials and identity (sts get-caller-identity).

โ Pre-Downloaded AWS Provider

To save time and bandwidth, the container is pre-configured with the AWS provider in /usr/local/share/terraform/plugins. Terraform initializations (terraform init) for AWS projects will first check this local cache thanks to the configuration in ~/.terraformrc.

  • /app -> Working directory and SQLite/Semaphore data. Mounting this allows you to persist your CI/CD tasks configuration.
  • /recursos -> A free-use directory to map scripts, SSH keys, or other files required for your deployments.

โ ๐Ÿค Support & Maintainer

Git image repository:

To report a bug or request support:

Tag summary

Content type

Image

Digest

sha256:1a9da06bdโ€ฆ

Size

625.8 MB

Last updated

about 2 months ago

docker pull sinfallas/terraform-all-in-one