BalinLin / jenkins_tf

Introduce jenkins to run terraform with aws.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Jenkins: v2.375.1 terraform: v1.3.6

Run the project.

  1. Run jenkins with docker
docker run --name myjenkins -p 8080:8080 -p 50000:50000 -v $HOME:/var/jenkins_home jenkins/jenkins:lts-jdk11
  1. Access http://localhost:8080 and authorized with admin password. Default path of password is /var/jenkins_home/secrets/initialAdminPassword.

  2. Install terraform with available version

# Enter container with root user.
docker exec -it --user root myjenkins bash

# Install terraform
apt update
apt-get install wget
apt-get install unzip

wget https://releases.hashicorp.com/terraform/1.3.6/terraform_1.3.6_linux_amd64.zip
unzip terraform_1.3.6_linux_amd64.zip

# Check version
terraform --version
  1. Follow the video to create git repo credential

  2. Follow the tutorial to setup terraform plugin, AWS Credentials, Jenkins Pipeline

  3. After building the pipeline, jenkins will load the Jenkinsfile and update the content.

About

Introduce jenkins to run terraform with aws.


Languages

Language:HCL 100.0%