```hcl
resource "aws_iam_policy" "admin" {
  name = "Admin"

  policy = <<EOF
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "*",
      "Resource": "*",
      "Condition": {
        "Bool": {
          "aws:MultiFactorAuthPresent": true
        }
      }
    },
    {
      "Effect": "Allow",
      "Action": "sts:AssumeRole",
      "Resource": [
        "arn:aws:iam::${var.aws_dev_account_id}:role/s3-only"
      ]
    },
    {
      "Effect": "Deny",
      "Action": "sts:AssumeRole",
      "NotResource": [
        "arn:aws:iam::${var.aws_dev_account_id}:role/s3-only"
      ],
      "Condition": {
        "BoolIfExists": {
          "aws:MultiFactorAuthPresent": false
        }
      }
    }
  ]
}
EOF
}

resource "aws_iam_role" "admins" {
  name = "admins"

  assume_role_policy = <<EOF
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::${var.aws_main_account_id}:root"
      },
      "Action": "sts:AssumeRole",
      "Condition": {
        "Bool": {
          "aws:MultiFactorAuthPresent": "true"
        }
      }
    }
  ]
}
EOF
}

resource "aws_iam_role_policy_attachment" "admins_admin" {
  role       = "${aws_iam_role.admins.name}"
  policy_arn = "${aws_iam_policy.admin.arn}"
}
```

Remove arn:aws:iam::${var.aws_dev_account_id}:role/s3-only references from terraform. This role is not created anywhere
user
```hcl
resource "aws_iam_policy" "admin" {
  name = "Admin"

  policy = <<EOF
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "*",
      "Resource": "*",
      "Condition": {
        "Bool": {
          "aws:MultiFactorAuthPresent": true
        }
      }
    }
  ]
}
EOF
}

resource "aws_iam_role" "admins" {
  name = "admins"

  assume_role_policy = <<EOF
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::${var.aws_main_account_id}:root"
      },
      "Action": "sts:AssumeRole",
      "Condition": {
        "Bool": {
          "aws:MultiFactorAuthPresent": "true"
        }
      }
    }
  ]
}
EOF
}

resource "aws_iam_role_policy_attachment" "admins_admin" {
  role       = "${aws_iam_role.admins.name}"
  policy_arn = "${aws_iam_policy.admin.arn}"
}
```
assistant