Skip to content

Commit

Permalink
ignore conversion/
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Jan 26, 2024
1 parent db906fb commit 8cccccf
Show file tree
Hide file tree
Showing 6 changed files with 141 additions and 0 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ repos:
exclude: common/*.tf
exclude: version.tf
exclude: examples
exclude: conversion
args:
- --args=--config .terraform-docs.yml
# - id: terraform_tflint
Expand Down
File renamed without changes.
25 changes: 25 additions & 0 deletions conversion/ecs/certs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## module "cert" {
## source = "git@github.e.it.census.gov:terraform-modules/aws-tls-certificate?ref=tf-upgrade"
##
## certificate_cn = local.app_alb_dns_name
## certificate_download = local.app_cert_download
##
## tags = merge(
## local.base_tags,
## #local.common_tags,
## #var.application_tags,
## )
## }

module "cert" {
source = "git@github.e.it.census.gov:terraform-modules/aws-certificates//acm"

certificate_dns = local.app_alb_dns_name
contact_email = local.app_cert_contact_email

tags = merge(
local.base_tags,
local.common_tags,
var.application_tags,
)
}
84 changes: 84 additions & 0 deletions conversion/ecs/load-balancer.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
resource "aws_lb_target_group" "app" {
name = local.app_albtg_name
port = local.app_lb_port
protocol = "HTTP"
vpc_id = local.vpc_id
target_type = "ip"

# stickiness {
# type = "lb_cookie"
# cookie_duration = 3600
# enabled = true
# }

health_check {
enabled = true
interval = 6
port = local.app_lb_port
timeout = 5
protocol = "HTTP"
path = local.app_lb_health_monitor_path
healthy_threshold = 3
unhealthy_threshold = 3
matcher = "200"
}

tags = merge(
local.base_tags,
#local.common_tags,
#var.application_tags,
{ "Name" = local.app_albtg_name },
)
}

resource "aws_lb" "app" {
name = local.app_alb_name
internal = true
load_balancer_type = "application"
security_groups = [local.sg_web_id]
subnets = local.lb_subnet_ids
enable_deletion_protection = true
idle_timeout = 300

access_logs {
bucket = data.terraform_remote_state.infrastructure_east.outputs.logs_id
prefix = "alb-logs/${local.app_alb_dns_name}"
enabled = true
}

tags = merge(
local.base_tags,
#local.common_tags,
#var.application_tags,
{ "Name" = local.app_alb_name },
)
}

resource "aws_lb_listener" "app_80_redirect" {
load_balancer_arn = aws_lb.app.arn
port = 80
protocol = "HTTP"

default_action {
type = "redirect"

redirect {
port = "443"
protocol = "HTTPS"
status_code = "HTTP_301"
}
}
}

resource "aws_lb_listener" "app_443" {
load_balancer_arn = aws_lb.app.arn
port = 443
protocol = "HTTPS"
ssl_policy = "ELBSecurityPolicy-TLS-1-2-2017-01"
certificate_arn = module.cert.certificate_arn

default_action {
type = "forward"
target_group_arn = aws_lb_target_group.app.arn
}
}
4 changes: 4 additions & 0 deletions conversion/ecs/settings.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# add/update

app_cert_download = false
app_cert_contact_email = "{group-email-address}"
27 changes: 27 additions & 0 deletions conversion/ecs/tf-run.data
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
VERSION 2.0.0
REMOTE-STATE
COMMAND tf-directory-setup.py -l none -f
COMMAND setup-new-directory.sh

TAG links
# COMMAND ln -sf ../../../../../../common/apps/dice-mojo/remote_state.common_apps_dice-mojo.tf .
LINKTOP common/apps/dice-mojo/remote_state.common_apps_dice-mojo.tf
LINKTOP includes.d/variables.account_tags.tf
LINKTOP includes.d/variables.account_tags.auto.tfvars
LINKTOP includes.d/variables.infrastructure_tags.tf
LINKTOP includes.d/variables.infrastructure_tags.auto.tfvars
LINKTOP includes.d/variables.application_tags.tf
## LINKTOP includes.d/variables.application_tags.auto.tfvars
LINKTOP provider_configs.d/provider.ldap_new.auto.tfvars
LINKTOP provider_configs.d/provider.ldap_new.tf
LINKTOP provider_configs.d/provider.ldap_new.variables.tf
COMMAND rm -f provider.ldap.*

TAG init
COMMAND tf-init -upgrade

TAG start
ALL

TAG state-link
COMMAND tf-directory-setup.py -l s3

0 comments on commit 8cccccf

Please sign in to comment.