I’m getting an error 403 Access denied when I tried to replace my local storage to cloud storage on Amazon S3.
terraform { backend "s3" { # Replace this with your bucket name! bucket = "great-name-terraform-state-2" key = "global/s3/terraform.tfstate" region = "us-east-2" # Replace this with your DynamoDB table name! dynamodb_table = "great-name-locks-2" encrypt = true } }
Error:
Error loading state: AccessDenied: Access Denied status code: 403
Replace your terraform block with the following code:
backend "s3" {""
bucket = "great-name-terraform-state-2"
key = "global/s3/terraform.tfstate"
region = "us-east-2"
access_key = "
secret_key = "
}
Now run the terraform init and check if it works.