From 99bc6be5c9b9322719f0dfca0cecc4c8b513ca00 Mon Sep 17 00:00:00 2001 From: shockrah Date: Mon, 9 Jan 2023 18:21:26 -0800 Subject: [PATCH] Removing sample infra --- infra/alpha.tf | 71 ----------------------------- infra/cert.tf | 15 ------ infra/route53-project-athens-xyz.tf | 10 ---- 3 files changed, 96 deletions(-) delete mode 100644 infra/cert.tf diff --git a/infra/alpha.tf b/infra/alpha.tf index 255d740..7cf0a8d 100644 --- a/infra/alpha.tf +++ b/infra/alpha.tf @@ -2,9 +2,6 @@ # Essentially it is a cluster with services that we # choose to expose to the internet in one form or another - - - # Alpha cluster definition ########################### resource "aws_ecs_cluster" "alpha" { @@ -19,71 +16,3 @@ resource "aws_ecs_cluster" "alpha" { } } - -# Lewdlad Task Definition -# This is what the service will launch to actually provide the lewdlad service -############################################################################## -resource "aws_ecs_task_definition" "sample" { - family = "${var.athens_prefix}-sample" - - network_mode = "awsvpc" - requires_compatibilities = ["FARGATE"] - execution_role_arn = aws_iam_role.alpha_iam_role.arn - - cpu = 256 - memory = 512 - - container_definitions = jsonencode([ - { - name = "${var.athens_prefix}-sample-container" - image = "nginx" - cpu = 256 - memory = 512 - essential = true - portMappings = [ - { - containerPort = 80 - hostPort = 80 - } - ] - logConfiguration = { - logDriver = "awslogs" - options = { - awslogs-group = aws_cloudwatch_log_group.alpha.name - awslogs-region = "us-west-1" - awslogs-stream-prefix = "sample-container" - } - } - } - ]) - tags = { - Name = "${var.athens_prefix}-sample-task-def-container" - } -} - -# Service level definition -########################## -resource "aws_ecs_service" "sample" { - name = "${var.athens_prefix}-sample-service" - cluster = aws_ecs_cluster.alpha.id - task_definition = aws_ecs_task_definition.sample.arn - desired_count = 1 - launch_type = "FARGATE" - load_balancer { - target_group_arn = aws_lb_target_group.alpha_cluster.arn - container_name = "${var.athens_prefix}-sample-container" - container_port = 80 - } - - network_configuration { - assign_public_ip = true - subnets = [ - aws_subnet.delphi.id, - aws_subnet.crete_subnet.id - ] - security_groups = [ - aws_security_group.ecs_web_ingress.id, - aws_security_group.base_ecs.id - ] - } -} diff --git a/infra/cert.tf b/infra/cert.tf deleted file mode 100644 index b18761f..0000000 --- a/infra/cert.tf +++ /dev/null @@ -1,15 +0,0 @@ -# Here is the TLS cert that we create for the alpha cluster - -resource "aws_acm_certificate" "sample" { - domain_name = "*.project-athens.xyz" - validation_method = "DNS" - - lifecycle { - create_before_destroy = true - } -} - -resource "aws_acm_certificate_validation" "sample" { - certificate_arn = aws_acm_certificate.sample.arn - validation_record_fqdns = [ aws_route53_record.project-athens-record["2"].fqdn ] -} diff --git a/infra/route53-project-athens-xyz.tf b/infra/route53-project-athens-xyz.tf index 31cf342..f831f9d 100644 --- a/infra/route53-project-athens-xyz.tf +++ b/infra/route53-project-athens-xyz.tf @@ -31,16 +31,6 @@ locals { records = [ "ns-806.awsdns-36.net. awsdns-hostmaster.amazon.com. 1 7200 900 1209600 86400" ] - }, - { - name = tolist(aws_acm_certificate.sample.domain_validation_options)[0].resource_record_name - type = tolist(aws_acm_certificate.sample.domain_validation_options)[0].resource_record_type - records = [ tolist(aws_acm_certificate.sample.domain_validation_options)[0].resource_record_value ] - }, - { - name = "sample.project-athens.xyz" - type = "CNAME" - records = [ aws_lb.alpha.dns_name ] } ] }