boltops-tools / terraspace

Terraspace: The Terraform Framework
https://terraspace.cloud
Apache License 2.0
674 stars 46 forks source link

MFA Support #224

Open carsondoesbusiness opened 2 years ago

carsondoesbusiness commented 2 years ago

Summary

The terraspace CLI does not currently support AWS Profiles that require MFA. Running a terraspace command with a profile using mfa_serial should allow the user to input an MFA code.

Motivation

MFA is required in most professional settings, and is necessary for many developers to be able to run terraspace locally.

Current Issue

Example ~/.aws/credentials

[default]
aws_access_key_id = ******
aws_secret_access_key = *******

[MFAProfile]
role_arn=arn:aws:iam::*******:role/******
source_profile=default
mfa_serial=arn:aws:iam::*********:mfa/********
region=us-east-1

When using AWS_PROFILE=MFAProfile terraspace builds return the following error

MultiFactorAuthentication failed, must provide both MFA serial number and one time pass code. (Aws::STS::Errors::AccessDenied)