DevOps Classroom notes 08/Jan/2025

Terraform cont

Installing in virtual machines/ec2 instances

  • All the clouds have cloud-init enabled and this is recommended. Cloud-init is executed only once during machine creation. Refer Here for the changes done.
  • Other option is use provisioning which is not recommened
  • Terraform has provisioners of three types
    • file: This is used to copy files or folders from the machine where terraform is runnning into machine created by terraform
    • local-exec: This will execute a command/script locally on the machine where terraform is running
    • remote-exec: This will execute a command/script remotely on the machine create by terraform
  • Whenever the provisioner needs to connect to a remote machine it requires a connection
  • Connection arguments
  • Refer Here for the changes
  • Provisioners will be executed only when the resource is created. If you want to trigger provisioners, we have to re create resources, in terrform there is null_resource
  • Refer Here for the changes done to handle script execution
Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Social Media Icons Powered by Acurax Web Design Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Exit mobile version
%%footer%%