Skip to content
This repository has been archived by the owner on Oct 7, 2021. It is now read-only.

Commit

Permalink
Update to current pattern (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuru authored Apr 8, 2019
1 parent ac384fb commit 10eaf36
Show file tree
Hide file tree
Showing 54 changed files with 363 additions and 160 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
build-harness
/repos/
/accounts/
/artifacts/
.terraform
*.tfstate
*.tfstate.backup
Expand Down
16 changes: 15 additions & 1 deletion configs/audit.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,21 @@ templates = [
".gitignore",
".dockerignore",
"Makefile",
"conf/Makefile",
"conf/tfstate-backend/.envrc",
"conf/tfstate-backend/Makefile.tasks",
"conf/tfstate-backend/terraform.envrc",
"conf/tfstate-backend/terraform.tfvars",
"conf/account-dns/.envrc",
"conf/account-dns/Makefile.tasks",
"conf/account-dns/terraform.envrc",
"conf/account-dns/terraform.tfvars",
"conf/chamber/.envrc",
"conf/chamber/Makefile.tasks",
"conf/chamber/terraform.envrc",
"conf/chamber/terraform.tfvars",
"conf/audit-cloudtrail/.envrc",
"conf/audit-cloudtrail/Makefile.tasks",
"conf/audit-cloudtrail/terraform.envrc",
]

# List of terraform root modules to enable
Expand Down
27 changes: 25 additions & 2 deletions configs/corp.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,39 @@ templates = [
".gitignore",
".dockerignore",
"Makefile",
"conf/Makefile",
"conf/account-dns/terraform.tfvars",
"conf/tfstate-backend/.envrc",
"conf/tfstate-backend/Makefile.tasks",
"conf/tfstate-backend/terraform.envrc",
"conf/tfstate-backend/terraform.tfvars",
"conf/account-dns/.envrc",
"conf/account-dns/Makefile.tasks",
"conf/account-dns/terraform.envrc",
"conf/account-dns/terraform.tfvars",
"conf/chamber/.envrc",
"conf/chamber/Makefile.tasks",
"conf/chamber/terraform.envrc",
"conf/chamber/terraform.tfvars",
"conf/cloudtrail/.envrc",
"conf/cloudtrail/Makefile.tasks",
"conf/cloudtrail/terraform.envrc",
"conf/kops/.envrc",
"conf/kops/Makefile.tasks",
"conf/kops/kops.envrc",
"conf/kops/terraform.envrc",
"conf/kops/terraform.tfvars",
"docs/kops.md",
"conf/kops-aws-platform/.envrc",
"conf/kops-aws-platform/Makefile.tasks",
"conf/kops-aws-platform/terraform.envrc",
"conf/kops-aws-platform/terraform.tfvars",
]

# List of terraform root modules to enable
terraform_root_modules = [
"aws/tfstate-backend",
"aws/account-dns",
"aws/chamber",
"aws/kops",
"aws/kops-aws-platform",
"aws/cloudtrail",
]
27 changes: 25 additions & 2 deletions configs/data.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,39 @@ templates = [
".gitignore",
".dockerignore",
"Makefile",
"conf/Makefile",
"conf/account-dns/terraform.tfvars",
"conf/tfstate-backend/.envrc",
"conf/tfstate-backend/Makefile.tasks",
"conf/tfstate-backend/terraform.envrc",
"conf/tfstate-backend/terraform.tfvars",
"conf/account-dns/.envrc",
"conf/account-dns/Makefile.tasks",
"conf/account-dns/terraform.envrc",
"conf/account-dns/terraform.tfvars",
"conf/chamber/.envrc",
"conf/chamber/Makefile.tasks",
"conf/chamber/terraform.envrc",
"conf/chamber/terraform.tfvars",
"conf/cloudtrail/.envrc",
"conf/cloudtrail/Makefile.tasks",
"conf/cloudtrail/terraform.envrc",
"conf/kops/.envrc",
"conf/kops/Makefile.tasks",
"conf/kops/kops.envrc",
"conf/kops/terraform.envrc",
"conf/kops/terraform.tfvars",
"docs/kops.md",
"conf/kops-aws-platform/.envrc",
"conf/kops-aws-platform/Makefile.tasks",
"conf/kops-aws-platform/terraform.envrc",
"conf/kops-aws-platform/terraform.tfvars",
]

# List of terraform root modules to enable
terraform_root_modules = [
"aws/tfstate-backend",
"aws/account-dns",
"aws/chamber",
"aws/kops",
"aws/kops-aws-platform",
"aws/cloudtrail",
]
16 changes: 14 additions & 2 deletions configs/dev.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,21 @@ templates = [
".gitignore",
".dockerignore",
"Makefile",
"conf/Makefile",
"conf/account-dns/terraform.tfvars",
"conf/tfstate-backend/.envrc",
"conf/tfstate-backend/Makefile.tasks",
"conf/tfstate-backend/terraform.envrc",
"conf/tfstate-backend/terraform.tfvars",
"conf/account-dns/.envrc",
"conf/account-dns/Makefile.tasks",
"conf/account-dns/terraform.envrc",
"conf/account-dns/terraform.tfvars",
"conf/chamber/.envrc",
"conf/chamber/Makefile.tasks",
"conf/chamber/terraform.envrc",
"conf/chamber/terraform.tfvars",
"conf/cloudtrail/.envrc",
"conf/cloudtrail/Makefile.tasks",
"conf/cloudtrail/terraform.envrc",
]

# List of terraform root modules to enable
Expand Down
27 changes: 25 additions & 2 deletions configs/prod.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,39 @@ templates = [
".gitignore",
".dockerignore",
"Makefile",
"conf/Makefile",
"conf/account-dns/terraform.tfvars",
"conf/tfstate-backend/.envrc",
"conf/tfstate-backend/Makefile.tasks",
"conf/tfstate-backend/terraform.envrc",
"conf/tfstate-backend/terraform.tfvars",
"conf/account-dns/.envrc",
"conf/account-dns/Makefile.tasks",
"conf/account-dns/terraform.envrc",
"conf/account-dns/terraform.tfvars",
"conf/chamber/.envrc",
"conf/chamber/Makefile.tasks",
"conf/chamber/terraform.envrc",
"conf/chamber/terraform.tfvars",
"conf/cloudtrail/.envrc",
"conf/cloudtrail/Makefile.tasks",
"conf/cloudtrail/terraform.envrc",
"conf/kops/.envrc",
"conf/kops/Makefile.tasks",
"conf/kops/kops.envrc",
"conf/kops/terraform.envrc",
"conf/kops/terraform.tfvars",
"docs/kops.md",
"conf/kops-aws-platform/.envrc",
"conf/kops-aws-platform/Makefile.tasks",
"conf/kops-aws-platform/terraform.envrc",
"conf/kops-aws-platform/terraform.tfvars",
]

# List of terraform root modules to enable
terraform_root_modules = [
"aws/tfstate-backend",
"aws/account-dns",
"aws/chamber",
"aws/kops",
"aws/kops-aws-platform",
"aws/cloudtrail",
]
35 changes: 29 additions & 6 deletions configs/root.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,39 @@ templates = [
".gitignore",
".dockerignore",
"Makefile",
"conf/Makefile",
"conf/accounts/.envrc",
"conf/accounts/Makefile.tasks",
"conf/accounts/terraform.envrc",
"conf/accounts/terraform.tfvars",
"conf/account-settings/.envrc",
"conf/account-settings/Makefile.tasks",
"conf/account-settings/terraform.envrc",
"conf/account-settings/terraform.tfvars",
"conf/bootstrap/.envrc",
"conf/bootstrap/Makefile.tasks",
"conf/bootstrap/terraform.envrc",
"conf/bootstrap/terraform.tfvars",
"conf/cloudtrail/.envrc",
"conf/cloudtrail/Makefile.tasks",
"conf/cloudtrail/terraform.envrc",
"conf/iam/.envrc",
"conf/iam/Makefile.tasks",
"conf/iam/terraform.envrc",
"conf/iam/terraform.tfvars",
"conf/root-dns/.envrc",
"conf/root-dns/Makefile.tasks",
"conf/root-dns/terraform.envrc",
"conf/root-dns/terraform.tfvars",
"conf/root-iam/.envrc",
"conf/root-iam/Makefile.tasks",
"conf/root-iam/terraform.envrc",
"conf/tfstate-backend/.envrc",
"conf/tfstate-backend/Makefile.tasks",
"conf/tfstate-backend/terraform.envrc",
"conf/tfstate-backend/terraform.tfvars",
"conf/users/.envrc",
"conf/users/Makefile.tasks",
"conf/users/terraform.envrc",
"conf/users/terraform.tfvars"
]

Expand All @@ -61,13 +88,9 @@ users = {
# "[email protected]" = "osterman"
}

# Terraform Root Modules Image (don't change this unless you know what you're doing)
# Project: https://github.com/cloudposse/terraform-root-modules
terraform_root_modules_image = "cloudposse/terraform-root-modules:0.23.0"

# Geodesic Base Image (don't change this unless you know what you're doing)
# Project: https://github.com/cloudposse/geodesic
geodesic_base_image = "cloudposse/geodesic:0.57.0"
geodesic_base_image = "cloudposse/geodesic:0.87.0"

# List of terraform root modules to enable
terraform_root_modules = [
Expand Down
27 changes: 25 additions & 2 deletions configs/staging.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,39 @@ templates = [
".gitignore",
".dockerignore",
"Makefile",
"conf/Makefile",
"conf/account-dns/terraform.tfvars",
"conf/tfstate-backend/.envrc",
"conf/tfstate-backend/Makefile.tasks",
"conf/tfstate-backend/terraform.envrc",
"conf/tfstate-backend/terraform.tfvars",
"conf/account-dns/.envrc",
"conf/account-dns/Makefile.tasks",
"conf/account-dns/terraform.envrc",
"conf/account-dns/terraform.tfvars",
"conf/chamber/.envrc",
"conf/chamber/Makefile.tasks",
"conf/chamber/terraform.envrc",
"conf/chamber/terraform.tfvars",
"conf/cloudtrail/.envrc",
"conf/cloudtrail/Makefile.tasks",
"conf/cloudtrail/terraform.envrc",
"conf/kops/.envrc",
"conf/kops/Makefile.tasks",
"conf/kops/kops.envrc",
"conf/kops/terraform.envrc",
"conf/kops/terraform.tfvars",
"docs/kops.md",
"conf/kops-aws-platform/.envrc",
"conf/kops-aws-platform/Makefile.tasks",
"conf/kops-aws-platform/terraform.envrc",
"conf/kops-aws-platform/terraform.tfvars",
]

# List of terraform root modules to enable
terraform_root_modules = [
"aws/tfstate-backend",
"aws/account-dns",
"aws/chamber",
"aws/kops",
"aws/kops-aws-platform",
"aws/cloudtrail",
]
27 changes: 25 additions & 2 deletions configs/testing.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,39 @@ templates = [
".gitignore",
".dockerignore",
"Makefile",
"conf/Makefile",
"conf/account-dns/terraform.tfvars",
"conf/tfstate-backend/.envrc",
"conf/tfstate-backend/Makefile.tasks",
"conf/tfstate-backend/terraform.envrc",
"conf/tfstate-backend/terraform.tfvars",
"conf/account-dns/.envrc",
"conf/account-dns/Makefile.tasks",
"conf/account-dns/terraform.envrc",
"conf/account-dns/terraform.tfvars",
"conf/chamber/.envrc",
"conf/chamber/Makefile.tasks",
"conf/chamber/terraform.envrc",
"conf/chamber/terraform.tfvars",
"conf/cloudtrail/.envrc",
"conf/cloudtrail/Makefile.tasks",
"conf/cloudtrail/terraform.envrc",
"conf/kops/.envrc",
"conf/kops/Makefile.tasks",
"conf/kops/kops.envrc",
"conf/kops/terraform.envrc",
"conf/kops/terraform.tfvars",
"docs/kops.md",
"conf/kops-aws-platform/.envrc",
"conf/kops-aws-platform/Makefile.tasks",
"conf/kops-aws-platform/terraform.envrc",
"conf/kops-aws-platform/terraform.tfvars",
]

# List of terraform root modules to enable
terraform_root_modules = [
"aws/tfstate-backend",
"aws/account-dns",
"aws/chamber",
"aws/kops",
"aws/kops-aws-platform",
"aws/cloudtrail",
]
31 changes: 15 additions & 16 deletions modules/account/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,21 @@ locals {
repo_dir = "${var.repos_dir}/${local.image_name}"

context = {
aws_account_id = "${var.aws_account_id}"
aws_root_account_id = "${var.aws_root_account_id}"
aws_region = "${var.aws_region}"
docker_registry = "${var.docker_registry}"
domain_name = "${local.domain_name}"
image_name = "${local.image_name}"
image_tag = "${var.image_tag}"
motd_url = "${var.motd_url}"
namespace = "${var.namespace}"
stage = "${var.stage}"
parent_domain_name = "${var.domain}"
geodesic_base_image = "${var.geodesic_base_image}"
terraform_root_modules_image = "${var.terraform_root_modules_image}"
terraform_root_modules = "${join("\n", data.null_data_source.terraform_root_modules.*.outputs.copy_from)}"
org_network_cidr = "${var.org_network_cidr}"
account_network_cidr = "${var.account_network_cidr}"
aws_account_id = "${var.aws_account_id}"
aws_root_account_id = "${var.aws_root_account_id}"
aws_region = "${var.aws_region}"
docker_registry = "${var.docker_registry}"
domain_name = "${local.domain_name}"
image_name = "${local.image_name}"
image_tag = "${var.image_tag}"
motd_url = "${var.motd_url}"
namespace = "${var.namespace}"
stage = "${var.stage}"
parent_domain_name = "${var.domain}"
geodesic_base_image = "${var.geodesic_base_image}"
terraform_root_modules = "${join("\n", data.null_data_source.terraform_root_modules.*.outputs.copy_from)}"
org_network_cidr = "${var.org_network_cidr}"
account_network_cidr = "${var.account_network_cidr}"
}

vars = "${merge(var.vars, local.context)}"
Expand Down
2 changes: 0 additions & 2 deletions modules/account/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,3 @@ variable "geodesic_base_image" {}
variable "terraform_root_modules" {
type = "list"
}

variable "terraform_root_modules_image" {}
2 changes: 1 addition & 1 deletion modules/add-users/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ data "template_file" "data" {
resource "local_file" "data" {
count = "${length(keys(var.users))}"
content = "${element(data.template_file.data.*.rendered, count.index)}"
filename = "${var.output_dir}/${replace(element(keys(var.users), count.index), local.unsafe_characters, "_")}.tf"
filename = "${var.output_dir}/overrides/${replace(element(keys(var.users), count.index), local.unsafe_characters, "_")}.tf"
}

# https://github.com/terraform-providers/terraform-provider-local/issues/19
Expand Down
Loading

0 comments on commit 10eaf36

Please sign in to comment.