diff --git a/.github/workflows/deploy-development.yml b/.github/workflows/deploy-development.yml index 07756ad..c7a98cc 100644 --- a/.github/workflows/deploy-development.yml +++ b/.github/workflows/deploy-development.yml @@ -1,4 +1,4 @@ -name: Build, Test and Deploy Development +name: Build, Test and Push - Development on: workflow_dispatch: @@ -85,63 +85,3 @@ jobs: # platforms: linux/amd64,linux/arm64 push: true tags: ${{ vars.ECR_REGISTRY }}/${{ vars.ECR_REPOSITORY }}:${{ steps.set_image_tag.outputs.image_tag }} - - development_deploy: - runs-on: ubuntu-latest - environment: tf-development - env: - tf_version: '1.5.7' - tg_version: '0.54.0' - tg_dir: './deploy/tg' - needs: [build_test_push] - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - audience: sts.amazonaws.com - aws-region: ${{ vars.AWS_REGION }} - role-to-assume: ${{ secrets.AWS_ROLE_ARN }} - - - name: Push container environment file to S3 - run: aws s3 sync . $bucket_path --exclude "*" --include "$include.env" - working-directory: ./deploy/container - env: - bucket_path: ${{ vars.CONFIG_BUCKET_PATH }} - include: ${{ vars.ENVIRONMENT }} - - - name: Expose github variables to shell as environment variables - env: - VARS_CONTEXT: ${{ toJson(vars) }} - run: | - EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) - to_envs() { jq -r "to_entries[] | \"\(.key)<<$EOF\n\(.value)\n$EOF\n\""; } - echo "$VARS_CONTEXT" | to_envs >> $GITHUB_ENV - - - name: Terragrunt Plan - uses: gruntwork-io/terragrunt-action@v2 - with: - tf_version: ${{ env.tf_version }} - tg_version: ${{ env.tg_version }} - tg_dir: ${{ env.tg_dir }} - tg_command: 'run-all plan -out=tf.plan' - env: - TF_INPUT: 0 - TF_IN_AUTOMATION: true - # get the image digest from the build job with optional override from vars context - TF_VAR_image: ${{ needs.build_test_push.outputs.image_digest }} - - - name: Terragrunt Apply - uses: gruntwork-io/terragrunt-action@v2 - with: - tf_version: ${{ env.tf_version }} - tg_version: ${{ env.tg_version }} - tg_dir: ${{ env.tg_dir }} - tg_command: '--terragrunt-non-interactive --terragrunt-log-level info run-all apply -auto-approve tf.plan' - env: - TF_INPUT: 0 - TF_IN_AUTOMATION: true - # get the image digest from the build job with optional override from vars context - TF_VAR_image: ${{ needs.build_test_push.outputs.image_digest }} diff --git a/deploy/Dockerfile b/deploy/Dockerfile deleted file mode 100644 index 694ea53..0000000 --- a/deploy/Dockerfile +++ /dev/null @@ -1,26 +0,0 @@ -ARG TF_VERSION=1.5.7 - -FROM hashicorp/terraform:$TF_VERSION - -LABEL maintainer="devops@aodn.org.au" - -ARG TG_VERSION=0.54.0 -ARG USER_ID=1000 -ARG GROUP_ID=1000 -ARG USERNAME=appdeploy - -RUN wget https://github.com/gruntwork-io/terragrunt/releases/download/v${TG_VERSION}/terragrunt_linux_amd64 \ - && mv terragrunt_linux_amd64 terragrunt \ - && chmod +x terragrunt \ - && mv terragrunt /usr/local/bin/terragrunt - -RUN apk add --no-cache aws-cli - -RUN echo 'alias tf="terraform"' >> /etc/profile.d/custom_aliases.sh \ - && echo 'alias tg="terragrunt"' >> /etc/profile.d/custom_aliases.sh - -ENV ENV="/etc/profile" - -RUN adduser -D -u $USER_ID -h /home/$USERNAME $USERNAME - -USER $USERNAME:$USERNAME diff --git a/deploy/README.md b/deploy/README.md deleted file mode 100644 index 53fa71b..0000000 --- a/deploy/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# Deployments -Deployment of this application uses [Github Deployment Environments](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment). - -A successful deployment relies on the correct variables being defined in order to deploy to the correct AWS account etc. - -### Managing Environments -You can view the current environment settings by visiting https://github.com/aodn/sample-django-app/settings/environments. - -You can view the currently defined variables there or from the cli using: -```bash -gh variable list -R aodn/sample-django-app -e staging -``` - -### Updating Variables -Manually updating vars can be tedious and error-prone. Instead, you may define the variables you need as a .env file and push these values: -```bash -gh variable set -R aodn/sample-django-app -e staging -f staging.env -``` - -### Deploying From the CLI -The Terragrunt module for this application depends on variables being present and will fail if they are not. - -To test locally, you may want to populate these into your local environment using the following command: -```bash -set -a; source ./github/staging.env; set +a -terragrunt plan -terragrunt apply -``` - -### Using Docker -A Dockerfile is provided to simplify local deployment, removing the need to install the required binaries on the local system. - -N.B. The Dockerfile does assume a valid AWS CLI configuration. - -### Example deployment -Modify the environment variables in `dev.env`: -```text -ALB_PARAMETER_NAME=shared-alb-dev-sydney -APP_NAME=sample-django-app-mybranch -AWS_ACCOUNT_ID=123456789012 -AWS_REGION=ap-southeast-2 -ECR_PARAMETER_NAME=api -ECR_REGISTRY=123456789012.dkr.ecr.ap-southeast-2.amazonaws.com -ECR_REPOSITORY=api -ENVIRONMENT=mydev-stack -RDS_PARAMETER_NAME=db01/primary/development -``` - -```bash -export AWS_PROFILE=myprofile -cd deploy -docker-compose -f docker-compose.yml run terragrunt -``` - -On the container run the following: -```bash -set -a; source ./github/dev.env; set +a -TF_VAR_image=latest terragrunt plan -out=tf.plan -TF_VAR_image=latest terragrunt apply -auto-approve tf.plan -``` diff --git a/deploy/container/default.env b/deploy/container/default.env deleted file mode 100644 index 0314392..0000000 --- a/deploy/container/default.env +++ /dev/null @@ -1,14 +0,0 @@ -ES_HOST= -ES_PASSWORD= -ES_PORT=9200 -ES_PROTOCOL=https -ES_USERNAME= -INDEXER_APIKEY= -INDEXER_HOST= -INDEXER_PORT=8081 -GEONETWORK_DB_TYPE=postgres -GEONETWORK_DB_HOST=db -GEONETWORK_DB_PORT=5432 -GEONETWORK_DB_NAME=geonetwork -GEONETWORK_DB_USERNAME=geonetwork -GEONETWORK_DB_PASSWORD= diff --git a/deploy/container/development.env b/deploy/container/development.env deleted file mode 100644 index fc13985..0000000 --- a/deploy/container/development.env +++ /dev/null @@ -1,11 +0,0 @@ -ES_HOST=ec2-3-25-64-248.ap-southeast-2.compute.amazonaws.com -ES_PORT=9200 -ES_PROTOCOL=https -ES_USERNAME=elastic -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 diff --git a/deploy/container/production.env b/deploy/container/production.env deleted file mode 100644 index 2f3d038..0000000 --- a/deploy/container/production.env +++ /dev/null @@ -1,8 +0,0 @@ -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 diff --git a/deploy/container/staging.env b/deploy/container/staging.env deleted file mode 100644 index 2f3d038..0000000 --- a/deploy/container/staging.env +++ /dev/null @@ -1,8 +0,0 @@ -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 diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml deleted file mode 100644 index ebc90ea..0000000 --- a/deploy/docker-compose.yml +++ /dev/null @@ -1,18 +0,0 @@ -version: '3.7' - -services: - terragrunt: - build: - context: . - dockerfile: Dockerfile - args: - TF_VERSION: 1.5.7 - TG_VERSION: 0.54.0 - image: appdeploy:latest - volumes: - - .:/deploy - - ${HOME}/.aws:/home/appdeploy/.aws - working_dir: /deploy/tg - environment: - - AWS_PROFILE=${AWS_PROFILE} - entrypoint: ["sh"] diff --git a/deploy/github/development.env b/deploy/github/development.env deleted file mode 100644 index cd608b7..0000000 --- a/deploy/github/development.env +++ /dev/null @@ -1,4 +0,0 @@ -# variables required for GitHub Actions workflows -ECR_REGISTRY=450356697252.dkr.ecr.ap-southeast-2.amazonaws.com -ECR_REPOSITORY=geonetwork4 -ENVIRONMENT=development diff --git a/deploy/github/production.env b/deploy/github/production.env deleted file mode 100644 index 4429a02..0000000 --- a/deploy/github/production.env +++ /dev/null @@ -1,4 +0,0 @@ -# variables required for GitHub Actions workflows -ECR_REGISTRY=450356697252.dkr.ecr.ap-southeast-2.amazonaws.com -ECR_REPOSITORY=geonetwork4 -ENVIRONMENT=production diff --git a/deploy/github/staging.env b/deploy/github/staging.env deleted file mode 100644 index b80d7e4..0000000 --- a/deploy/github/staging.env +++ /dev/null @@ -1,4 +0,0 @@ -# variables required for GitHub Actions workflows -ECR_REGISTRY=450356697252.dkr.ecr.ap-southeast-2.amazonaws.com -ECR_REPOSITORY=geonetwork4 -ENVIRONMENT=staging diff --git a/deploy/tf/alb.tf b/deploy/tf/alb.tf deleted file mode 100644 index 63daccf..0000000 --- a/deploy/tf/alb.tf +++ /dev/null @@ -1,44 +0,0 @@ -resource "aws_lb_target_group" "app" { - name = "${var.app_name}-${var.environment}" - port = var.nginx_proxy ? var.proxy_port : var.app_port - protocol = "HTTP" - target_type = "ip" - vpc_id = local.vpc_id - - health_check { - enabled = true - path = var.health_check_path - healthy_threshold = var.healthy_threshold != null ? var.healthy_threshold : null - interval = var.interval != null ? var.interval : null - unhealthy_threshold = var.unhealthy_threshold != null ? var.unhealthy_threshold : null - } -} - -resource "aws_route53_record" "app" { - for_each = toset(var.app_hostnames) - zone_id = local.domain_zone_id - name = each.value - type = "A" - - alias { - name = local.alb_dns_name - zone_id = local.alb_zone_id - evaluate_target_health = true - } -} - -resource "aws_lb_listener_rule" "app_fgate" { - for_each = toset(var.app_hostnames) - listener_arn = local.alb_https_listener_arn - - action { - type = "forward" - target_group_arn = aws_lb_target_group.app.arn - } - - condition { - host_header { - values = [aws_route53_record.app[each.value].fqdn] - } - } -} diff --git a/deploy/tf/cluster.tf b/deploy/tf/cluster.tf deleted file mode 100644 index 3a7edaa..0000000 --- a/deploy/tf/cluster.tf +++ /dev/null @@ -1,26 +0,0 @@ -module "cluster" { - source = "terraform-aws-modules/ecs/aws//modules/cluster" - version = "~> 5.7.0" - - create = var.create_cluster ? true : false - - # Cluster Configuration - cluster_name = "${var.app_name}-${var.environment}" - cluster_configuration = { - name = "containerInsights" - value = "enabled" - } - create_task_exec_iam_role = true - fargate_capacity_providers = { - FARGATE = { - default_capacity_provider_strategy = { - weight = 50 - } - } - FARGATE_SPOT = { - default_capacity_provider_strategy = { - weight = 50 - } - } - } -} diff --git a/deploy/tf/get-parameters.tf b/deploy/tf/get-parameters.tf deleted file mode 100644 index d80de7c..0000000 --- a/deploy/tf/get-parameters.tf +++ /dev/null @@ -1,62 +0,0 @@ -locals { - # alb values - alb_dns_name = nonsensitive(data.aws_ssm_parameter.alb_dns_name.value) - alb_https_listener_arn = nonsensitive(data.aws_ssm_parameter.alb_https_listener_arn.value) - alb_zone_id = nonsensitive(data.aws_ssm_parameter.alb_zone_id.value) - - # core values - vpc_id = nonsensitive(data.aws_ssm_parameter.vpc_id.value) - vpc_cidr = nonsensitive(data.aws_ssm_parameter.vpc_cidr.value) - domain_name = nonsensitive(data.aws_ssm_parameter.zonename.value) - domain_zone_id = nonsensitive(data.aws_ssm_parameter.zoneid.value) - public_subnets = split(",", nonsensitive(data.aws_ssm_parameter.public_subnets.value)) - public_subnet_cidrs = nonsensitive(data.aws_ssm_parameter.public_subnet_cidrs.value) - private_subnets = split(",", nonsensitive(data.aws_ssm_parameter.private_subnets.value)) - private_subnet_cidrs = nonsensitive(data.aws_ssm_parameter.private_subnet_cidrs.value) -} - -# alb parameters -data "aws_ssm_parameter" "alb_dns_name" { - name = "/apps/alb/${var.alb_parameter_name}/alb_dns_name" -} - -data "aws_ssm_parameter" "alb_https_listener_arn" { - name = "/apps/alb/${var.alb_parameter_name}/alb_https_listener_arn" -} - -data "aws_ssm_parameter" "alb_zone_id" { - name = "/apps/alb/${var.alb_parameter_name}/alb_zone_id" -} - -# core parameters -data "aws_ssm_parameter" "vpc_id" { - name = "/core/vpc_id" -} - -data "aws_ssm_parameter" "vpc_cidr" { - name = "/core/vpc_cidr" -} - -data "aws_ssm_parameter" "public_subnets" { - name = "/core/subnets_public" -} - -data "aws_ssm_parameter" "public_subnet_cidrs" { - name = "/core/subnets_public_cidr" -} - -data "aws_ssm_parameter" "private_subnets" { - name = "/core/subnets_private" -} - -data "aws_ssm_parameter" "private_subnet_cidrs" { - name = "/core/subnets_private_cidr" -} - -data "aws_ssm_parameter" "zonename" { - name = "/core/zone_domain" -} - -data "aws_ssm_parameter" "zoneid" { - name = "/core/zone_id" -} diff --git a/deploy/tf/main.tf b/deploy/tf/main.tf deleted file mode 100644 index e69de29..0000000 diff --git a/deploy/tf/outputs.tf b/deploy/tf/outputs.tf deleted file mode 100644 index 20f61bb..0000000 --- a/deploy/tf/outputs.tf +++ /dev/null @@ -1,7 +0,0 @@ -output "cluster" { - value = module.cluster -} - -output "service" { - value = module.service -} diff --git a/deploy/tf/service.tf b/deploy/tf/service.tf deleted file mode 100644 index a661b97..0000000 --- a/deploy/tf/service.tf +++ /dev/null @@ -1,162 +0,0 @@ -locals { - container_definitions = ( - var.nginx_proxy ? - merge(local.app_container_definition, local.nginx_container_definition) : - local.app_container_definition - ) - - app_container_definition = { - app = { - name = var.app_container_name - image = ( - startswith(var.image, "sha256") ? - "${var.ecr_registry}/${var.ecr_repository}@${var.image}" : - "${var.ecr_registry}/${var.ecr_repository}:${var.image}" - ) - health_check = length(var.app_health_check) > 0 ? { - command = split(",", var.app_health_check) - } : {} - readonly_root_filesystem = false - essential = true - memory_reservation = 256 - environment = var.env_vars - environment_files = var.environment_files - port_mappings = [ - { - name = var.app_container_name - containerPort = var.app_port - hostPort = var.app_port - } - ] - mount_points = [ - { - readOnly = false - containerPath = "/vol/web" - sourceVolume = "static" - } - ] - secrets = var.container_secrets - } - } - - nginx_container_definition = { - nginx = { - name = "nginx" - image = "${var.ecr_registry}/nginx-proxy:latest" - health_check = { - command = ["CMD-SHELL", "curl -so /dev/null http://localhost/health || exit 1"] - } - readonly_root_filesystem = false - essential = true - memory_reservation = 256 - environment = [ - { name = "APP_HOST", value = "127.0.0.1" }, - { name = "APP_PORT", value = var.app_port }, - { name = "LISTEN_PORT", value = var.proxy_port } - ] - environment_files = [] - port_mappings = [ - { - name = "nginx" - containerPort = var.proxy_port - hostPort = var.proxy_port - } - ] - mount_points = [ - { - readOnly = false - containerPath = "/vol/static" - sourceVolume = "static" - } - ] - secrets = [] - } - } -} - -resource "null_resource" "cluster_arn_precondition_check" { - lifecycle { - precondition { - condition = (var.create_cluster == false && var.cluster_arn != "" || var.create_cluster && var.cluster_arn == "") - error_message = "The cluster ARN must be provided if 'create_cluster' is false. If you mean to have this module create the cluster, set 'create_cluster' to true." - } - } -} - -module "service" { - source = "terraform-aws-modules/ecs/aws//modules/service" - version = "~> 5.7.0" - - name = "${var.app_name}-${var.environment}" - cluster_arn = var.create_cluster ? module.cluster.arn : var.cluster_arn - capacity_provider_strategy = { - env_strategy = { - base = 0 - capacity_provider = var.environment == "production" ? "FARGATE" : "FARGATE_SPOT" - weight = 100 - } - } - - # allow ECS exec commands on containers (e.g. to get a shell session) - enable_execute_command = true - - # resources - cpu = var.cpu - memory = var.memory - - # do not force a new deployment unless the image digest has changed - force_new_deployment = false - - # wait for service to reach steady state - wait_for_steady_state = true - - # wait for the task to reach steady state - wait_until_stable = true - - # Container definition(s) - container_definitions = local.container_definitions - - deployment_circuit_breaker = { - enable = true - rollback = true - } - - load_balancer = { - service = { - target_group_arn = aws_lb_target_group.app.arn - container_name = var.nginx_proxy ? "nginx" : "app" - container_port = var.nginx_proxy ? var.proxy_port : var.app_port - } - } - - subnet_ids = local.private_subnets - - security_group_rules = { - ingress_vpc = { - type = "ingress" - from_port = var.nginx_proxy ? var.proxy_port : var.app_port - to_port = var.nginx_proxy ? var.proxy_port : var.app_port - protocol = "tcp" - cidr_blocks = [local.vpc_cidr] - } - egress_all = { - type = "egress" - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - } - - task_exec_iam_statements = var.task_exec_iam_statements - tasks_iam_role_statements = var.tasks_iam_role_statements - - timeouts = { - create = "10m" - update = "10m" - } - - volume = { - static = {} - } -} diff --git a/deploy/tf/variables.tf b/deploy/tf/variables.tf deleted file mode 100644 index bc7847d..0000000 --- a/deploy/tf/variables.tf +++ /dev/null @@ -1,158 +0,0 @@ -# ssm variables -variable "alb_parameter_name" { - description = "The parameter name to derive the ALB details from." - type = string -} - -# task exec role -variable "task_exec_iam_statements" { - description = "A map of IAM policy [statements](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document#statement) for custom permission usage" - type = any - default = {} -} - -# tasks role -variable "tasks_iam_role_statements" { - description = "A map of IAM policy [statements](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document#statement) for custom permission usage" - type = any - default = {} -} - -# container variables -variable "app_container_name" { - description = "The name of the primary application container" - type = string - default = "app" -} - -variable "app_health_check" { - description = "The health check command to run on the docker container." - type = string - default = "" -} - -variable "app_port" { - description = "The port to expose on the application container." - type = number - default = 9000 -} - -variable "container_secrets" { - description = "Map of environment variables and secrets to retrieve values from." - type = list(object({ - name = string - valueFrom = string - })) - default = null -} - -variable "cpu" { - description = "The CPU capacity to allocate to the task." - type = number - default = 512 -} - -variable "env_vars" { - description = "List of key/pair values to pass to the container definition." - type = list(object({ - value = string - type = string - })) - default = [] -} - -variable "environment_files" { - description = "A list of files containing the environment variables to pass to a container" - type = list(object({ - value = string - type = string - })) - default = [] -} - -variable "image" { - description = "The digest/tag of the docker image to pull from ECR" - type = string - default = "latest" -} - -variable "memory" { - description = "The CPU capacity to allocate to the task." - type = number - default = 1024 -} - -variable "nginx_proxy" { - description = "Whether or not to side-load an nginx container in the task definition" - type = bool - default = true -} - -variable "proxy_port" { - description = "The port to expose to the load balancer on the container" - type = number - default = 80 -} - -# general variables -variable "app_hostnames" { - description = "Hostnames to associate with the application" - type = list(string) -} - -variable "app_name" { - description = "The name of the application e.g. sample-django-app" - type = string -} - -variable "cluster_arn" { - description = "ARN of the existing cluster to deploy the service/tasks to." - type = string - default = "" -} - -variable "create_cluster" { - description = "Whether or not to create a separate cluster for this deployment. If false, the name of an existing cluster must be provided." - type = bool - default = true -} - -variable "ecr_registry" { - description = "The registry to pull docker images from." - type = string -} - -variable "ecr_repository" { - description = "The repository to pull the image from." - type = string -} - -variable "environment" { - description = "Environment name to prepend/append to resource names" - type = string -} - -# Target group health checks -variable "health_check_path" { - description = "The health check path for the ALB target group." - type = string - default = "/health" -} - -variable "healthy_threshold" { - description = "Number of consecutive health check successes required before considering a target healthy. The range is 2-10." - type = number - default = null -} - -variable "interval" { - description = "The amount of time in seconds between health checks." - type = number - default = null -} - -variable "unhealthy_threshold" { - description = "Number of consecutive health check failures required before considering a target unhealthy. The range is 2-10." - type = number - default = null -} diff --git a/deploy/tf/versions.tf b/deploy/tf/versions.tf deleted file mode 100644 index 91041e5..0000000 --- a/deploy/tf/versions.tf +++ /dev/null @@ -1,9 +0,0 @@ -terraform { - required_version = "~> 1.5.0" - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 5.12" - } - } -} diff --git a/deploy/tg/ecs/.terraform.lock.hcl b/deploy/tg/ecs/.terraform.lock.hcl deleted file mode 100644 index 92e9a1a..0000000 --- a/deploy/tg/ecs/.terraform.lock.hcl +++ /dev/null @@ -1,47 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/hashicorp/aws" { - version = "5.29.0" - constraints = ">= 4.9.0, >= 4.66.1, ~> 5.12" - hashes = [ - "h1:+4qYlyPaktjZTFP9UbpEaz55jfwWapdibViCPoRFf+s=", - "h1:6Wb/0B+dNeOBP5KXvlHOmZyX7O6CDEfR+MrbxWI3wfo=", - "h1:SyiKAX/D3ZE9My7P03DrRMf65pNnfSDQXPb0g11lCS0=", - "zh:0453c1c64e51cd7050ce46d9280a0195b9073592508077ebf1a1c45f7026f3f5", - "zh:3ee87d1a2870b61fdcc80f3f96b669dbcc8171aadb821bec0e1fa0e6fb9595b6", - "zh:423c0304eba345167cc37dcd300712f24f03fe4de8eecc15edb0d4f88b29ec79", - "zh:6816ce0ed702263297a8e02467bb712c509a9f6e4f132a152a10f1cc19191a81", - "zh:6feb8a0aedabd778216238e72273f5c2ee86d8841acc3fb3dc9d8014a2bbdc51", - "zh:709ccdc8b37f975d422e7955814671548887613931e234e06249da629b0f2f95", - "zh:76c55744020dbdafea25be634f8ac37c1e371f8c397f73bd89bc270d00ee0834", - "zh:7e48d6fc488b9dbe2fd4bebefa1b485d04da38b11a6799f8cba178173b7f8782", - "zh:951d7ef2adbfb96b1d3e9c4780b2ab4375caf9c6b522a2d023c02ff0698d8e2a", - "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425", - "zh:b0bf5974bc1a7d2ce3f3a9a31a8238ad15ad02211f1e84c54832541ec4bd5d10", - "zh:cc56d4ab9bcbee95f73dbe90f11d4ff7299b835dddf2b30cfda526a2cccd0f9f", - "zh:cfe3a4394f2f7044e03bb63f4fb9c691926607c6784417ac9c0724943da60d09", - "zh:d6f82e13f33f70de8df480287b5a961ced5606f041d1c589f706b112f68db890", - "zh:fb7be5bcff62d0ca9edd4a1bee4d2ed16e9428e3f9eff3ea4d898ecb234505a3", - ] -} - -provider "registry.terraform.io/hashicorp/null" { - version = "3.2.2" - hashes = [ - "h1:Gef5VGfobY5uokA5nV/zFvWeMNR2Pmq79DH94QnNZPM=", - "h1:IMVAUHKoydFrlPrl9OzasDnw/8ntZFerCC9iXw1rXQY=", - "zh:3248aae6a2198f3ec8394218d05bd5e42be59f43a3a7c0b71c66ec0df08b69e7", - "zh:32b1aaa1c3013d33c245493f4a65465eab9436b454d250102729321a44c8ab9a", - "zh:38eff7e470acb48f66380a73a5c7cdd76cc9b9c9ba9a7249c7991488abe22fe3", - "zh:4c2f1faee67af104f5f9e711c4574ff4d298afaa8a420680b0cb55d7bbc65606", - "zh:544b33b757c0b954dbb87db83a5ad921edd61f02f1dc86c6186a5ea86465b546", - "zh:696cf785090e1e8cf1587499516b0494f47413b43cb99877ad97f5d0de3dc539", - "zh:6e301f34757b5d265ae44467d95306d61bef5e41930be1365f5a8dcf80f59452", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:913a929070c819e59e94bb37a2a253c228f83921136ff4a7aa1a178c7cce5422", - "zh:aa9015926cd152425dbf86d1abdbc74bfe0e1ba3d26b3db35051d7b9ca9f72ae", - "zh:bb04798b016e1e1d49bcc76d62c53b56c88c63d6f2dfe38821afef17c416a0e1", - "zh:c23084e1b23577de22603cff752e59128d83cfecc2e6819edadd8cf7a10af11e", - ] -} diff --git a/deploy/tg/ecs/terragrunt.hcl b/deploy/tg/ecs/terragrunt.hcl deleted file mode 100644 index 1094f10..0000000 --- a/deploy/tg/ecs/terragrunt.hcl +++ /dev/null @@ -1,21 +0,0 @@ -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" -} - -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") -}) - -terraform { - source = "../..//tf" -} diff --git a/deploy/tg/global.hcl b/deploy/tg/global.hcl deleted file mode 100644 index ee0dab3..0000000 --- a/deploy/tg/global.hcl +++ /dev/null @@ -1,45 +0,0 @@ -locals { - environment = try(yamldecode(file("..//vars/${local.environment_name}/environment.yaml"))) - environment_name = get_env("ENVIRONMENT") - state_bucket = "tfstate-${local.environment.aws_account_id}-${local.environment.aws_region}" - state_key = "apps/${local.environment.app_name}/${local.environment_name}/${basename(get_terragrunt_dir())}.tfstate" -} - -generate "providers" { - path = "providers.tf" - if_exists = "overwrite_terragrunt" - contents = <