CICD Jenkins Terraform Automation
CICD Jenkins Terraform Automation
3. setup webhook
step:
b. paste the Jenkins url into github project repository webhook inside webhook click add
webhook
4. create a pipeline
steps
go to Jenkins New items
give any name and select pipeline and click ok
after that inside the project in built trigger select Github hook trigger for GITScm pooling
now click on the cenerate pipeline script and copy it and paste it into the pipeline script
for terraform init, plan and apply shell script go to pipeline syntax sample step:sh:shell
script, Shell script: terraform init and generate pipeline script
now copy the shell script and paste it into the pipeline script unter terraform init, repeat this
step for terraform plan and terraform apply
}
create role in your aws and give permission of administration access
now the role has been created and you need to assign it to the Jenkins server so for this
go to ec2 instance select the Jenkins server go to actiongo to securitymodify iam
role and select the IAM role from the drop down section
now if you go to the vs code and make change in the terraform code and commit to the git
hub it will automatically trigger the build and automation is complete