-
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.
major refactor to avoid the github variables mess
- Loading branch information
1 parent
d017daa
commit 82712af
Showing
18 changed files
with
99 additions
and
160 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 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 @@ | ||
ES_HOST=ec2-3-25-64-248.ap-southeast-2.compute.amazonaws.com | ||
INDEXER_HOST=ec2-3-25-163-152.ap-southeast-2.compute.amazonaws.com | ||
INDEXER_PORT=8081 | ||
GEONETWORK_DB_TYPE=postgres | ||
GEONETWORK_DB_HOST=stefan-db-rds-primary-evaluation.gamma.aodn.org.au | ||
GEONETWORK_DB_PORT=5432 | ||
GEONETWORK_DB_NAME=geonetwork | ||
GEONETWORK_DB_USERNAME=geonetwork |
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 @@ | ||
ES_HOST=ec2-3-25-64-248.ap-southeast-2.compute.amazonaws.com | ||
INDEXER_HOST=ec2-3-25-163-152.ap-southeast-2.compute.amazonaws.com | ||
INDEXER_PORT=8081 | ||
GEONETWORK_DB_TYPE=postgres | ||
GEONETWORK_DB_HOST=stefan-db-rds-primary-evaluation.gamma.aodn.org.au | ||
GEONETWORK_DB_PORT=5432 | ||
GEONETWORK_DB_NAME=geonetwork | ||
GEONETWORK_DB_USERNAME=geonetwork |
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 @@ | ||
ES_HOST=ec2-3-25-64-248.ap-southeast-2.compute.amazonaws.com | ||
INDEXER_HOST=ec2-3-25-163-152.ap-southeast-2.compute.amazonaws.com | ||
INDEXER_PORT=8081 | ||
GEONETWORK_DB_TYPE=postgres | ||
GEONETWORK_DB_HOST=stefan-db-rds-primary-evaluation.gamma.aodn.org.au | ||
GEONETWORK_DB_PORT=5432 | ||
GEONETWORK_DB_NAME=geonetwork | ||
GEONETWORK_DB_USERNAME=geonetwork |
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,18 +1,4 @@ | ||
# general environment variables for Terragrunt | ||
ALB_PARAMETER_NAME=shared-alb-devops-sydney | ||
APP_NAME=geonetwork4 | ||
AWS_ACCOUNT_ID=450356697252 | ||
AWS_REGION=ap-southeast-2 | ||
# variables required for GitHub Actions workflows | ||
ECR_REGISTRY=450356697252.dkr.ecr.ap-southeast-2.amazonaws.com | ||
ECR_REPOSITORY=geonetwork4 | ||
ENVIRONMENT=tf-development | ||
|
||
# container definition variables | ||
ES_HOST=ec2-3-25-64-248.ap-southeast-2.compute.amazonaws.com | ||
INDEXER_HOST=ec2-3-25-163-152.ap-southeast-2.compute.amazonaws.com | ||
INDEXER_PORT=8081 | ||
GEONETWORK_DB_TYPE=postgres | ||
GEONETWORK_DB_HOST=stefan-db-rds-primary-evaluation.gamma.aodn.org.au | ||
GEONETWORK_DB_PORT=5432 | ||
GEONETWORK_DB_NAME=geonetwork | ||
GEONETWORK_DB_USERNAME=geonetwork | ||
ENVIRONMENT=development |
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,19 +1,4 @@ | ||
# general environment variables for Terragrunt | ||
ALB_PARAMETER_NAME=shared-alb-devops-sydney | ||
APP_HEALTH_CHECK="CMD-SHELL,uwsgi-is-ready --stats-socket /tmp/statsock > /dev/null 2>&1 || exit 1" | ||
APP_NAME=geonetwork4 | ||
AWS_ACCOUNT_ID=450356697252 | ||
AWS_REGION=ap-southeast-2 | ||
# variables required for GitHub Actions workflows | ||
ECR_REGISTRY=450356697252.dkr.ecr.ap-southeast-2.amazonaws.com | ||
ECR_REPOSITORY=geonetwork4 | ||
ENVIRONMENT=production | ||
|
||
# container definition variables | ||
ES_HOST=ec2-3-25-64-248.ap-southeast-2.compute.amazonaws.com | ||
INDEXER_HOST=ec2-3-25-163-152.ap-southeast-2.compute.amazonaws.com | ||
INDEXER_PORT=8081 | ||
GEONETWORK_DB_TYPE=postgres | ||
GEONETWORK_DB_HOST=stefan-db-rds-primary-evaluation.gamma.aodn.org.au | ||
GEONETWORK_DB_PORT=5432 | ||
GEONETWORK_DB_NAME=geonetwork | ||
GEONETWORK_DB_USERNAME=geonetwork |
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,19 +1,4 @@ | ||
# general environment variables for Terragrunt | ||
ALB_PARAMETER_NAME=shared-alb-devops-sydney | ||
APP_HEALTH_CHECK="CMD-SHELL,uwsgi-is-ready --stats-socket /tmp/statsock > /dev/null 2>&1 || exit 1" | ||
APP_NAME=geonetwork4 | ||
AWS_ACCOUNT_ID=450356697252 | ||
AWS_REGION=ap-southeast-2 | ||
# variables required for GitHub Actions workflows | ||
ECR_REGISTRY=450356697252.dkr.ecr.ap-southeast-2.amazonaws.com | ||
ECR_REPOSITORY=geonetwork4 | ||
ENVIRONMENT=staging | ||
|
||
# container definition variables | ||
ES_HOST=ec2-3-25-64-248.ap-southeast-2.compute.amazonaws.com | ||
INDEXER_HOST=ec2-3-25-163-152.ap-southeast-2.compute.amazonaws.com | ||
INDEXER_PORT=8081 | ||
GEONETWORK_DB_TYPE=postgres | ||
GEONETWORK_DB_HOST=stefan-db-rds-primary-evaluation.gamma.aodn.org.au | ||
GEONETWORK_DB_PORT=5432 | ||
GEONETWORK_DB_NAME=geonetwork | ||
GEONETWORK_DB_USERNAME=geonetwork |
This file was deleted.
Oops, something went wrong.
Empty file.
Empty file.
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 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,64 +1,21 @@ | ||
#dependency "s3" { | ||
# config_path = "../s3" | ||
# skip_outputs = true | ||
#} | ||
locals { | ||
environment = try(yamldecode(file("../..//vars/${local.environment_name}/environment.yaml"))) | ||
environment_name = get_env("ENVIRONMENT") | ||
vars = try(yamldecode(file("../..//vars/${local.environment_name}/variables.yaml"))) | ||
} | ||
|
||
include "global" { | ||
path = "../global.hcl" | ||
expose = true | ||
path = "../global.hcl" | ||
} | ||
|
||
inputs = merge(local.override_vars, { | ||
app_name = get_env("APP_NAME") | ||
app_health_check = get_env("APP_HEALTH_CHECK", "") | ||
cluster_arn = get_env("CLUSTER_ARN", "") | ||
create_cluster = get_env("CREATE_CLUSTER", true) | ||
environment = local.global.environment | ||
|
||
# fetch the shared infrastructure parameter name | ||
alb_parameter_name = get_env("ALB_PARAMETER_NAME") | ||
|
||
# DNS hostnames to associate with the container | ||
app_hostnames = split(",", get_env("APP_HOSTNAMES", local.default_hostname)) | ||
|
||
# container-specific environment variables | ||
env_vars = local.env_vars | ||
inputs = merge(local.vars, { | ||
app_name = local.environment.app_name | ||
environment = local.environment_name | ||
|
||
ecr_registry = get_env("ECR_REGISTRY") | ||
ecr_repository = get_env("ECR_REPOSITORY") | ||
|
||
iam_statements = local.iam_statements | ||
}) | ||
|
||
locals { | ||
global = include.global.locals | ||
|
||
# container/task environment variables | ||
default_env_vars = { for tuple in regexall("(.*?)=(.*)", file("../../container/default.env")) : tuple[0] => tuple[1] } | ||
|
||
# get any overrides from the environment (e.g. GitHub deployment variables) | ||
override_env_vars = { | ||
for k, v in local.default_env_vars : | ||
k => can(get_env(k)) ? get_env(k) : v | ||
} | ||
|
||
# remove empty values from the override map | ||
env_vars = { | ||
for k, v in local.override_env_vars : k => v if v != "" | ||
} | ||
|
||
default_hostname = join("-", [get_env("APP_NAME"), local.global.environment]) | ||
|
||
iam_statements = try(yamldecode(templatefile("../..//iam_statements/${local.global.environment}.yaml.tftpl", | ||
{ | ||
aws_account = local.global.aws_account | ||
aws_region = local.global.aws_region | ||
environment = local.global.environment | ||
})), []) | ||
|
||
override_vars = try(yamldecode(file("../../tf_vars/${local.global.environment}/variables.yaml"))) | ||
} | ||
|
||
terraform { | ||
source = "../..//tf" | ||
} |
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 @@ | ||
app_name: geonetwork4 | ||
environment_name: development | ||
aws_account_id: 450356697252 | ||
aws_region: ap-southeast-2 |
Oops, something went wrong.