'Terraform init Error: Failed to get existing workspaces: S3 bucket does not exist
Hi i have an issue with terraform not being able to see the s3 bucket when i specify it as a backend
aws --profile terraform s3api create-bucket --bucket "some_name_here" --region "eu-west-2" \
--create-bucket-configuration LocationConstraint="eu-west-2"
terraform init
Initializing modules...
Initializing the backend...
Error: Failed to get existing workspaces: S3 bucket does not exist.
The referenced S3 bucket must have been previously created. If the S3 bucket
was created within the last minute, please wait for a minute or two and try
again.
Error: NoSuchBucket: The specified bucket does not exist
status code: 404, request id: QYJT8KP0W4TM986A, host id: a7R1EOOnIhP6YzDcKd66zdyCJ8wk6lVom/tohsc0ipUe5yEJK1/V4bLGX9khi4q4/J7d4BgYXCc=
backend.tf
terraform {
backend "s3" {
bucket = "some_name_here"
key = "networking/terraform.tfstate"
region = "eu-west-2"
}
}
provider.tf
provider "aws" {
region = "eu-west-2"
shared_credentials_file = "$HOME/.aws/credentials"
profile = "terraform"
}
I can see the bucket in the dashboard
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
