Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/remove duplication #167

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion infra/ecr.tf
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ resource "aws_ecr_repository" "arango" {
}

resource "aws_ecr_repository" "sagemaker" {
name = "${var.prefix}-sagemaker"
name = "${var.prefix}-sagemaker"
}

resource "aws_vpc_endpoint" "ecr_dkr" {
Expand Down
2 changes: 1 addition & 1 deletion infra/ecs_main_arango.tf
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ resource "random_string" "aws_arangodb_root_password" {
resource "aws_backup_vault" "arango_backup_vault" {
count = var.arango_on ? 1 : 0 # TEMPORARY
# count = 1
name = "${var.prefix}-arangodb-backup-vault"
name = "${var.prefix}-arangodb-backup-vault"
}

resource "aws_backup_plan" "arango_backup_plan" {
Expand Down
6 changes: 3 additions & 3 deletions infra/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,9 @@ variable "s3_prefixes_for_external_role_copy" {
}

variable "sagemaker_example_inference_image" { default = "" }
variable "sagemaker_models_folder" {default = ""}
variable "hugging_face_model_image" {default = ""}
variable "sagemaker_default_bucket" {default = ""}
variable "sagemaker_models_folder" { default = "" }
variable "hugging_face_model_image" { default = "" }
variable "sagemaker_default_bucket" { default = "" }

locals {
admin_container_name = "jupyterhub-admin"
Expand Down
30 changes: 0 additions & 30 deletions infra/modules/sagemaker_endpoint/main.tf

This file was deleted.

14 changes: 0 additions & 14 deletions infra/modules/sagemaker_endpoint/outputs.tf

This file was deleted.

40 changes: 0 additions & 40 deletions infra/modules/sagemaker_endpoint/variables.tf

This file was deleted.

82 changes: 41 additions & 41 deletions infra/route_53.tf
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
data "aws_route53_zone" "aws_route53_zone" {
# provider = "aws.route53"
name = var.aws_route53_zone
name = var.aws_route53_zone
}

resource "aws_route53_record" "admin" {
# provider = "aws.route53"
zone_id = data.aws_route53_zone.aws_route53_zone.zone_id
name = var.admin_domain
type = "A"
zone_id = data.aws_route53_zone.aws_route53_zone.zone_id
name = var.admin_domain
type = "A"

alias {
name = aws_alb.admin.dns_name
Expand All @@ -22,9 +22,9 @@ resource "aws_route53_record" "admin" {

resource "aws_route53_record" "applications" {
# provider = "aws.route53"
zone_id = data.aws_route53_zone.aws_route53_zone.zone_id
name = "*.${var.admin_domain}"
type = "A"
zone_id = data.aws_route53_zone.aws_route53_zone.zone_id
name = "*.${var.admin_domain}"
type = "A"

alias {
name = aws_alb.admin.dns_name
Expand Down Expand Up @@ -53,9 +53,9 @@ resource "aws_acm_certificate_validation" "admin" {

resource "aws_route53_record" "healthcheck" {
# provider = "aws.route53"
zone_id = data.aws_route53_zone.aws_route53_zone.zone_id
name = var.healthcheck_domain
type = "A"
zone_id = data.aws_route53_zone.aws_route53_zone.zone_id
name = var.healthcheck_domain
type = "A"

alias {
name = aws_alb.healthcheck.dns_name
Expand Down Expand Up @@ -83,9 +83,9 @@ resource "aws_acm_certificate_validation" "healthcheck" {

resource "aws_route53_record" "prometheus" {
# provider = "aws.route53"
zone_id = data.aws_route53_zone.aws_route53_zone.zone_id
name = var.prometheus_domain
type = "A"
zone_id = data.aws_route53_zone.aws_route53_zone.zone_id
name = var.prometheus_domain
type = "A"

alias {
name = aws_alb.prometheus.dns_name
Expand All @@ -112,11 +112,11 @@ resource "aws_acm_certificate_validation" "prometheus" {
}

resource "aws_route53_record" "gitlab" {
count = var.gitlab_on ? 1 : 0
count = var.gitlab_on ? 1 : 0
# provider = "aws.route53"
zone_id = data.aws_route53_zone.aws_route53_zone.zone_id
name = var.gitlab_domain
type = "A"
zone_id = data.aws_route53_zone.aws_route53_zone.zone_id
name = var.gitlab_domain
type = "A"

alias {
name = aws_lb.gitlab[count.index].dns_name
Expand All @@ -130,11 +130,11 @@ resource "aws_route53_record" "gitlab" {
}

resource "aws_route53_record" "superset_internal" {
count = var.superset_on ? 1 : 0
count = var.superset_on ? 1 : 0
# provider = "aws.route53"
zone_id = data.aws_route53_zone.aws_route53_zone.zone_id
name = var.superset_internal_domain
type = "A"
zone_id = data.aws_route53_zone.aws_route53_zone.zone_id
name = var.superset_internal_domain
type = "A"

alias {
name = aws_lb.superset[count.index].dns_name
Expand All @@ -148,27 +148,27 @@ resource "aws_route53_record" "superset_internal" {
}

resource "aws_route53_record" "mlflow_internal" {
count = var.mlflow_on ? length(var.mlflow_instances) : 0
count = var.mlflow_on ? length(var.mlflow_instances) : 0
# provider = "aws.route53"
zone_id = data.aws_route53_zone.aws_route53_zone.zone_id
name = "mlflow--${var.mlflow_instances_long[count.index]}--internal.${var.admin_domain}"
type = "A"
ttl = "60"
records = [aws_lb.mlflow.*.subnet_mapping[count.index].*.private_ipv4_address[0]]
zone_id = data.aws_route53_zone.aws_route53_zone.zone_id
name = "mlflow--${var.mlflow_instances_long[count.index]}--internal.${var.admin_domain}"
type = "A"
ttl = "60"
records = [aws_lb.mlflow.*.subnet_mapping[count.index].*.private_ipv4_address[0]]

lifecycle {
create_before_destroy = true
}
}

resource "aws_route53_record" "mlflow_data_flow" {
count = var.mlflow_on ? length(var.mlflow_instances) : 0
count = var.mlflow_on ? length(var.mlflow_instances) : 0
# provider = "aws.route53"
zone_id = data.aws_route53_zone.aws_route53_zone.zone_id
name = "mlflow--${var.mlflow_instances_long[count.index]}--data-flow.${var.admin_domain}"
type = "A"
ttl = "60"
records = [aws_lb.mlflow_dataflow.*.subnet_mapping[count.index].*.private_ipv4_address[0]]
zone_id = data.aws_route53_zone.aws_route53_zone.zone_id
name = "mlflow--${var.mlflow_instances_long[count.index]}--data-flow.${var.admin_domain}"
type = "A"
ttl = "60"
records = [aws_lb.mlflow_dataflow.*.subnet_mapping[count.index].*.private_ipv4_address[0]]

lifecycle {
create_before_destroy = true
Expand All @@ -191,11 +191,11 @@ resource "aws_acm_certificate_validation" "superset_internal" {
}

resource "aws_route53_record" "arango" {
count = var.arango_on ? 1 : 0
count = var.arango_on ? 1 : 0
# provider = "aws.route53"
zone_id = data.aws_route53_zone.aws_route53_zone.zone_id
name = "arango.${var.admin_domain}"
type = "A"
zone_id = data.aws_route53_zone.aws_route53_zone.zone_id
name = "arango.${var.admin_domain}"
type = "A"

alias {
name = aws_lb.arango[0].dns_name
Expand All @@ -209,11 +209,11 @@ resource "aws_route53_record" "arango" {
}

resource "aws_route53_record" "airflow_webserver" {
count = var.airflow_on ? 1 : 0
count = var.airflow_on ? 1 : 0
# provider = aws.route53
zone_id = data.aws_route53_zone.aws_route53_zone.zone_id
name = var.airflow_domain
type = "A"
zone_id = data.aws_route53_zone.aws_route53_zone.zone_id
name = var.airflow_domain
type = "A"

alias {
name = aws_lb.airflow_webserver[count.index].dns_name
Expand Down
16 changes: 8 additions & 8 deletions infra/sagemaker.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ module "sagemaker_domain" {

# IAM Roles and Policies for SageMaker
module "iam" {
source = "./modules/sagemaker_init/iam"
prefix = var.prefix
sagemaker_default_bucket_name = "${var.sagemaker_default_bucket}"
aws_s3_bucket_notebook = aws_s3_bucket.notebooks
source = "./modules/sagemaker_init/iam"
prefix = var.prefix
sagemaker_default_bucket_name = var.sagemaker_default_bucket
aws_s3_bucket_notebook = aws_s3_bucket.notebooks
}


Expand Down Expand Up @@ -41,8 +41,8 @@ resource "aws_security_group" "notebooks_endpoints" {
resource "aws_security_group_rule" "notebooks_endpoint_ingress_sagemaker" {
description = "endpoint-ingress-from-datasets-vpc"

security_group_id = aws_security_group.notebooks_endpoints.id
cidr_blocks = [aws_vpc.notebooks.cidr_block]
security_group_id = aws_security_group.notebooks_endpoints.id
cidr_blocks = [aws_vpc.notebooks.cidr_block]

type = "ingress"
from_port = "0"
Expand All @@ -53,8 +53,8 @@ resource "aws_security_group_rule" "notebooks_endpoint_ingress_sagemaker" {
resource "aws_security_group_rule" "notebooks_endpoint_egress_sagemaker" {
description = "endpoint-ingress-from-datasets-vpc"

security_group_id = aws_security_group.notebooks_endpoints.id
cidr_blocks = [aws_vpc.notebooks.cidr_block]
security_group_id = aws_security_group.notebooks_endpoints.id
cidr_blocks = [aws_vpc.notebooks.cidr_block]

type = "egress"
from_port = "0"
Expand Down
Loading