Pre-requistes: Jenkins is up and running Terraform is installed in Jenkins Terraform files already created in your SCM Make sure you have necessary IAM role created with right policy and attached to Jenkins EC2 instance. see below for the steps to create IAM role. I have provided my public repo as an example which you can use. Create IAM role to provision EC2 instance in AWS Select AWS service, EC2, Click on Next Permissions Type EC2 and choose AmazonEC2FullAccess as policy Click on Next tags, Next Review give some role name and click on Create role. Assign IAM role to EC2 instance Go back to Jenkins EC2 instance, click on EC2 instance, Security, Modify IAM role Type your IAM role name my-ec2-terraform-role and Save to attach that role to EC2 instance. Create a new Jenkins Pipeline Give a name to the pipeline you are creating. Add parameters to the pipeline Click checkbox - This project is parameterized, choose Choice Parameter Enter name...
Comments
Post a Comment