---
title: Terraform 403: Access Denied Error
description: An easy fix for a common error when using Terraform to deploy resources using the CLI.
date: 2021-02-25
tags: Terraform, Terraform State
source: https://brianchildress.co/blog/terraform-403-access-denied-error
---

# Terraform 403: Access Denied Error

I was recently helping a colleague troubleshoot an issue with a new AWS environment he was provisioning. We're using [Terraform](https://www.terraform.io/) to manage the infrastructure through code and our CI/CD pipeline. The issue came when we were trying to provision new S3 buckets using Terraform files from our local machine. By running `terraform init` we would eventually receive a `403: Access Denied` error back from AWS.

The error/issue was due to a mismatch with the local Terraform state and our new Terraform file. During our testing we had created and deleted several S3 buckets. The local Terraform state was still looking for an old S3 bucket, causing a mismatch.

To resolve, we deleted the _.tfstate_ file from our local directory and everything worked as expected.

```sh
rm ~/.terraform/terraform.tfstate
```
