# Terraform override for LocalStack
# This file is automatically linked into each project directory

terraform {
  # Override backend to use local state for LocalStack
  backend "local" {}
}

provider "aws" {
  region = "us-east-1"

  # LocalStack endpoints
  endpoints {
    s3            = "http://localhost:4566"
    lambda        = "http://localhost:4566"
    stepfunctions = "http://localhost:4566"
    iam           = "http://localhost:4566"
    events        = "http://localhost:4566"
    cloudwatch    = "http://localhost:4566"
    logs          = "http://localhost:4566"
    sts           = "http://localhost:4566"
    ecr           = "http://localhost:4566"
    sns           = "http://localhost:4566"
    sqs           = "http://localhost:4566"
  }

  # Skip validation for LocalStack
  skip_credentials_validation = true
  skip_metadata_api_check     = true
  skip_requesting_account_id  = true

  # LocalStack credentials
  access_key = "test"
  secret_key = "test"

  # S3 path-style addressing (required for LocalStack)
  s3_use_path_style = true
}
