Hi,
I trie to config a s3 bucket as a backend repository by setting the following in backend.tf:
terraform {
required_version = ">= 1.6"
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.31.0"
}
}
backend "s3" {
bucket = "toto-tf-backend-dev"
key = "dev/terraform.tfstate"
region = "eu-west-3"
dynamodb_table = "terraform-lock"
encrypt = true
profile = "toto-dev"
}
}
# provider block
provider "aws" {
profile = "toto-dev"
region = "eu-west-3"
}
Using this command line:
terraform init
I have this message:
Successfully configured the backend "s3"! Terraform will automatically
use this backend unless the backend configuration changes.
and that:
Terraform has been successfully initialized!
but it’s create a state and lock file localy, why ? ( I tried adding -backend=true option in terraform init command line after deleting .terraform folder and lock file, but got same result)
Does anyone have an answer to this? thanks in advance