- Jenkins
- Server
- Slack plugin (configuration link)
- Integrate Github
- Terraform
- AWS EC2 instance resources
- Remote state
- AWS
- Key Pair for SSH
- Two EC2 instances
- Ansible
- Jenkins playbook
- Web playbook
- Docker
- Containerized FastApi service
- Build & Push tagged repo to docker hub
- Terratest (Infrastructure testing)
- Docker
- Terraform
- AWS account - free tier
- AWS CLI
- mac:
brew install awscli
|aws --version
- windows: instructions
- linux: instructions
- mac:
- Configure AWS locally or use AWS vault
- EC2 Key pair
- Jenkins
- Terraform
- Ansible
- Docker
- Python 3.8
- Go 1.14
- dep dependency
brew install dep
- Terratest globally installed
go get -v github.com/gruntwork-io/terratest
-
Create EC2 instances
navigate to:
\terraform\jenkins
β terraform init β terraform plan β terraform apply
navigate to:
\terraform\web
β terraform init β terraform plan β terraform apply
-
Configure Ansible host configuration
navigate to:
\etc\ansible\host
#servers and key config [jenkins] ubuntu@<public-dns> ansible_user=ubuntu ansible_ssh_key_private_file=~/.ssh/infra-key.pem [webservers] ubuntu@<public-dns> ansible_user=ubuntu ansible_ssh_key_private_file=~/.ssh/infra-key.pem
-
Run Playbooks
navigate to:
\ansible
sudo ansible-playbook jenkins.yaml
sudo ansible-playbook web.yaml
-
Configure Jenkins and AWS EC2 instances
β cd test
β go test