-
Notifications
You must be signed in to change notification settings - Fork 3
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
9 changed files
with
159 additions
and
2 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,3 +1,4 @@ | ||
locals { | ||
aws_profile_name = "dev" | ||
aws_region = "us-east-1" | ||
} |
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 @@ | ||
locals { | ||
aws_profile_name = "prod" | ||
aws_region = "us-east-1" | ||
} |
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,23 @@ | ||
# Include the root `terragrunt.hcl` configuration. The root configuration contains settings that are common across all | ||
# components and environments, such as how to configure remote state. | ||
include "root" { | ||
path = find_in_parent_folders() | ||
} | ||
|
||
terraform { | ||
source = "../../../modules/postgresql-aurora" | ||
} | ||
|
||
locals { | ||
environment_vars = read_terragrunt_config(find_in_parent_folders("env.hcl")) | ||
} | ||
|
||
inputs = { | ||
identifier = local.environment_vars.locals.identifier | ||
engine_version = local.environment_vars.locals.engine_version | ||
vpc_id = local.environment_vars.locals.vpc_id | ||
vpc_cidr = local.environment_vars.locals.vpc_cidr | ||
subnet_ids = local.environment_vars.locals.private_subnet_ids | ||
instances = local.environment_vars.locals.instances | ||
database_name = local.environment_vars.locals.database_name | ||
} |
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,55 @@ | ||
# Set common variables for the environment. This is automatically pulled in in the root terragrunt.hcl configuration to | ||
# feed forward to the child modules. | ||
locals { | ||
|
||
////////////////// | ||
//// Shared | ||
////////////////// | ||
|
||
environment = "production" | ||
project_name = "identity" | ||
region = "us-east-1" | ||
vpc_id = "vpc-0fc38067c89106d19" | ||
vpc_cidr = "10.1.0.0/16" | ||
private_subnet_ids = ["subnet-0188da42ca87de29f", "subnet-0067bd76934a5a123", "subnet-085eaa7aa58476f7d", "subnet-0b9e4cad47b46a298"] | ||
public_subnet_ids = ["subnet-0e6b30abd06c12017", "subnet-0c98f159030773c7e", "subnet-0ac2b8a4a1d8b58b3", "subnet-0da03025f0d5221d5", ] | ||
|
||
////////////////// | ||
//// Aurora | ||
////////////////// | ||
|
||
identifier = "${local.environment}-${local.project_name}" | ||
engine_version = "16.2" | ||
database_name = "identitydb" //DatabaseName `identity` cannot be used. It is a reserved word for this engine. | ||
instances = { | ||
1 = { | ||
instance_class = "db.r7g.xlarge" | ||
publicly_accessible = false | ||
db_parameter_group_name = "default.aurora-postgresql16" | ||
} | ||
} | ||
|
||
////////////////// | ||
//// ECS | ||
////////////////// | ||
|
||
ecs_prefix = "${local.environment}-${local.project_name}" | ||
ssl_certificate_arn = "arn:aws:acm:us-east-1:884078395586:certificate/62f6f766-c92e-4792-a26c-2edfff49194e" | ||
cloudflare_zone_id = "43c53e4c8555e49c1a70efd4c949fb02" #treasure.lol | ||
cloudflare_proxy_enabled = true | ||
desired_count = 3 | ||
autoscaling_min_capacity = 3 | ||
autoscaling_max_capacity = 9 | ||
fargate_cpu = "2048" | ||
fargate_memory = "4096" | ||
task_cpu = "2048" | ||
task_memory = "4096" | ||
dns_name = "tdk-api1" | ||
|
||
////////////////// | ||
//// Github OIDC | ||
////////////////// | ||
|
||
iam_role_prefix = "${local.environment}-${local.project_name}" | ||
github_project = "TreasureProject/tdk-js" # gitHubOrg/gitHubRepo | ||
} |
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,41 @@ | ||
# Include the root `terragrunt.hcl` configuration. The root configuration contains settings that are common across all | ||
# components and environments, such as how to configure remote state. | ||
include "root" { | ||
path = find_in_parent_folders() | ||
} | ||
|
||
terraform { | ||
source = "../../../modules/ecs-fargate" | ||
} | ||
|
||
locals { | ||
environment_vars = read_terragrunt_config(find_in_parent_folders("env.hcl")) | ||
} | ||
|
||
inputs = { | ||
vpc_id = local.environment_vars.locals.vpc_id | ||
public_subnets = local.environment_vars.locals.public_subnet_ids | ||
private_subnets = local.environment_vars.locals.private_subnet_ids | ||
ecs_prefix = local.environment_vars.locals.ecs_prefix | ||
region = local.environment_vars.locals.region | ||
aurora_secret_name = dependency.aurora.outputs.aurora_secret_name | ||
ssl_certificate_arn = local.environment_vars.locals.ssl_certificate_arn | ||
cloudflare_zone_id = local.environment_vars.locals.cloudflare_zone_id | ||
desired_count = local.environment_vars.locals.desired_count | ||
autoscaling_min_capacity = local.environment_vars.locals.autoscaling_min_capacity | ||
autoscaling_max_capacity = local.environment_vars.locals.autoscaling_max_capacity | ||
dns_name = local.environment_vars.locals.dns_name | ||
cloudflare_proxy_enabled = local.environment_vars.locals.cloudflare_proxy_enabled | ||
fargate_cpu = local.environment_vars.locals.fargate_cpu | ||
fargate_memory = local.environment_vars.locals.fargate_memory | ||
task_cpu = local.environment_vars.locals.task_cpu | ||
task_memory = local.environment_vars.locals.task_memory | ||
|
||
} | ||
|
||
dependency "aurora" { | ||
config_path = "../aurora" | ||
mock_outputs = { | ||
aurora_secret_name = "${local.environment_vars.locals.identifier}-db" | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
terraform/environments/production/github-oidc/terragrunt.hcl
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,19 @@ | ||
# Include the root `terragrunt.hcl` configuration. The root configuration contains settings that are common across all | ||
# components and environments, such as how to configure remote state. | ||
include "root" { | ||
path = find_in_parent_folders() | ||
} | ||
|
||
terraform { | ||
source = "../../../modules/github-oidc" | ||
} | ||
|
||
locals { | ||
environment_vars = read_terragrunt_config(find_in_parent_folders("env.hcl")) | ||
} | ||
|
||
inputs = { | ||
prefix = local.environment_vars.locals.iam_role_prefix | ||
github_project = local.environment_vars.locals.github_project | ||
} | ||
|
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