Skip to content

Commit

Permalink
update permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewpeng02 committed May 17, 2024
1 parent 139886f commit 753d8d6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
5 changes: 5 additions & 0 deletions dlp-terraform/ecs/ecs_django_service.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ resource "aws_iam_role" "django_ecs_task_role" {
}

data "aws_iam_policy_document" "django_inline_policy" {
statement {
actions = ["sqs:SendMessage", "sqs:GetQueueAttributes"]
resources = [aws_sqs_queue.training_queue.arn]
}

statement {
actions = ["secretsmanager:GetSecretValue"]
resources = ["arn:aws:secretsmanager:us-east-1:521654603461:secret:DLP/Firebase/Admin_SDK-8g8IDn"]
Expand Down
10 changes: 1 addition & 9 deletions dlp-terraform/ecs/ecs_training_service.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ resource "aws_iam_role" "training_ecs_task_role" {

data "aws_iam_policy_document" "training_inline_policy" {
statement {
actions = ["sqs:ReceiveMessage"]
actions = ["sqs:ReceiveMessage", "sqs:GetQueueAttributes", "sqs:ChangeMessageVisibility"]
resources = [aws_sqs_queue.training_queue.arn]
}

Expand Down Expand Up @@ -72,14 +72,6 @@ resource "aws_ecs_service" "training" {
lifecycle {
ignore_changes = [desired_count]
}

# load_balancer {
# target_group_arn = aws_lb_target_group.app.arn
# container_name = "training"
# container_port = 8000
# }

# depends_on = [aws_lb_target_group.app]
}

# --- ECS Service Auto Scaling ---
Expand Down
2 changes: 1 addition & 1 deletion frontend/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const nextConfig = {
source: "/api/training/:path*",
destination:
process.env.ENVIRONMENT === "production"
? "http://alb-785155211.us-east-1.elb.amazonaws.com/api/:path*" // note, this url changes every time you destroy/apply Terraform
? "http://alb-1805434018.us-east-1.elb.amazonaws.com/api/:path*" // note, this url changes every time you destroy/apply Terraform
: "http://127.0.0.1:8000/api/:path*",
},
],
Expand Down

0 comments on commit 753d8d6

Please sign in to comment.