Skip to content

Commit

Permalink
split backend configs.
Browse files Browse the repository at this point in the history
  • Loading branch information
mazgi committed Sep 8, 2022
1 parent a16b5bd commit 7d6636c
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 80 deletions.
Empty file removed provisioning/.keep
Empty file.
6 changes: 6 additions & 0 deletions provisioning/backend.azurerm.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
terraform {
backend "azurerm" {
container_name = "provisioning"
key = "default/terraform"
}
}
5 changes: 5 additions & 0 deletions provisioning/backend.gcs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
terraform {
backend "gcs" {
prefix = "default/terraform"
}
}
5 changes: 5 additions & 0 deletions provisioning/backend.s3.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
terraform {
backend "s3" {
key = "default/terraform"
}
}
60 changes: 0 additions & 60 deletions provisioning/examples/terraform.tf

This file was deleted.

20 changes: 0 additions & 20 deletions provisioning/examples/variable.tf

This file was deleted.

49 changes: 49 additions & 0 deletions provisioning/terraform.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
terraform {
# https://www.terraform.io/downloads.html
required_version = "1.2.8"

required_providers {
# https://registry.terraform.io/providers/hashicorp/aws/latest
aws = {
source = "hashicorp/aws"
version = "=4.27.0"
}
# https://registry.terraform.io/providers/hashicorp/azurerm/latest
azurerm = {
source = "hashicorp/azurerm"
version = "=3.19.1"
}
# https://registry.terraform.io/providers/hashicorp/google/latest
google = {
source = "hashicorp/google"
version = "=4.33.0"
}
# https://registry.terraform.io/providers/hashicorp/google-beta/latest
google-beta = {
source = "hashicorp/google-beta"
version = "=4.33.0"
}
}
}

provider "aws" {
access_key = var.aws_access_key
secret_key = var.aws_secret_key
region = var.aws_default_region
}

provider "azurerm" {
features {}
}

provider "google" {
project = var.gcp_project_id
region = var.gcp_default_region
zone = "${var.gcp_default_region}-a"
}

provider "google-beta" {
project = var.gcp_project_id
region = var.gcp_default_region
zone = "${var.gcp_default_region}-a"
}
24 changes: 24 additions & 0 deletions provisioning/variable.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
variable "project_unique_id" {}

variable "allowed_ipaddr_list" {
type = list(string)
}

variable "base_dnsdomain" {
default = "example.dev"
}

# <AWS>
variable "aws_default_region" {}
variable "aws_access_key" {}
variable "aws_secret_key" {}
# </AWS>

# <Azure>
variable "azure_default_location" {}
# </Azure>

# <Google>
variable "gcp_default_region" {}
variable "gcp_project_id" {}
# </Google>

0 comments on commit 7d6636c

Please sign in to comment.