Skip to content

Commit

Permalink
separate backend.tf (#2513)
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuki-shunsuke authored Mar 13, 2024
1 parent f03896a commit 461262e
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 32 deletions.
8 changes: 8 additions & 0 deletions aws/terraform-ci/backend.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
terraform {
# CHANGEME: Uncomment the following block to enable remote backend
# backend "s3" {
# bucket = "<S3 Bucket Name>"
# key = "aws/terraform-ci/v1/terraform.tfstate"
# region = "us-east-1"
# }
}
6 changes: 0 additions & 6 deletions aws/terraform-ci/terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ terraform {
# version = "4.0.5"
# }
}

# backend "s3" {
# bucket = "<S3 Bucket Name>"
# key = "aws/terraform-ci/v1/terraform.tfstate"
# region = "us-east-1"
# }
}

provider "aws" {
Expand Down
8 changes: 8 additions & 0 deletions github/services/bar/backend.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
terraform {
# CHANGEME: Uncomment the following block to enable remote backend
# backend "s3" {
# bucket = "<S3 Bucket Name>"
# key = "github/bar/v1/terraform.tfstate"
# region = "ap-northeast-1"
# }
}
6 changes: 0 additions & 6 deletions github/services/bar/terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ terraform {
version = "~> 5.0"
}
}

# backend "s3" {
# bucket = "<S3 Bucket Name>"
# key = "github/bar/v1/terraform.tfstate"
# region = "ap-northeast-1"
# }
}

provider "github" {
Expand Down
7 changes: 7 additions & 0 deletions github/services/foo/backend.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
terraform {
# backend "s3" {
# bucket = "<S3 Bucket Name>"
# key = "github/foo/v1/terraform.tfstate"
# region = "ap-northeast-1"
# }
}
5 changes: 0 additions & 5 deletions github/services/foo/terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ terraform {
version = "~> 5.0"
}
}
# backend "s3" {
# bucket = "<S3 Bucket Name>"
# key = "github/foo/v1/terraform.tfstate"
# region = "ap-northeast-1"
# }
}

provider "github" {
Expand Down
7 changes: 7 additions & 0 deletions templates/aws/backend.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
terraform {
backend "s3" {
bucket = "<S3 Bucket Name>"
key = "%%TARGET%%/v1/terraform.tfstate"
region = "us-east-1"
}
}
5 changes: 0 additions & 5 deletions templates/aws/terraform.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
terraform {
required_version = ">= 1.0"
backend "s3" {
bucket = "<S3 Bucket Name>"
key = "%%TARGET%%/v1/terraform.tfstate"
region = "us-east-1"
}
}

terraform {
Expand Down
7 changes: 7 additions & 0 deletions templates/gcp/backend.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
terraform {
backend "gcs" {
bucket = "<GCS Bucket Name>"
prefix = "%%TARGET%%/v1/terraform.tfstate"
region = "us-east1"
}
}
5 changes: 0 additions & 5 deletions templates/gcp/terraform.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
terraform {
required_version = ">= 1.0"
backend "gcs" {
bucket = "<GCS Bucket Name>"
prefix = "%%TARGET%%/v1/terraform.tfstate"
region = "us-east1"
}
}

terraform {
Expand Down
7 changes: 7 additions & 0 deletions templates/github/backend.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
terraform {
backend "s3" {
bucket = "<S3 Bucket Name>"
key = "%%TARGET%%/v1/terraform.tfstate"
region = "us-east-1" # CHANGEME Fix the region if necessary
}
}
5 changes: 0 additions & 5 deletions templates/github/terraform.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
terraform {
required_version = ">= 1.0"
backend "s3" {
bucket = "<S3 Bucket Name>"
key = "%%TARGET%%/v1/terraform.tfstate"
region = "us-east-1" # CHANGEME Fix the region if necessary
}
}

terraform {
Expand Down

0 comments on commit 461262e

Please sign in to comment.