Skip to content

Commit

Permalink
remove features api
Browse files Browse the repository at this point in the history
  • Loading branch information
smohiudd committed Dec 15, 2023
1 parent 4e1bdcc commit 9af5df1
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 59 deletions.
2 changes: 1 addition & 1 deletion infrastructure/custom_policies/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ data "aws_iam_policy_document" "mwaa_executor_policies" {
]
resources = [
"arn:aws:secretsmanager:${var.region}:${var.account_id}:secret:${var.cognito_app_secret}-??????",
"arn:aws:secretsmanager:${var.region}:${var.account_id}:secret:${var.vector_secret_name}-??????"
# "arn:aws:secretsmanager:${var.region}:${var.account_id}:secret:${var.vector_secret_name}-??????"
]
}

Expand Down
6 changes: 3 additions & 3 deletions infrastructure/custom_policies/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ variable "assume_role_arns" {
variable "cognito_app_secret" {
type = string
}
variable "vector_secret_name" {
type = string
}
# variable "vector_secret_name" {
# type = string
# }
24 changes: 12 additions & 12 deletions infrastructure/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ module "mwaa" {
ecs_container_folder_path = "${path.module}/../docker_tasks/cogify_transfer"
ecr_repo_name = "${var.prefix}-veda-cogify_transfer"
},
{
handler_file_path = "${path.module}/../docker_tasks/vector_ingest/handler.py"
docker_file_path = "${path.module}/../docker_tasks/vector_ingest/Dockerfile"
ecs_container_folder_path = "${path.module}/../docker_tasks/vector_ingest"
ecr_repo_name = "${var.prefix}-veda-vector_ingest"
}
# {
# handler_file_path = "${path.module}/../docker_tasks/vector_ingest/handler.py"
# docker_file_path = "${path.module}/../docker_tasks/vector_ingest/Dockerfile"
# ecs_container_folder_path = "${path.module}/../docker_tasks/vector_ingest"
# ecr_repo_name = "${var.prefix}-veda-vector_ingest"
# }
]
}

Expand All @@ -42,7 +42,7 @@ module "custom_policy" {
assume_role_arns = var.assume_role_arns
region = local.aws_region
cognito_app_secret = var.cognito_app_secret
vector_secret_name = var.vector_secret_name
# vector_secret_name = var.vector_secret_name
}


Expand Down Expand Up @@ -97,11 +97,11 @@ resource "local_file" "mwaa_variables" {
stac_ingestor_api_url = var.stac_ingestor_api_url
assume_role_read_arn = var.assume_role_arns[0]
assume_role_write_arn = var.assume_role_arns[1]
vector_secret_name = var.vector_secret_name
vector_subnet_1 = data.aws_subnets.private.ids[0]
vector_subnet_2 = data.aws_subnets.private.ids[1]
vector_security_group = aws_security_group.vector_sg.id
vector_vpc = var.vector_vpc
# vector_secret_name = var.vector_secret_name
# vector_subnet_1 = data.aws_subnets.private.ids[0]
# vector_subnet_2 = data.aws_subnets.private.ids[1]
# vector_security_group = aws_security_group.vector_sg.id
# vector_vpc = var.vector_vpc
})
filename = "/tmp/mwaa_vars.json"
}
7 changes: 1 addition & 6 deletions infrastructure/mwaa_environment_variables.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,5 @@
"ASSUME_ROLE_READ_ARN": "${assume_role_read_arn}",
"ASSUME_ROLE_WRITE_ARN": "${assume_role_write_arn}",
"COGNITO_APP_SECRET": "${cognito_app_secret}",
"STAC_INGESTOR_API_URL": "${stac_ingestor_api_url}",
"VECTOR_SECRET_NAME": "${vector_secret_name}",
"VECTOR_ECS_CONF":{
"VECTOR_SECURITY_GROUP": ["${vector_security_group}"],
"VECTOR_SUBNETS": ["${vector_subnet_1}", "${vector_subnet_2}"]
}
"STAC_INGESTOR_API_URL": "${stac_ingestor_api_url}"
}
56 changes: 28 additions & 28 deletions infrastructure/task_definition.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,31 +28,31 @@ resource "aws_ecs_task_definition" "veda_task_definition" {
}


resource "aws_ecs_task_definition" "veda_vector_task_definition" {


container_definitions = jsonencode([

{
name = "${var.prefix}-veda-vector_ingest"
image = "${local.account_id}.dkr.ecr.${local.aws_region}.amazonaws.com/${var.prefix}-veda-vector_ingest"
essential = true,
logConfiguration = {
"logDriver" : "awslogs",
"options" : {
"awslogs-group" : module.mwaa.log_group_name,
"awslogs-region" : local.aws_region,
"awslogs-stream-prefix" : "ecs"
}
}
}

])
family = "${var.prefix}-vector-tasks"
requires_compatibilities = ["FARGATE"]
network_mode = "awsvpc"
execution_role_arn = module.mwaa.mwaa_role_arn
task_role_arn = module.mwaa.mwaa_role_arn
cpu = 2048
memory = 4096
}
# resource "aws_ecs_task_definition" "veda_vector_task_definition" {


# container_definitions = jsonencode([

# {
# name = "${var.prefix}-veda-vector_ingest"
# image = "${local.account_id}.dkr.ecr.${local.aws_region}.amazonaws.com/${var.prefix}-veda-vector_ingest"
# essential = true,
# logConfiguration = {
# "logDriver" : "awslogs",
# "options" : {
# "awslogs-group" : module.mwaa.log_group_name,
# "awslogs-region" : local.aws_region,
# "awslogs-stream-prefix" : "ecs"
# }
# }
# }

# ])
# family = "${var.prefix}-vector-tasks"
# requires_compatibilities = ["FARGATE"]
# network_mode = "awsvpc"
# execution_role_arn = module.mwaa.mwaa_role_arn
# task_role_arn = module.mwaa.mwaa_role_arn
# cpu = 2048
# memory = 4096
# }
18 changes: 9 additions & 9 deletions infrastructure/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ variable "min_workers" {
production = 3
}
}
variable "vector_secret_name" {
type = string
}
variable "vector_security_group" {
type = string
}
variable "vector_vpc" {
type = string
}
# variable "vector_secret_name" {
# type = string
# }
# variable "vector_security_group" {
# type = string
# }
# variable "vector_vpc" {
# type = string
# }

0 comments on commit 9af5df1

Please sign in to comment.