From 0f402752f0bfd77cbafbf9af2b8b0f7b6cf33624 Mon Sep 17 00:00:00 2001 From: Michael Brennan Date: Mon, 10 Jun 2024 11:29:32 -0400 Subject: [PATCH] redis changes --- backend/{Dockerfile.server => Dockerfile} | 0 config/.env.template | 5 -- deployment/.gitignore | 1 - deployment/.terraform.lock.hcl | 24 ------- deployment/docker-composes/redis.yml | 72 ------------------- .../opensearch.yml | 0 .../docker/redis}/Dockerfile.redis | 0 deployment/docker/redis/redis.yml | 34 +++++++++ .../{docker-composes => docker}/webserver.yml | 0 deployment/main.tf | 53 -------------- deployment/packer/docker-install.sh | 17 ----- deployment/packer/echo-test.pkr.hcl | 18 ----- deployment/packer/opensearch.pkr.hcl | 26 ------- deployment/packer/preamble.pkr.hcl | 12 ---- deployment/packer/redis.pkr.hcl | 26 ------- deployment/packer/webserver-init.sh | 7 -- deployment/packer/webserver.pkr.hcl | 18 ----- {backend => deployment}/redis_entrypoint.sh | 0 .../terraform-modules/go-server/init.sh | 16 ----- .../terraform-modules/go-server/main.tf | 29 -------- .../terraform-modules/go-server/outputs.tf | 0 .../terraform-modules/go-server/variables.tf | 10 --- .../terraform-modules/postgresql/main.tf | 26 ------- .../terraform-modules/postgresql/outputs.tf | 7 -- .../terraform-modules/postgresql/variables.tf | 34 --------- deployment/terraform-modules/s3/main.tf | 45 ------------ deployment/terraform-modules/s3/outputs.tf | 14 ---- deployment/terraform-modules/s3/variables.tf | 10 --- deployment/terraform-modules/vpc/main.tf | 53 -------------- deployment/terraform-modules/vpc/outputs.tf | 14 ---- deployment/terraform-modules/vpc/variables.tf | 23 ------ go.work.sum | 6 ++ 32 files changed, 40 insertions(+), 560 deletions(-) rename backend/{Dockerfile.server => Dockerfile} (100%) delete mode 100644 deployment/.gitignore delete mode 100644 deployment/.terraform.lock.hcl delete mode 100644 deployment/docker-composes/redis.yml rename deployment/{docker-composes => docker}/opensearch.yml (100%) rename {backend => deployment/docker/redis}/Dockerfile.redis (100%) create mode 100644 deployment/docker/redis/redis.yml rename deployment/{docker-composes => docker}/webserver.yml (100%) delete mode 100644 deployment/main.tf delete mode 100644 deployment/packer/docker-install.sh delete mode 100644 deployment/packer/echo-test.pkr.hcl delete mode 100644 deployment/packer/opensearch.pkr.hcl delete mode 100644 deployment/packer/preamble.pkr.hcl delete mode 100644 deployment/packer/redis.pkr.hcl delete mode 100644 deployment/packer/webserver-init.sh delete mode 100644 deployment/packer/webserver.pkr.hcl rename {backend => deployment}/redis_entrypoint.sh (100%) delete mode 100644 deployment/terraform-modules/go-server/init.sh delete mode 100644 deployment/terraform-modules/go-server/main.tf delete mode 100644 deployment/terraform-modules/go-server/outputs.tf delete mode 100644 deployment/terraform-modules/go-server/variables.tf delete mode 100644 deployment/terraform-modules/postgresql/main.tf delete mode 100644 deployment/terraform-modules/postgresql/outputs.tf delete mode 100644 deployment/terraform-modules/postgresql/variables.tf delete mode 100644 deployment/terraform-modules/s3/main.tf delete mode 100644 deployment/terraform-modules/s3/outputs.tf delete mode 100644 deployment/terraform-modules/s3/variables.tf delete mode 100644 deployment/terraform-modules/vpc/main.tf delete mode 100644 deployment/terraform-modules/vpc/outputs.tf delete mode 100644 deployment/terraform-modules/vpc/variables.tf diff --git a/backend/Dockerfile.server b/backend/Dockerfile similarity index 100% rename from backend/Dockerfile.server rename to backend/Dockerfile diff --git a/config/.env.template b/config/.env.template index b52428215..569f876c8 100644 --- a/config/.env.template +++ b/config/.env.template @@ -21,11 +21,6 @@ SAC_REDIS_LIMITER_HOST="127.0.0.1" SAC_REDIS_LIMITER_PORT="6381" SAC_REDIS_LIMITER_DB="0" -SAC_AWS_BUCKET_NAME="SAC_AWS_BUCKET_NAME" -SAC_AWS_ID="SAC_AWS_ID" -SAC_AWS_SECRET="SAC_AWS_SECRET" -SAC_AWS_REGION="SAC_AWS_REGION" - SAC_SUDO_PASSWORD="Password#!1" SAC_AWS_BUCKET_NAME="SAC_AWS_BUCKET_NAME" diff --git a/deployment/.gitignore b/deployment/.gitignore deleted file mode 100644 index 8b1a7baa3..000000000 --- a/deployment/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.terraform/ \ No newline at end of file diff --git a/deployment/.terraform.lock.hcl b/deployment/.terraform.lock.hcl deleted file mode 100644 index 301a19f01..000000000 --- a/deployment/.terraform.lock.hcl +++ /dev/null @@ -1,24 +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.52.0" - hashes = [ - "h1:eq0gJwYfLtMfcFpO0DOGSpMJDj9ZulFIXQhbJra6DeQ=", - "zh:22c4599d47cd59e5519c52afc528fa2aec43b4434f369870ee2806daa071449d", - "zh:3c2edc482662a654f84db4cd3f2cdd8f200147207d053d2e95082744b7814e6d", - "zh:57edc36f908c64de37e92a978f3d675604315a725268da936fcd1e270199db47", - "zh:79e7afd5fb161f2eb2b7f8e7fd5cbb7f56a2c64f141b56f511ec69337ad3e96b", - "zh:82c6ae9a7f971b6ee8c476b6eb7f1be9d24ddd183cbf025f52628084ddb3a5ae", - "zh:92faecc0a8f573f57f37d24415862380a40341eb13d66beb738dd0873899a58e", - "zh:963d3c0e1aa22c872cd96f04ceb41c388137b972f714efbde989221bf7f6f723", - "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425", - "zh:af6d3bb94aa8a84d740e3731d2379cc5e12aa48d5db0f7489c4639f3814a22d7", - "zh:b9f7aceeaf5daf71394eab9bf0f9f56fdc762cac90e4d62e63aa3fcdf6c1c127", - "zh:c3dcfc2569edae4f36b798c76da7f7633e7bf322505d447d7c370a56c2a30dd2", - "zh:c8abb21c5ceba857f0eaff9e531d781dc655f8cdfae1cf056066daae72546a7f", - "zh:d92004a6a2a770d2542fd9c01b685418ab8d7ab422cf2cdce35dde789bc8593c", - "zh:dc794660b1d6d8f26a917e0ffab1875aa75144736875efaa60f29c72bf02afbf", - "zh:df931c4905e35ae43d558f6cda15f05710a7a24ecbb94533f8822e7572126512", - ] -} diff --git a/deployment/docker-composes/redis.yml b/deployment/docker-composes/redis.yml deleted file mode 100644 index 20ee008dd..000000000 --- a/deployment/docker-composes/redis.yml +++ /dev/null @@ -1,72 +0,0 @@ -services: - redis-session: - build: - context: . - dockerfile: Dockerfile.redis - container_name: redis_session - ports: - - 6380:6379 - environment: - - REDIS_USERNAME=redis_session - - REDIS_PASSWORD=redis_session!#1 - - REDIS_DISABLE_DEFAULT_USER="true" - volumes: - - redis-session-data:/data - redis-limiter: - build: - context: . - dockerfile: Dockerfile.redis - container_name: redis_limiter - ports: - - 6381:6379 - environment: - - REDIS_USERNAME=redis_limiter - - REDIS_PASSWORD=redis_limiter!#1 - - REDIS_DISABLE_DEFAULT_USER="true" - volumes: - - redis-limiter-data:/data - - opensearch-node1: - image: opensearchproject/opensearch:latest - container_name: opensearch-node1 - environment: - - cluster.name=opensearch-cluster - - node.name=opensearch-node1 - - discovery.type=single-node - - bootstrap.memory_lock=true # along with the memlock settings below, disables swapping - - "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" # minimum and maximum Java heap size, recommend setting both to 50% of system RAM - - DISABLE_SECURITY_PLUGIN=true # - ulimits: - memlock: - soft: -1 - hard: -1 - nofile: - soft: 65536 # maximum number of open files for the OpenSearch user, set to at least 65536 on modern systems - hard: 65536 - volumes: - - opensearch-data1:/usr/share/opensearch/data - ports: - - 9200:9200 - - 9600:9600 # required for Performance Analyzer - networks: - - opensearch-net - opensearch-dashboards: - image: opensearchproject/opensearch-dashboards:latest - container_name: opensearch-dashboards - ports: - - 5601:5601 - expose: - - "5601" - environment: - OPENSEARCH_HOSTS: '["http://opensearch-node1:9200"]' - DISABLE_SECURITY_DASHBOARDS_PLUGIN: true - networks: - - opensearch-net - -volumes: - redis-session-data: - redis-limiter-data: - opensearch-data1: - -networks: - opensearch-net: diff --git a/deployment/docker-composes/opensearch.yml b/deployment/docker/opensearch.yml similarity index 100% rename from deployment/docker-composes/opensearch.yml rename to deployment/docker/opensearch.yml diff --git a/backend/Dockerfile.redis b/deployment/docker/redis/Dockerfile.redis similarity index 100% rename from backend/Dockerfile.redis rename to deployment/docker/redis/Dockerfile.redis diff --git a/deployment/docker/redis/redis.yml b/deployment/docker/redis/redis.yml new file mode 100644 index 000000000..f3c40ad47 --- /dev/null +++ b/deployment/docker/redis/redis.yml @@ -0,0 +1,34 @@ +services: + redis-session: + build: + context: . + dockerfile: Dockerfile.redis + container_name: redis_session + ports: + - 6380:6379 + environment: + - REDIS_USERNAME=${SAC_REDIS_SESSION_USERNAME} + - REDIS_PASSWORD=${SAC_REDIS_SESSION_PASSWORD} + - REDIS_DISABLE_DEFAULT_USER="true" + volumes: + - redis-session-data:/data + redis-limiter: + build: + context: . + dockerfile: Dockerfile.redis + container_name: redis_limiter + ports: + - 6381:6379 + environment: + - REDIS_USERNAME=${SAC_REDIS_LIMITER_USERNAME} + - REDIS_PASSWORD=${SAC_REDIS_LIMITER_PASSWORD} + - REDIS_DISABLE_DEFAULT_USER="true" + volumes: + - redis-limiter-data:/data +volumes: + redis-session-data: + redis-limiter-data: + opensearch-data1: + +networks: + opensearch-net: diff --git a/deployment/docker-composes/webserver.yml b/deployment/docker/webserver.yml similarity index 100% rename from deployment/docker-composes/webserver.yml rename to deployment/docker/webserver.yml diff --git a/deployment/main.tf b/deployment/main.tf deleted file mode 100644 index 4b33fd40b..000000000 --- a/deployment/main.tf +++ /dev/null @@ -1,53 +0,0 @@ -provider "aws" { - region = "us-east-1" -} - -terraform { - backend "s3" { - bucket = "terraform-state-sac-495a" - key = "global/s3/terraform.tfstate" - region = "us-east-1" - - dynamodb_table = "terraform-state-locks" - encrypt = true - } -} - -data "aws_secretsmanager_secret" "database-secrets" { - name = "prod/DatabaseSecrets" -} - -data "aws_secretsmanager_secret_version" "database-secrets-version" { - secret_id = data.aws_secretsmanager_secret.database-secrets.id -} - - -module "sac_vpc" { - source = "./terraform-modules/vpc/" -} - -module "sac_s3_bucket" { - source = "./terraform-modules/s3" - - bucket_name = "sac-s3-bucket-64cf" - user_name = "sac-s3-bucket-64cf-user" -} - -module "sac_postgresql" { - source = "./terraform-modules/postgresql" - - allocated_storage = 10 - engine = "postgres" - instance_class = "db.t2.micro" - name = "sac" - subnet_ids = module.sac_vpc.private_subnet_ids - - username = jsondecode(data.aws_secretsmanager_secret_version.database-secrets-version.secret_string)["SAC_DB_USERNAME"] - password = jsondecode(data.aws_secretsmanager_secret_version.database-secrets-version.secret_string)["SAC_DB_PASSWORD"] -} - -module "sac_goserver" { - source = "./terraform-modules/go-server" - - subnet_id = module.sac_vpc.public_subnet_id -} \ No newline at end of file diff --git a/deployment/packer/docker-install.sh b/deployment/packer/docker-install.sh deleted file mode 100644 index ea7cee331..000000000 --- a/deployment/packer/docker-install.sh +++ /dev/null @@ -1,17 +0,0 @@ -# Add Docker's official GPG key: -sudo apt-get -y update -sudo apt-get -y install ca-certificates curl -sudo install -m 0755 -d /etc/apt/keyrings -sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc -sudo chmod a+r /etc/apt/keyrings/docker.asc - -# Add the repository to Apt sources: -echo \ - "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ - $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ - sudo tee /etc/apt/sources.list.d/docker.list > /dev/null -sudo apt-get -y update - -sudo apt-get -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin - -sudo docker run hello-world \ No newline at end of file diff --git a/deployment/packer/echo-test.pkr.hcl b/deployment/packer/echo-test.pkr.hcl deleted file mode 100644 index 9637bcbb8..000000000 --- a/deployment/packer/echo-test.pkr.hcl +++ /dev/null @@ -1,18 +0,0 @@ -source "amazon-ebs" "echotest" { - ami_name = "echotest-image-${local.suffix}" - instance_type = "t2.micro" - region = "us-east-1" - source_ami = "ami-04b70fa74e45c3917" - ssh_username = "ubuntu" -} - -build { - name = "echotest-image-${local.suffix}" - sources = [ - "source.amazon-ebs.echotest" - ] - - provisioner "shell" { - script = "${path.root}/docker-install.sh" - } -} diff --git a/deployment/packer/opensearch.pkr.hcl b/deployment/packer/opensearch.pkr.hcl deleted file mode 100644 index 9517fe301..000000000 --- a/deployment/packer/opensearch.pkr.hcl +++ /dev/null @@ -1,26 +0,0 @@ -source "amazon-ebs" "opensearch" { - ami_name = "opensearch-image-${local.suffix}" - instance_type = "t2.micro" - region = "us-east-1" - source_ami = "ami-04b70fa74e45c3917" - ssh_username = "ubuntu" -} - -build { - name = "opensearch-image-${local.suffix}" - sources = [ - "source.amazon-ebs.opensearch" - ] - - provisioner "shell" { - script = "${path.root}/docker-install.sh" - } - - provisioner "shell" { - inline = [ - "cd ~", - "git clone -b prod-shenanigans https://github.com/GenerateNU/sac", - "mv sac/deployment/docker-composes/opensearch.yml ~/docker-compose.yml" - ] - } -} diff --git a/deployment/packer/preamble.pkr.hcl b/deployment/packer/preamble.pkr.hcl deleted file mode 100644 index 7c581e9bf..000000000 --- a/deployment/packer/preamble.pkr.hcl +++ /dev/null @@ -1,12 +0,0 @@ -packer { - required_plugins { - amazon = { - version = ">= 1.2.8" - source = "github.com/hashicorp/amazon" - } - } -} - -locals { - suffix = formatdate("YYYY-MM-DD-hhmmss", timestamp()) -} \ No newline at end of file diff --git a/deployment/packer/redis.pkr.hcl b/deployment/packer/redis.pkr.hcl deleted file mode 100644 index 05da0ed85..000000000 --- a/deployment/packer/redis.pkr.hcl +++ /dev/null @@ -1,26 +0,0 @@ -source "amazon-ebs" "redis" { - ami_name = "redis-image-${local.suffix}" - instance_type = "t2.micro" - region = "us-east-1" - source_ami = "ami-04b70fa74e45c3917" - ssh_username = "ubuntu" -} - -build { - name = "redis-image-${local.suffix}" - sources = [ - "source.amazon-ebs.redis" - ] - - provisioner "shell" { - script = "${path.root}/docker-install.sh" - } - - provisioner "shell" { - inline = [ - "cd ~", - "git clone -b prod-shenanigans https://github.com/GenerateNU/sac", - "mv sac/deployment/docker-composes/redis.yml ~/docker-compose.yml" - ] - } -} \ No newline at end of file diff --git a/deployment/packer/webserver-init.sh b/deployment/packer/webserver-init.sh deleted file mode 100644 index 333b9f1c7..000000000 --- a/deployment/packer/webserver-init.sh +++ /dev/null @@ -1,7 +0,0 @@ -cd ~ -wget -c https://go.dev/dl/go1.22.0.linux-amd64.tar.gz -sudo tar -C /usr/local/ -xzf go1.22.0.linux-amd64.tar.gz -git clone https://github.com/GenerateNU/sac -export PATH=$PATH:/usr/local/go/bin -cd sac/backend -/usr/local/go/bin/go build -o ~/webserver \ No newline at end of file diff --git a/deployment/packer/webserver.pkr.hcl b/deployment/packer/webserver.pkr.hcl deleted file mode 100644 index 28ccb876d..000000000 --- a/deployment/packer/webserver.pkr.hcl +++ /dev/null @@ -1,18 +0,0 @@ -source "amazon-ebs" "webserver" { - ami_name = "webserver-image-${local.suffix}" - instance_type = "t2.micro" - region = "us-east-1" - source_ami = "ami-04b70fa74e45c3917" - ssh_username = "ubuntu" -} - -build { - name = "webserver-image-${local.suffix}" - sources = [ - "source.amazon-ebs.webserver" - ] - - provisioner "shell" { - script = "${path.root}/webserver-init.sh" - } -} \ No newline at end of file diff --git a/backend/redis_entrypoint.sh b/deployment/redis_entrypoint.sh similarity index 100% rename from backend/redis_entrypoint.sh rename to deployment/redis_entrypoint.sh diff --git a/deployment/terraform-modules/go-server/init.sh b/deployment/terraform-modules/go-server/init.sh deleted file mode 100644 index a1fea8194..000000000 --- a/deployment/terraform-modules/go-server/init.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# Install docker -apt-get update -apt-get install -y cloud-utils apt-transport-https ca-certificates curl software-properties-common -curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - -add-apt-repository \ - "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ - $(lsb_release -cs) \ - stable" -apt-get update -apt-get install -y docker-ce -usermod -aG docker ubuntu - -# Install docker-compose -curl -L https://github.com/docker/compose/releases/download/1.21.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose -chmod +x /usr/local/bin/docker-compose \ No newline at end of file diff --git a/deployment/terraform-modules/go-server/main.tf b/deployment/terraform-modules/go-server/main.tf deleted file mode 100644 index 5c9c9a2af..000000000 --- a/deployment/terraform-modules/go-server/main.tf +++ /dev/null @@ -1,29 +0,0 @@ -resource "aws_launch_template" "this_template" { - image_id = "ami-00beae93a2d981137" - - instance_type = "t2.micro" - - user_data = base64encode(templatefile("${path.module}/init.sh", {})) - - lifecycle { - create_before_destroy = true - } -} - -resource "aws_autoscaling_group" "this_asg" { - min_size = 1 - max_size = 1 - - vpc_zone_identifier = [ var.subnet_id ] - - tag { - key = "Name" - value = "SAC Backend ASG" - propagate_at_launch = true - } - - launch_template { - id = aws_launch_template.this_template.id - version = "$Latest" - } -} \ No newline at end of file diff --git a/deployment/terraform-modules/go-server/outputs.tf b/deployment/terraform-modules/go-server/outputs.tf deleted file mode 100644 index e69de29bb..000000000 diff --git a/deployment/terraform-modules/go-server/variables.tf b/deployment/terraform-modules/go-server/variables.tf deleted file mode 100644 index d91716070..000000000 --- a/deployment/terraform-modules/go-server/variables.tf +++ /dev/null @@ -1,10 +0,0 @@ -variable "subnet_id" { - type = string - description = "ID of subnet to place EC2 in." -} - -variable "envvars" { - type = map(string) - default = {} -} - diff --git a/deployment/terraform-modules/postgresql/main.tf b/deployment/terraform-modules/postgresql/main.tf deleted file mode 100644 index ee707bc64..000000000 --- a/deployment/terraform-modules/postgresql/main.tf +++ /dev/null @@ -1,26 +0,0 @@ -resource "aws_db_instance" "this" { - allocated_storage = var.allocated_storage - engine = var.engine - instance_class = var.instance_class - username = var.username - password = var.password - db_name = var.name - multi_az = false - - skip_final_snapshot = true - - tags = { - Name = "${var.name} RDS instance" - } - - db_subnet_group_name = aws_db_subnet_group.this_subnet_group.name -} - -resource "aws_db_subnet_group" "this_subnet_group" { - name = "${var.name}-database-subnet-group" - subnet_ids = var.subnet_ids - - tags = { - Name = "${var.name} DB Subnet Group" - } -} \ No newline at end of file diff --git a/deployment/terraform-modules/postgresql/outputs.tf b/deployment/terraform-modules/postgresql/outputs.tf deleted file mode 100644 index 72ce8c2b1..000000000 --- a/deployment/terraform-modules/postgresql/outputs.tf +++ /dev/null @@ -1,7 +0,0 @@ -output "port" { - value = aws_db_instance.this.port -} - -output "host" { - value = aws_db_instance.this.address -} \ No newline at end of file diff --git a/deployment/terraform-modules/postgresql/variables.tf b/deployment/terraform-modules/postgresql/variables.tf deleted file mode 100644 index 8ef0fc3e2..000000000 --- a/deployment/terraform-modules/postgresql/variables.tf +++ /dev/null @@ -1,34 +0,0 @@ -variable "allocated_storage" { - type = number - description = "Memory allocated in GB for this database" -} - -variable "engine" { - type = string - description = "Choice of database engine" -} - -variable "username" { - type = string - description = "User name of main database user" -} - -variable "password" { - type = string - description = "Password of main database user" -} - -variable "name" { - type = string - description = "Name of main database" -} - -variable "instance_class" { - type = string - description = "Instance to provision for database" -} - -variable "subnet_ids" { - type = list(string) - description = "List of subnets this database should be added to" -} diff --git a/deployment/terraform-modules/s3/main.tf b/deployment/terraform-modules/s3/main.tf deleted file mode 100644 index fc71ad771..000000000 --- a/deployment/terraform-modules/s3/main.tf +++ /dev/null @@ -1,45 +0,0 @@ -resource "aws_s3_bucket" "this" { - tags = { - Name = "SAC - ${var.bucket_name}" - Environment = "prod" - } -} - -resource "aws_iam_user" "this_user" { - name = var.user_name - - tags = { - Name = "SAC S3 bucket - Access user" - } -} - -resource "aws_iam_access_key" "this_user_key" { - user = aws_iam_user.this_user.name -} - -resource "aws_s3_bucket_policy" "this_access_policy" { - bucket = aws_s3_bucket.this.id - policy = jsonencode({ - Version = "2012-10-17", - Statement = [ - { - Effect = "Allow", - Principal = { - AWS = "${aws_iam_user.this_user.arn}" - } - Action = [ - "s3:*" - ] - Resource = [ - "${aws_s3_bucket.this.arn}/*", - "${aws_s3_bucket.this.arn}" - ] - } - ] - }) -} - -resource "aws_iam_user_policy_attachment" "iam_policy" { - policy_arn = "arn:aws:iam::aws:policy/AmazonS3FullAccess" - user = aws_iam_user.this_user.name -} \ No newline at end of file diff --git a/deployment/terraform-modules/s3/outputs.tf b/deployment/terraform-modules/s3/outputs.tf deleted file mode 100644 index cb84483f9..000000000 --- a/deployment/terraform-modules/s3/outputs.tf +++ /dev/null @@ -1,14 +0,0 @@ -output "bucket_name" { - description = "Name of the deployed S3 bucket" - value = aws_s3_bucket.this.bucket -} - -output "iam_access_key" { - description = "Access key ID for the S3 bucket's IAM user" - value = aws_iam_access_key.this_user_key.id -} - -output "iam_secret_key" { - description = "Secret access key for the S3 bucket's IAM user" - value = aws_iam_access_key.this_user_key.secret -} diff --git a/deployment/terraform-modules/s3/variables.tf b/deployment/terraform-modules/s3/variables.tf deleted file mode 100644 index cea184128..000000000 --- a/deployment/terraform-modules/s3/variables.tf +++ /dev/null @@ -1,10 +0,0 @@ -variable "bucket_name" { - type = string - description = "Name for the S3 bucket" -} - -variable "user_name" { - type = string - description = "Name for the IAM user who has S3 permissions" -} - diff --git a/deployment/terraform-modules/vpc/main.tf b/deployment/terraform-modules/vpc/main.tf deleted file mode 100644 index 7b64b088b..000000000 --- a/deployment/terraform-modules/vpc/main.tf +++ /dev/null @@ -1,53 +0,0 @@ -resource "aws_vpc" "main" { - cidr_block = "10.0.0.0/16" - - tags = { - Name = var.vpc_name - } -} - -resource "aws_subnet" "public_subnet" { - vpc_id = aws_vpc.main.id - cidr_block = var.public_subnet_cidr - - tags = { - Name = "${var.vpc_name} Public Subnet" - } -} - -resource "aws_subnet" "private_subnets" { - count = length(var.private_subnet_cidrs) - vpc_id = aws_vpc.main.id - cidr_block = element(var.private_subnet_cidrs, count.index) - availability_zone = element(var.private_azs, count.index) - - tags = { - Name = "${var.vpc_name} Private Subnet ${count.index}" - } -} - -resource "aws_internet_gateway" "gw" { - vpc_id = aws_vpc.main.id - - tags = { - Name = "SAC VPC Internet Gateway" - } -} - -resource "aws_route_table" "public_subnet_route_table" { - vpc_id = aws_vpc.main.id - - route { - cidr_block = "0.0.0.0/0" - gateway_id = aws_internet_gateway.gw.id - } - - tags = { - Name = "Route Table for Public Subnet" - } -} - -resource "aws_route_table_association" "public_subnet_association" { - subnet_id = aws_subnet.public_subnet.id - route_table_id = aws_route_table.public_subnet_route_table.id -} \ No newline at end of file diff --git a/deployment/terraform-modules/vpc/outputs.tf b/deployment/terraform-modules/vpc/outputs.tf deleted file mode 100644 index ea4b61aee..000000000 --- a/deployment/terraform-modules/vpc/outputs.tf +++ /dev/null @@ -1,14 +0,0 @@ -output "vpc_id" { - value = aws_vpc.main.id - description = "ID of the VPC" -} - -output "public_subnet_id" { - value = aws_subnet.public_subnet.id - description = "ID of the VPC's public subnet" -} - -output "private_subnet_ids" { - value = aws_subnet.private_subnets[*].id - description = "IDs of the VPC's private subnets" -} \ No newline at end of file diff --git a/deployment/terraform-modules/vpc/variables.tf b/deployment/terraform-modules/vpc/variables.tf deleted file mode 100644 index 3852db2a1..000000000 --- a/deployment/terraform-modules/vpc/variables.tf +++ /dev/null @@ -1,23 +0,0 @@ -variable "vpc_name" { - description = "The name to use for the VPC" - type = string - default = "SAC VPC" -} - -variable "public_subnet_cidr" { - type = string - description = "Public Subnet CIDR value" - default = "10.0.1.0/24" -} - -variable "private_subnet_cidrs" { - type = list(string) - description = "Private Subnet CIDR values" - default = ["10.0.2.0/24", "10.0.3.0/24"] -} - -variable "private_azs" { - type = list(string) - description = "Availability Zones" - default = [ "us-east-1a", "us-east-1b" ] -} \ No newline at end of file diff --git a/go.work.sum b/go.work.sum index d98dc8c5b..16a0105eb 100644 --- a/go.work.sum +++ b/go.work.sum @@ -29,6 +29,8 @@ cloud.google.com/go/cloudtasks v1.12.4/go.mod h1:BEPu0Gtt2dU6FxZHNqqNdGqIG86qyWK cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= cloud.google.com/go/compute v1.23.1/go.mod h1:CqB3xpmPKKt3OJpW2ndFIXnA9A4xAy/F3Xp1ixncW78= +cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk= +cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI= cloud.google.com/go/contactcenterinsights v1.11.3/go.mod h1:HHX5wrz5LHVAwfI2smIotQG9x8Qd6gYilaHcLLLmNis= cloud.google.com/go/container v1.27.1/go.mod h1:b1A1gJeTBXVLQ6GGw9/9M4FG94BEGsqJ5+t4d/3N7O4= cloud.google.com/go/containeranalysis v0.11.3/go.mod h1:kMeST7yWFQMGjiG9K7Eov+fPNQcGhb8mXj/UcTiWw9U= @@ -275,6 +277,7 @@ github.com/golang-sql/sqlexp v0.1.0/go.mod h1:J4ad9Vo8ZCWQ2GMrC4UCQy1JpCbwU9m3EO github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= @@ -479,6 +482,7 @@ github.com/xdg-go/stringprep v1.0.3 h1:kdwGpVNwPFtjs98xCGkHjQtGKh86rDcRZN17QEMCO github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0= github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= gitlab.com/nyarla/go-crypt v0.0.0-20160106005555-d9a5dc2b789b h1:7gd+rd8P3bqcn/96gOZa3F5dpJr/vEiDQYlNb/y2uNs= @@ -580,6 +584,7 @@ google.golang.org/api v0.150.0/go.mod h1:ccy+MJ6nrYFgE3WgRx/AMXOxOmU8Q4hSa+jjibz google.golang.org/api v0.152.0/go.mod h1:3qNJX5eOmhiWYc67jRA/3GsDw97UFb5ivv7Y2PrriAY= google.golang.org/api v0.153.0 h1:N1AwGhielyKFaUqH07/ZSIQR3uNPcV7NVw0vj+j4iR4= google.golang.org/api v0.153.0/go.mod h1:3qNJX5eOmhiWYc67jRA/3GsDw97UFb5ivv7Y2PrriAY= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4= google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:CgAqfJo+Xmu0GwA0411Ht3OU3OntXwsGmrmjI8ioGXI= google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405/go.mod h1:3WDQMjmJk36UQhjQ89emUzb1mdaHcPeeAh4SCBKznB4= @@ -602,6 +607,7 @@ google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= lukechampine.com/frand v1.4.2/go.mod h1:4S/TM2ZgrKejMcKMbeLjISpJMO+/eZ1zu3vYX9dtj3s=