Skip to content

Commit

Permalink
update working ec2 mix fargate in ecs
Browse files Browse the repository at this point in the history
  • Loading branch information
zcemycl committed Jul 14, 2024
1 parent 7befd91 commit c572592
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 20 deletions.
3 changes: 0 additions & 3 deletions src/tf/aws-dagster/architectures/ec2.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,11 @@ resource "aws_launch_template" "this" {
resource "aws_autoscaling_group" "this" {
name = "${var.prefix}-asg-ec2-hotload"
vpc_zone_identifier = [for name, obj in module.private_subnet.subnets : obj.id if length(regexall(".*dagster_nat.*", name)) > 0]
# launch_configuration = aws_launch_template.this.name
launch_template {
id = aws_launch_template.this.id
version = "$Latest"
}


desired_capacity = 1
min_size = 1
max_size = 1
health_check_grace_period = 0
Expand Down
11 changes: 6 additions & 5 deletions src/tf/aws-dagster/architectures/ecs-task.tf
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,15 @@ resource "aws_service_discovery_service" "this_hotload" {
}

resource "aws_ecs_service" "this_hotload" {
name = "hotload-etl2"
# iam_role = aws_iam_role.this_srv.arn
name = "hotload-etl2"
cluster = aws_ecs_cluster.this.id
desired_count = 1
task_definition = aws_ecs_task_definition.this.arn
launch_type = "EC2"
# deployment_minimum_healthy_percent = 50
# deployment_maximum_percent = 200

capacity_provider_strategy {
capacity_provider = aws_ecs_capacity_provider.this.name
weight = 100
}

network_configuration {
security_groups = [module.security_groups.sg_ids["everything"].id]
Expand Down
12 changes: 0 additions & 12 deletions src/tf/aws-dagster/architectures/ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,6 @@ resource "aws_ecs_cluster_capacity_providers" "cas" {
}
}

# resource "aws_ecs_cluster_capacity_providers" "example" {
# cluster_name = aws_ecs_cluster.this.name

# capacity_providers = ["FARGATE"]

# default_capacity_provider_strategy {
# base = 1
# weight = 100
# capacity_provider = "FARGATE"
# }
# }

module "ecs_srv_task" {
source = "github.com/zcemycl/systemDeploy/src/tf/modules/ecs"
prefix = var.prefix
Expand Down

0 comments on commit c572592

Please sign in to comment.