I'm using Terraform with the terraform-provider-aws provider to manage my AWS infrastructure. I'm trying to enable mfa_delete
on an S3 bucket, but when I try to apply the change I get this error:
1 error occurred:
* aws_s3_bucket.logs: 1 error occurred:
* aws_s3_bucket.logs: Error putting S3 versioning: AccessDenied: Mfa Authentication must be used for this request
status code: 403, request id: <redacted>, host id: <redacted>
How can I run Terraform in a mode that uses multi-factor authentication? My IAM account has a Virtual MFA device attached, but that MFA isn't used when I'm terraforming because terraform uses the API Access Key associated with my account.