Skip to content

Using terraform provisioner to do initial setup of nginx using commands on creation of EC2 resource

License

Notifications You must be signed in to change notification settings

MiteshSharma/TerraformProvisioner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform Provisioner

Terraform not only helps us in infrastructure creation and management but also in provisioning them during resource creation or deletion. Terraform uses provisioners for this. Provisioners are used to executing scripts on a local or remote machine as part of resource creation or deletion. Provisioners are similar to EC2 instance user data scripts that only run once on the creation and if it fails terraform marks it tainted. A tainted resource is one which is planned for destruction on next terraform apply. Terraform doesn't run these scripts multiple times. If we want more flexibility then we must use a configuration management system like ansible to properly provision the instance.

Commands used:

terraform init : Initialize a Terraform working directory

terraform plan : Generate and show an execution plan

terraform apply : Builds or changes infrastructure

terraform destroy : Destroy Terraform-managed infrastructure

About

Using terraform provisioner to do initial setup of nginx using commands on creation of EC2 resource

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages