What is the remote-exec provisioner in Terraform

0 votes

Hi Guys,

I have launched one EC2 instance in AWS using Terraform code. Now I want to run commands inside this instance from Terraform. How can I do that?

Jul 23, 2020 in Terraform by akhtar
• 38,260 points
3,714 views

1 answer to this question.

0 votes

Hi@akhtar,

You can use a remote-exec provisioner to do this task in your system. The remote-exec provisioner invokes a script on a remote resource after it is created. This can be used to run a configuration management tool, bootstrap into a cluster, etc. To invoke a local process, see the local-exec provisioner instead.

resource "aws_instance" "web" {
  provisioner "remote-exec" {
    inline = [
       "yum install git",
    ]
  }
}
answered Jul 23, 2020 by MD
• 95,460 points

Related Questions In Terraform

0 votes
1 answer

What is data source in Terraform?

Hi@akhtar, Data sources allow data to be fetched or ...READ MORE

answered Jul 23, 2020 in Terraform by MD
• 95,460 points
1,831 views
0 votes
1 answer

How does local-exec provisioner work in Terraform?

Hi@akhtar, You can use a local-exec provisioner to ...READ MORE

answered Jul 23, 2020 in Terraform by MD
• 95,460 points
5,914 views
0 votes
2 answers

What is Terraform?

Terraform is a provisioning tool that seems ...READ MORE

answered Aug 29, 2020 in Terraform by nbavis
• 380 points
2,590 views
0 votes
1 answer

What is a Terraform provider?

Hi@akhtar, Terraform is agnostic to the underlying cloud ...READ MORE

answered Jul 23, 2020 in Terraform by MD
• 95,460 points
880 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,059 views
+2 votes
1 answer
+2 votes
1 answer

What is the difference between modules and workspaces in Terraform?

Hi@akhtar, I think a key difference between Terraform ...READ MORE

answered Aug 17, 2020 in Terraform by MD
• 95,460 points
2,280 views
0 votes
1 answer

What is the null resource in Terraform?

Hi@akhtar, The null_resource resource implements the standard resource ...READ MORE

answered Sep 29, 2020 in Terraform by MD
• 95,460 points
3,810 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP