Skip to content

Commit

Permalink
cleaning up code for iam permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
MotwaniM committed Mar 25, 2024
1 parent 5586478 commit 1cce759
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 22 deletions.
19 changes: 0 additions & 19 deletions infrastructure/batch.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,3 @@ module "batch_job_defintiion" {
image = module.ecr_pre_processing.ecr_repository_url
fargate_flag = false
}

# The ECS task will need to invoke SageMaker endpoint
resource "aws_iam_policy" "sagemaker_invoke" {
name = "SageMakerInvokePolicy"
description = "Policy that allows ECS tasks to invoke SageMaker endpoints"

policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "sagemaker:InvokeEndpoint",
"Effect": "Allow",
"Resource": "*"
}
]
}
EOF
}
4 changes: 2 additions & 2 deletions infrastructure/ecr.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ module "ecr_front_end" {
source = "../../i-ai-core-infrastructure//modules/ecr"

project_name_prefix = var.project_name
container_name = "front-end"
container_name = "${terraform.workspace}-front-end"
}

module "ecr_pre_processing" {
source = "../../i-ai-core-infrastructure//modules/ecr"
project_name_prefix = var.project_name
container_name = "pre-processing"
container_name = "${terraform.workspace}-pre-processing"
}
2 changes: 1 addition & 1 deletion infrastructure/ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module "ecs" {
source = "../../i-ai-core-infrastructure//modules/ecs"
project_name = var.project_name
image_tag = "dfcde6a235a58d4e708e53c9c2252477516c414b"
prefix = "i-dot-ai"
prefix = "i-ai"
ecr_repository_uri = module.ecr_front_end.ecr_repository_url
ecs_cluster_id = data.terraform_remote_state.platform.outputs.ecs_cluster_id
health_check = {
Expand Down
10 changes: 10 additions & 0 deletions infrastructure/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,18 @@ terraform {
backend "s3" {
key = "consultation-analyser/terraform.tfstate"
}

}

provider "random" {

}

provider "aws" {
default_tags {
tags = {
Environment = terraform.workspace
Deployed = "github"
}
}
}

0 comments on commit 1cce759

Please sign in to comment.