Skip to content

Commit

Permalink
Service autoscaling for ecsworkshop cdk
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Keller committed Mar 11, 2020
1 parent f4474d4 commit 9c17ad2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
cdk.context.*
cdk.out
.env
13 changes: 13 additions & 0 deletions cdk/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,19 @@ def __init__(self, scope: core.Stack, id: str, **kwargs):
self.base_platform.services_sec_grp,
port_range=aws_ec2.Port(protocol=aws_ec2.Protocol.TCP, string_representation="frontendtobackend", from_port=3000, to_port=3000)
)

# Enable Service Autoscaling
#self.autoscale = self.fargate_load_balanced_service.service.auto_scale_task_count(
# min_capacity=1,
# max_capacity=10
#)

#self.autoscale.scale_on_cpu_utilization(
# "CPUAutoscaling",
# target_utilization_percent=50,
# scale_in_cooldown=core.Duration.seconds(30),
# scale_out_cooldown=core.Duration.seconds(30)
#)


_env = core.Environment(account=getenv('AWS_ACCOUNT_ID'), region=getenv('AWS_DEFAULT_REGION'))
Expand Down

0 comments on commit 9c17ad2

Please sign in to comment.