Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error inspecting states in the "s3" backend: NoSuchBucket: The specified bucket does not exist

Tags:

terraform

I am running terraform init on my terraform modules folder and I am getting below.

Error inspecting states in the "s3" backend:
    NoSuchBucket: The specified bucket does not exist
    status code: 404, request id: 6667B0A661F9C62F, host id: 3mC8DNrS/gGHtp7mhVMRtpIUeMaNXs2cEozEY+akZf1ixFD6x2qQx7c3mX02M1BIbyfYowYt35s=
like image 822
Cool Eagle Avatar asked Jun 13 '18 18:06

Cool Eagle


2 Answers

I was having the same issue.

Using aws command aws s3 ls and aws s3api list-objects --bucket bucket-name

I could list the content but was still having the same issue.

Error inspecting states in the "s3" backend: NoSuchBucket: The specified bucket does not exist status code: 404, request id: xxxxx, host id: xxxxxx

Erased the ./terraform directory and it fixed my issue.

like image 145
Raposo Avatar answered Nov 13 '22 02:11

Raposo


I was getting the similar issue as below

Error inspecting states in the "s3" backend:
    AccessDenied: Access Denied
    status code: 403, request id: XXXXXX, host id: XXXXX

And after removing the .terraform file it worked (In my case I was using Jenkins, so I have to remove it from Jenkins server's project directory and it worked for me). Thanks !

like image 5
Arpan Avatar answered Nov 13 '22 02:11

Arpan