What is bootstrap script in aws?
if you want to execute some commands during boot up(also launch), you can execute it easily by mentioning during step 3 of EC2 launch. Bootstrap scripts run only once - when the instance is instantiated for the 1st time.Please follow the below steps to create an EC2 instance. We will be installing Java, Maven, Jenkins and Apache during boot up.
Steps to add bootstrap script during EC2 launch
5. in step 3, go down, under advanced details. Copy the script from this link.
6. Now continue like how you provision EC2 instance.
7. once you provision, you will be able to see Java, Maven and Jenkins installed in EC2 instance after launch.
Check the Logs in EC2 instance
Login to EC2 instance, and type the below command:
tail -f /var/log/cloud-init-output.log
This will give the output of bootstrap execution
Verify if Java got installed.
java -version
mvn --version
mvn --version
Go to the browser and try to access Jenkins in the browser, Jenkins should be coming up.(make sure you open port 8080 in the firewall rules)
Java, Maven and Jenkins should be installed successfully.
No comments:
Post a Comment