We will be learning an interesting use case to provision resources in AWS cloud using Terraform and Azure DevOps. We will also learn how to store terraform state info remotely in AWS S3 bucket.
We will create S3 bucket for storing terraform state info and Dynamo DB table for providing state lock capability.
We will try to create an EC2 instance and S3 Bucket using Terraform and Azure DevOps in AWS cloud. Look at the diagram that describes the whole flow.
Create AWS service connection in Azure DevOps for Terraform to use
Create service connection for connecting to GitHub
Create S3 bucket for storing TF state
Create dynamo DB table for providing lock capability
I have provided my public repo as an example which you can use.
Step # 1 - Create S3 Bucket:
Login to AWS, S3. Click on create S3 bucket.
Give unique name to the bucket, name needs to be unique.
Block all public access, enable bucket versioning as well.
Enable encryption.
Step # 2 - Create DynamoDB Table
Create a new table with LockID as partition Key
Step # 3 - Create Service connection to connect to AWS from Azure DevOps
Go to Azure Devops, select your project. Project Settings
Click Service Connections
Select AWS for Terraform
Enter Access Key, Secret Key and region code, enter name for service connection and choose Grant Access to all pipelines.
Click Save.
Create Service connection for connecting to GitHub
Save
Step 4 - Create a new Release Pipeline
Click on Releases, New, choose New Release pipeline
Select empty job.
Click on Add Artifacts
Choose GitHub, select Github service connection, select the repo
Click on Add tasks, type terraform
choose the task
Add task, search for install terraform and select installer task
It should show something like this:
Add another terraform task for init
Search for terraform and add task
select AWS from drop down, choose init as command and add -reconfigure as additional command arguments. Select AWS service connection and enter bucket name
Add another task for plan, select right values.
enter -out dev-plan
Add another task by cloning for apply.
enter "dev-plan" as additional arguments
Click on Save.
Create Release, now job should be running.
Login to AWS--> S3 Bucket, you should see terraform state info
How to destroy all the resources created using Terraform?
Clone the current infra setup release pipeline.
Modify the pipeline name.
Add
Modify the apply task to as shown in the diagram
enter -destroy as additional argument.
Click on Create Release to make sure all the resources are destroyed.
Thanks for showing interest in learning DevOps. Believe it or not, anyone can become a successful DevOps engineer after finishing the exciting training with coach in person at Frisco, TX (currently doing only online due to covid-19)
You really don't need to a have solid programming or software engineering experience. Many of my students did not have any computer background before attending the coaching program, now they are very successful DevOps engineers, making 6-figure income working at various companies across USA. What is DevOps? DevOps is #1 IT skills right now in the market and will be there for really long time. As a DevOps engineers/consultant you will help companies to release software products faster, automated and efficient ways.
DevOps brings together people, processes, and technology, automating software delivery to provide continuous value to end users. DevOps automates and speeds software delivery. It makes your process and your products more reliable. Here is the coaching model:
total 9 weeks of coaching
2 sessions per weekend/week
Fast paced
Purely lab oriented(hands on)
~80% hands on, ~20 %theory
40+ lab exercises, also few bonus lab exercises
Wiki page for troubleshooting needs
Collaborative way of learning - separate WhatsApp group per batch
DevOps concepts and interview notes will be provided
About the DevOps Coach:
23 yrs of IT experience, 9+ Yrs in practicing DevOps and Cloud Automation.
Comprehensive hands on knowledge on Git, BitBucket, GitHub, Jenkins, Maven, SonarQube, Nexus, Terraform, Ansible, Docker and Kubernetes on AWS and Azure cloud platforms.
Many students already placed in reputed companies from my coaching program successfully.
Working as a Sr.DevOps Coach/Architect in a top IT services company in US.
Unique program...less theory, more hands on work on AWS and Azure
Resume preparation will be done with candidates personally.
Are you in IT? Tired of your work? Are you not able to make any
good progress in your career?
Are you not having a job? Looking for a break in
IT? Are you interested in learning DevOps?
Did you get laid off from your previous job due to Covid-19?
You are in the right place to kick start your career in
DevOps. DevOps is one of the top and hot IT skills right
now. Currently almost all the employers are struggling to
get right resources in their teams who can do the DevOps and
automation work..You could be that person by attending this
coaching program.
DevOps Coaching Classes schedules for Jan 2023:
Date
Time
Type
When?
Jan 7th
09:45 AM to 11:30 AM CST on Saturdays & 10:30 AM to 12:30 pm CST on Sundays
Weekends
Sat/Sun
Jan 19th
6:00 to 8:00 PM CST
Weekdays
Tuesdays/Thursdays
DevOps Coaching Highlights:
- Comprehensive hands on knowledge on Git, Jenkins, Maven,
SonarQube, Nexus, Terraform, Ansible, Puppet, Docker, AWS IAM, ECR,
Docker registry. AWS and Azure cloud platforms. - Coach is having about 22+ yrs of professional IT
experience, 8+ Yrs in DevOps/Cloud/Automation. - Many students already got placed in reputed companies from
this coaching program successfully. - Working as a Sr.DevOps Coach/Architect in a one of the top
IT services companies in USA. - Unique program...less theory, more hands on lab exercises...
- Resume preparation will be done with candidates personally. - One-to-one Interview coaching. - Coaching is purely hands on with 101% job relevant. - 100% Job assistance. - Coached about 1300+ people successfully for past 4 and half years and many of my
students got placed with many large enterprises in DFW, Charlotte,
Houston, Austin, Chicago, Florida, Seattle, Bay area, Ohio, NJ and
NY areas..
To join coaching classes, contact the Coach below:
Contact no # : +1(469)733-5248 Email id: devops.coaching@gmail.com Contact: Coach
If you live in India, please contact assistant coach Gunal to learn about the program:
You can install Artifact plug-in to integrate Artifactory with Jenkins. Let us see how to integrate Jenkins with Artifactory and able to upload War/Ear/Jar files using Maven.
Pre-requisites: Install Artifactory plugin in Jenkins.
go to Jenkins, Manage Jenkins, Manage plug-ins page, search for artifactory under available tab.
Make sure Maven 3 is also configured under Manage Jenkins--> Global Tool configuration Enter Name as Maven3 /usr/share/maven as MAVEN_HOME
Configure Arifactory in Jenkins: Once you successfully install Artifactory plug-in,
1. Go to Manage Jenkins, Click on configure system. Look for JFrog section, click on JFrog Platform instance.
Enter some name for Instance_ID and enter Artifactory url like below:
http://public_dns_name:8081/artifactory
2. Click on Advanced configuration
Enter Artifactory URL again
http://public_dns_name:8081/artifactory
and also distribution URL as below
http://public_dns_name:8081/distribution
3. Add Credentials Entry
Enter admin as username and enter Artifactory password as Admin123
Click on Test connection to verify everything is right.
4. Once you installed the above plug-in, click on existing Freestyle job configuration. 4. Go under Build environment Select Maven 3 - Artifactory integration check box and click on refresh Repositories and choose repos as mentioned below:
5.Click on Add Build step and choose Invoke Artifactory Maven 3
6. Enter value as below, MyWebApp/pom.xml as root POM and goal as install
7. Now click on Build, Jenkins should build using Maven and upload WAR file into Artifactory.
8. Login to Artifactory, Click on Artifactory --> Artifacts