-
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.
Refactor to allow individual tf modules
address #25 (comment)
- Loading branch information
Showing
30 changed files
with
211 additions
and
12 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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
module main { | ||
source = "../../cloud_module" | ||
source = "../../cloud_module/pipeline" | ||
environment_name = var.environment_name | ||
project_alias = var.project_alias | ||
slack_signing_secret = var.slack_signing_secret | ||
slack_post_webhook_url = var.slack_post_webhook_url | ||
repo_dir = var.repo_dir | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
terraform { | ||
backend "s3" { | ||
bucket = "iriversland-cloud" | ||
key = "terraform/media-literacy-dev--table.remote-terraform.tfstate" | ||
} | ||
} |
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 @@ | ||
terraform init -backend-config=local.backend.credentials.tfvars |
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 @@ | ||
module main_table { | ||
source = "${var.repo_dir}/cloud_module/dynamodb" | ||
environment_name = var.environment_name | ||
project_alias = var.project_alias | ||
} |
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,15 @@ | ||
variable "project_alias" { | ||
type = string | ||
description = "Name prefix used for step function and related resources, including the domain name, so please only use [0-9a-z_-]" | ||
} | ||
|
||
variable environment_name { | ||
type = string | ||
default = "" | ||
description = "Empty string for Production, otherwise the environment name e.g. dev, stage, etc, make sure to use lowercase (s3 bucket only allows lower)" | ||
} | ||
|
||
variable repo_dir { | ||
type = string | ||
description = "The absolute path of git repository path" | ||
} |
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 @@ | ||
set -e | ||
|
||
REPO_DIR=$(git rev-parse --show-toplevel) | ||
ENV=dev_table sh "${REPO_DIR}/cloud_environments/terraform.sh" "$@" |
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,7 +1,8 @@ | ||
module main { | ||
source = "../../cloud_module" | ||
source = "../../cloud_module/pipeline" | ||
environment_name = var.environment_name | ||
project_alias = var.project_alias | ||
slack_signing_secret = var.slack_signing_secret | ||
slack_post_webhook_url = var.slack_post_webhook_url | ||
repo_dir = var.repo_dir | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
resource "aws_dynamodb_table" "basic-dynamodb-table" { | ||
name = "GameScores" | ||
billing_mode = "PROVISIONED" | ||
read_capacity = 20 | ||
write_capacity = 20 | ||
hash_key = "UserId" | ||
range_key = "GameTitle" | ||
|
||
attribute { | ||
name = "UserId" | ||
type = "S" | ||
} | ||
|
||
attribute { | ||
name = "GameTitle" | ||
type = "S" | ||
} | ||
|
||
attribute { | ||
name = "TopScore" | ||
type = "N" | ||
} | ||
|
||
ttl { | ||
attribute_name = "TimeToExist" | ||
enabled = false | ||
} | ||
|
||
global_secondary_index { | ||
name = "GameTitleIndex" | ||
hash_key = "GameTitle" | ||
range_key = "TopScore" | ||
write_capacity = 10 | ||
read_capacity = 10 | ||
projection_type = "INCLUDE" | ||
non_key_attributes = ["UserId"] | ||
} | ||
|
||
tags = { | ||
Name = "dynamodb-table-1" | ||
Environment = "production" | ||
} | ||
} |
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,15 @@ | ||
variable "project_alias" { | ||
type = string | ||
description = "Name prefix used for step function and related resources, including the domain name, so please only use [0-9a-z_-]" | ||
} | ||
|
||
variable environment_name { | ||
type = string | ||
default = "" | ||
description = "Empty string for Production, otherwise the environment name e.g. dev, stage, etc, make sure to use lowercase (s3 bucket only allows lower)" | ||
} | ||
|
||
locals { | ||
project_name = var.environment_name != "" ? "${var.project_alias}-${var.environment_name}" : "${var.project_alias}" | ||
environment = var.environment_name != "" ? var.environment_name : "prod_table" | ||
} |
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,9 @@ | ||
terraform { | ||
required_version = ">= 1.0.2" # minimum version that supports M1 | ||
|
||
required_providers { | ||
# please use env var to pass over credentials | ||
# https://registry.terraform.io/providers/hashicorp/aws/latest/docs | ||
aws = ">= 4.9.0" # minimum version based on `terraform init` error message | ||
} | ||
} |
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.