Skip to content

Commit

Permalink
Merge pull request #10: modified task definition memory size
Browse files Browse the repository at this point in the history
Chores: added ECS redeployment trigger
  • Loading branch information
IrezD authored Jan 7, 2024
2 parents 54d342d + a39288b commit 30417b3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Item(BaseModel):

@app.get("/")
def read_root():
return {"Message": "Hello world! Merry Christmas and a happy new year to everyone!!!"}
return {"Message": "Hello world! Welcome to FastAPI!!!"}


@app.get("/items/{item_id}")
Expand Down
7 changes: 7 additions & 0 deletions terraform/asg.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ resource "aws_autoscaling_group" "ASG_config" {
propagate_at_launch = true
}

tag {
key = "Name"
value = "${title(var.env)}_Enivronment"
propagate_at_launch = true
}


timeouts {
delete = "15m"
}
Expand Down
5 changes: 3 additions & 2 deletions terraform/ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,15 @@ TASK_DEFINITION

}

# ------ ECS Service -------- **
# ------ ECS Service --------- **

resource "aws_ecs_service" "fastapi-service" {
name = var.ecs_service_name
cluster = aws_ecs_cluster.fastapi-cluster.id
task_definition = aws_ecs_task_definition.task_definition.arn
task_definition = aws_ecs_task_definition.task_definition.arn_without_revision
desired_count = 1
launch_type = "EC2"

force_new_deployment = true

load_balancer {
Expand Down

0 comments on commit 30417b3

Please sign in to comment.