How to configure AWS MFA for Terraform

0 votes

Hi Guys,

I am using Terraform to manage AWS infrastructure. I want to use Terraform in a mode that uses multi-factor authentication. How can I do that?

Sep 30, 2020 in Terraform by akhtar
• 38,230 points
2,445 views

1 answer to this question.

0 votes

Hi@akhtar,

You can specify assume_role in your AWS provider. You can see the below code for better understanding.

provider "aws" {
  profile = "default"
  assume_role {
    role_arn = "arn:aws:iam::[ACCOUNT_ID]:role/terraform-test-role"
  }
}
answered Sep 30, 2020 by MD
• 95,440 points

Related Questions In Terraform

0 votes
1 answer

How to create one key in AWS using terraform?

Hi@akhtar, You can use aws_key_pair resource n terraform. ...READ MORE

answered Jun 11, 2020 in Terraform by MD
• 95,440 points
1,359 views
0 votes
1 answer

How to create a rds snapshot from running rds instance in AWS using terraform?

Hi, I think you can use aws_db_instance resource to ...READ MORE

answered Jul 20, 2020 in Terraform by MD
• 95,440 points
2,449 views
0 votes
1 answer

How to manage AWS multiple regions and availability zones using terraform?

Hi, When you run your Terraform code it ...READ MORE

answered Jul 21, 2020 in Terraform by MD
• 95,440 points
6,136 views
0 votes
1 answer

How to create a VPC in AWS using Terraform?

Hi@akhtar, You can find the script in the ...READ MORE

answered Jul 21, 2020 in Terraform by MD
• 95,440 points
1,112 views
0 votes
1 answer

'terraform' is not recognized as an internal or external command, operable program or batch file.

Hi@akhtar, You have to set an environment variable ...READ MORE

answered Jun 10, 2020 in Terraform by MD
• 95,440 points
27,625 views
0 votes
1 answer

How to import module in Terraform code?

Hi@akhtar, A module is a container for multiple resources that ...READ MORE

answered Jul 21, 2020 in Terraform by MD
• 95,440 points
1,870 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,440 points
679 views
0 votes
1 answer

How to read data from a file in Terraform?

Hi@akhtar, You can use the file function in Terraform. This file function ...READ MORE

answered Jul 27, 2020 in Terraform by MD
• 95,440 points
12,627 views
0 votes
1 answer

How to add a route for IGW in AWS using Terraform code?

Hi@akhtar, Terraform has one keyword named route. It allows ...READ MORE

answered Jul 22, 2020 in Terraform by MD
• 95,440 points
3,857 views
0 votes
1 answer

How to create a policy for AWS EFS file system using Terraform?

Hi@akhtar, You can find one resource in Terraform ...READ MORE

answered Sep 9, 2020 in Terraform by MD
• 95,440 points
1,858 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