Skip to content

Commit e288f0b

Browse files
authored
Update main to match reality of recent infra changes (#181)
* update to reflect reality - pybot prod is temporarily in our ECS cluster Signed-off-by: Irving Popovetsky <[email protected]> * TF module lock bump Signed-off-by: Irving Popovetsky <[email protected]> * Rollout new cert and update the https security policy Signed-off-by: Irving Popovetsky <[email protected]> --------- Signed-off-by: Irving Popovetsky <[email protected]>
1 parent 1bc6c80 commit e288f0b

File tree

5 files changed

+43
-12
lines changed

5 files changed

+43
-12
lines changed

terraform/.terraform.lock.hcl

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

terraform/alb.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ resource "aws_lb_listener" "default_https" {
6969
load_balancer_arn = aws_lb.ecs.arn
7070
protocol = "HTTPS"
7171
port = 443
72-
certificate_arn = "arn:aws:acm:us-east-2:633607774026:certificate/8de9fd02-191c-485f-b952-e5ba32e90acb"
73-
ssl_policy = "ELBSecurityPolicy-TLS-1-2-2017-01"
72+
certificate_arn = "arn:aws:acm:us-east-2:633607774026:certificate/cebe8639-6144-409d-b384-c0b4b4880898"
73+
ssl_policy = "ELBSecurityPolicy-TLS13-1-2-2021-06"
7474

7575
default_action {
7676
type = "fixed-response"

terraform/apps.tf

+33
Original file line numberDiff line numberDiff line change
@@ -189,3 +189,36 @@ resource "aws_lb_listener_rule" "shutdown_sites_redirector" {
189189
# }
190190
# }
191191
# }
192+
193+
# Pybot Prod
194+
module "pybot_prod" {
195+
source = "./pybot"
196+
197+
env = "prod"
198+
vpc_id = data.aws_vpc.use2.id
199+
logs_group = aws_cloudwatch_log_group.ecslogs.name
200+
ecs_cluster_id = module.ecs.cluster_id
201+
task_execution_role = data.aws_iam_role.ecs_task_execution_role.arn
202+
image_tag = "master"
203+
}
204+
205+
resource "aws_lb_listener_rule" "pybot_prod" {
206+
listener_arn = aws_lb_listener.default_https.arn
207+
208+
action {
209+
type = "forward"
210+
target_group_arn = module.pybot_prod.lb_tg_arn
211+
}
212+
213+
condition {
214+
host_header {
215+
values = ["pybot.operationcode.org"]
216+
}
217+
}
218+
219+
condition {
220+
path_pattern {
221+
values = ["/slack/*", "/pybot/*", "/airtable/*"]
222+
}
223+
}
224+
}

terraform/asg.tf

+3
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ module "autoscaling" {
6464
# Required for managed_termination_protection = "ENABLED"
6565
protect_from_scale_in = false
6666

67+
# reduce cloudwatch costs
68+
enable_monitoring = false
69+
6770
tags = local.tags
6871
}
6972

terraform/ecs.tf

+4-10
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,10 @@ module "ecs" {
3535

3636
cluster_name = local.name
3737

38-
cluster_configuration = {
39-
execute_command_configuration = {
40-
# logging = "OVERRIDE"
41-
# log_configuration = {
42-
# # You can set a simple string and ECS will create the CloudWatch log group for you
43-
# # or you can create the resource yourself as shown here to better manage retetion, tagging, etc.
44-
# # Embedding it into the module is not trivial and therefore it is externalized
45-
# cloud_watch_log_group_name = aws_cloudwatch_log_group.this.name
46-
# }
47-
}
38+
# disable container insights to save a bit of money
39+
cluster_settings = {
40+
name = "containerInsights"
41+
value = "disabled"
4842
}
4943

5044
default_capacity_provider_use_fargate = false

0 commit comments

Comments
 (0)