From 7dd930d465b24de36c284dd1dc61e76215fe526f Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Mon, 8 Jul 2024 17:57:39 +0200 Subject: [PATCH] Add s3 backend store --- terraform.tf | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/terraform.tf b/terraform.tf index 152b23b..a544c3b 100644 --- a/terraform.tf +++ b/terraform.tf @@ -1,5 +1,6 @@ terraform { required_version = "~> 1.6" + required_providers { docker = { source = "kreuzwerker/docker" @@ -18,4 +19,20 @@ terraform { version = "0.4.0" } } + + backend "s3" { + bucket = "terraform" + key = "ti-iac.tfstate" + profile = "techinc-tf" + shared_credentials_files = ["~/.aws/credentials"] + endpoints = { + s3 = "http://california.ti:9000" + } + region = "main" # Region validation will be skipped + skip_credentials_validation = true # Skip AWS related checks and validations + skip_requesting_account_id = true + skip_metadata_api_check = true + skip_region_validation = true + use_path_style = true # Enable path-style S3 URLs (https:/// https://developer.hashicorp.com/terraform/language/settings/backends/s3#use_path_style + } }