Skip to content

Using mfa_delete on an S3 bucket #629

@hashibot

Description

@hashibot

This issue was originally opened by @Techbrunch as hashicorp/terraform#12973. It was migrated here as part of the provider split. The original body of the issue is below.


How to enable mfa_delete on an s3 bucket ?

Terraform Version

Terraform v0.9.1

Affected Resource(s)

  • aws_s3_bucket

Terraform Configuration Files

resource "aws_s3_bucket" "test-terraform-mfa-delete" {
  bucket = "test-terraform-mfa-delete"
  versioning {
    mfa_delete = true
  }
}

Debug Output

provider.aws.region
  The region where AWS operations will take place. Examples
  are us-east-1, us-west-2, etc.

  Default: us-east-1
  Enter a value:

aws_s3_bucket.test-terraform-mfa-delete: Creating...
  acceleration_status:     "" => "<computed>"
  acl:                     "" => "private"
  arn:                     "" => "<computed>"
  bucket:                  "" => "test-terraform-mfa-delete"
  bucket_domain_name:      "" => "<computed>"
  force_destroy:           "" => "false"
  hosted_zone_id:          "" => "<computed>"
  region:                  "" => "<computed>"
  request_payer:           "" => "<computed>"
  versioning.#:            "" => "1"
  versioning.0.enabled:    "" => "false"
  versioning.0.mfa_delete: "" => "true"
  website_domain:          "" => "<computed>"
  website_endpoint:        "" => "<computed>"
Error applying plan:

1 error(s) occurred:

* aws_s3_bucket.test-terraform-mfa-delete: 1 error(s) occurred:

* aws_s3_bucket.test-terraform-mfa-delete: Error putting S3 versioning: AccessDenied: Mfa Authentication must be used for this request
	status code: 403, request id: 768ACF725BBD91DD

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAddresses a defect in current functionality.service/s3Issues and PRs that pertain to the s3 service.staleOld or inactive issues managed by automation, if no further action taken these will get closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions