Skip to content

Commit

Permalink
Fix index error with resources
Browse files Browse the repository at this point in the history
  • Loading branch information
dorukozturk committed Dec 8, 2023
1 parent 1a8b121 commit 7e123a3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ai-ml/jupyterhub/cognito.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ resource "aws_iam_role" "iam_for_lambda" {

resource "aws_iam_role_policy_attachment" "lambda_policy_attachment" {
count = var.jupyter_hub_auth_mechanism == "cognito" ? 1 : 0
role = aws_iam_role.iam_for_lambda.name
role = aws_iam_role.iam_for_lambda[0].name
policy_arn = data.aws_iam_policy.lambda_execution_policy.arn
}

Expand Down Expand Up @@ -60,7 +60,7 @@ resource "aws_lambda_function" "pretoken_trigger" {
runtime = "nodejs18.x"
handler = "index.handler"

role = aws_iam_role.iam_for_lambda.arn
role = aws_iam_role.iam_for_lambda[0].arn
}

#---------------------------------------------------------------
Expand All @@ -80,7 +80,7 @@ resource "aws_cognito_user_pool" "pool" {
}

lambda_config {
pre_token_generation = aws_lambda_function.pretoken_trigger.arn
pre_token_generation = aws_lambda_function.pretoken_trigger[0].arn
}
}

Expand Down Expand Up @@ -133,13 +133,13 @@ resource "aws_s3_bucket" "jupyterhub_bucket" {

resource "aws_s3_object" "engineering_object" {
count = var.jupyter_hub_auth_mechanism == "cognito" ? 1 : 0
bucket = aws_s3_bucket.jupyterhub_bucket.id
bucket = aws_s3_bucket.jupyterhub_bucket[0].id
key = "engineering/"
}

resource "aws_s3_object" "legal_object" {
count = var.jupyter_hub_auth_mechanism == "cognito" ? 1 : 0
bucket = aws_s3_bucket.jupyterhub_bucket.id
bucket = aws_s3_bucket.jupyterhub_bucket[0].id
key = "legal/"
}

Expand Down

0 comments on commit 7e123a3

Please sign in to comment.