-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Toaster basic support, defaults (#8)
* toasterdb poc * toasterurl from envvar * upd readme * Toaster basic support, defaults * Fix release only from master * Upd readme
- Loading branch information
Showing
14 changed files
with
148 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ on: | |
- 'master' | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
|
||
permissions: | ||
contents: write | ||
|
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 |
---|---|---|
|
@@ -47,15 +47,21 @@ Currently only `dimensions` with list of the required/expecting dimensions (from | |
|
||
## Inventory (dimensions) store | ||
|
||
You could set env variable `toasterurl` to point to TofuGu-Toaster, like `export toasterurl='https://accountid:[email protected]'`. | ||
Then TofuGu will connect and receive all the required dimension data from TofuGu-Toaster-ToasterDB. | ||
Additional parameter could be passed to tofugu `-w workspacename`. In general `workspacename` is the branch name of the source repo where the dimension is stored. If TofuGu-Toaster will not find dimension with specified `workspacename` it will try to return dimension from `master` workspace/branch! | ||
|
||
When you set dimensions in the tofugu flags `-d datacenter:staging1 `, tofugu will provide you inside code next variables: | ||
|
||
- var.tofugu_datacenter_name = will contain string `staging1` | ||
- var.tofugu_datacenter_manifest = will contain whole object from `staging1.json` | ||
- var.tofugu_datacenter_defaults = will contain whole object from `dim_defaults.json` IF file `dim_defaults.json` exists! | ||
|
||
[datacenter.json example in inventory](examples/inventory/demo-org/datacenter/staging1.json) | ||
|
||
Examples: | ||
|
||
[datacenter object from json used in code example](examples/tofies/demo-org/vpc/main.tf) | ||
- [staging1.json in Inventory Files](examples/inventory/demo-org/datacenter/staging1.json) | ||
- [dim_defaults.json in Inventory Files](examples/inventory/demo-org/datacenter/dim_defaults.json) | ||
- [datacenter object with defaults used in tf-code](examples/tofies/demo-org/vpc/main.tf#L5) | ||
|
||
## Passing environment variables from shell | ||
|
||
|
@@ -72,7 +78,7 @@ provider "aws" { | |
} | ||
``` | ||
|
||
[Env variables used in code example](examples/tofies/demo-org/vpc/providers.tf) | ||
[Env variables used in code example](examples/tofies/demo-org/vpc/providers.tf#L3) | ||
|
||
## $HOME/.tofugu | ||
|
||
|
@@ -120,7 +126,7 @@ Other options contain hard-coded defaults: | |
|
||
# Remote state in S3 | ||
|
||
[Your terraform code (`tofi`) should contains at least:](examples/tofies/demo-org/vpc/versions.tf): | ||
[Your terraform code (`tofi`) should contains at least:](examples/tofies/demo-org/vpc/versions.tf#L4): | ||
``` | ||
terraform { | ||
backend "s3" {} | ||
|
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,8 @@ | ||
{ | ||
"services": { | ||
"first-service": { | ||
"cmd": "sh -c sleep 10", | ||
"workDir": "app" | ||
} | ||
} | ||
} |
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,5 @@ | ||
{ | ||
"test-account": { | ||
"enable_dns_support": true | ||
} | ||
} |
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,12 +1,13 @@ | ||
//use shared-module | ||
module "vpc" { | ||
source = "./shared-modules/create_vpc" | ||
cidr = var.tofugu_datacenter_manifest[var.tofugu_account_name].cidr | ||
cidr = var.tofugu_datacenter_data[var.tofugu_account_name].cidr | ||
enable_dns_support = try(var.tofugu_datacenter_data[var.tofugu_account_name].enable_dns_support, var.tofugu_datacenter_defaults[var.tofugu_account_name].enable_dns_support) | ||
} | ||
|
||
module "vpc_example_simple-vpc" { | ||
source = "terraform-aws-modules/vpc/aws" | ||
version = "5.7.1" | ||
|
||
cidr = var.tofugu_datacenter_manifest[var.tofugu_account_name].cidr | ||
cidr = var.tofugu_datacenter_data[var.tofugu_account_name].cidr | ||
} |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
resource "aws_vpc" "example" { | ||
cidr_block = var.cidr | ||
cidr_block = var.cidr | ||
enable_dns_support = var.enable_dns_support | ||
} |
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,7 @@ | ||
variable "cidr" { | ||
type = string | ||
} | ||
|
||
variable "enable_dns_support" { | ||
type = bool | ||
} |
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
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