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 in Terraform by akhtar
• 33,720 points
328 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 by MD
• 79,930 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 in Terraform by MD
• 79,930 points
383 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 in Terraform by MD
• 79,930 points
538 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 20 in Terraform by MD
• 79,930 points
1,168 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 in Terraform by MD
• 79,930 points
167 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 in Terraform by MD
• 79,930 points
1,384 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 in Terraform by MD
• 79,930 points
296 views
0 votes
1 answer

What is a Terraform provider?

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

answered Jul 23 in Terraform by MD
• 79,930 points
93 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 in Terraform by MD
• 79,930 points
365 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 in Terraform by MD
• 79,930 points
208 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 in Terraform by MD
• 79,930 points
183 views