-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
249 additions
and
881 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,20 @@ | ||
# Cloud Infrastructure | ||
|
||
The list of cloud infrastructure resources required by the application. | ||
Pre-configured environments: | ||
|
||
- `prod` — production environment | ||
- `test` — test / QA environment (default) | ||
- `dev` — local development environment | ||
|
||
The list of cloud infrastructure resources: | ||
|
||
- `backend.tf` — Terraform "remote" backend | ||
- `data.tf` — data sources | ||
- `locals.tf` — local variables | ||
- `override.tf` — configuration overrides | ||
- `providers.tf`— Terraform providers | ||
- `services.tf` — Google Cloud APIs | ||
- `storage.tf` — Google Cloud Storage buckets | ||
- `variables.tf` — environment specific variables | ||
|
||
Fore more information visit https://learn.hashicorp.com/terraform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Data Sources | ||
# https://www.terraform.io/language/data-sources | ||
|
||
data "google_project" "default" {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Local Values | ||
# https://www.terraform.io/language/values/locals | ||
|
||
locals { | ||
workspace_prefix = "app-" | ||
|
||
# The name of the selected workspace environment | ||
# • `prod` — production | ||
# • `test` — test / QA | ||
# • `dev` — local development | ||
env = trimprefix(terraform.workspace, local.workspace_prefix) | ||
|
||
# Helper variables for detecting the selected workspace environment | ||
is_production = local.env == "prod" | ||
is_test = local.env == "test" | ||
is_development = local.env == "dev" | ||
|
||
# Application URL | ||
domain = "example.com" | ||
hostname = local.is_production ? local.domain : "${local.env}.${local.domain}" | ||
origin = "https://${local.hostname}" | ||
|
||
// Google Cloud Project | ||
// https://cloud.google.com/resource-manager/docs/creating-managing-projects | ||
project = { | ||
"prod" = "example" | ||
"test" = "example-test" | ||
"dev" = "example-dev" | ||
}[local.env] | ||
|
||
# Google Cloud Location | ||
# https://cloud.google.com/compute/docs/regions-zones | ||
region = "us-central1" | ||
zone = "us-central1-f" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.