@@ -357,14 +357,9 @@ def create_ecs_service(
357
357
358
358
def create_autodestroy (stack , deployment_timeout : int ):
359
359
from pathlib import Path
360
- from aws_cdk .aws_events import (
361
- Rule ,
362
- Schedule
363
- )
360
+ from aws_cdk .aws_events import Rule , Schedule
364
361
from aws_cdk .aws_events_targets import LambdaFunction
365
- from aws_cdk .aws_iam import (
366
- PolicyStatement
367
- )
362
+ from aws_cdk .aws_iam import PolicyStatement
368
363
from aws_cdk import aws_lambda , Duration
369
364
from aws_cdk .aws_logs import RetentionDays
370
365
@@ -373,7 +368,9 @@ def create_autodestroy(stack, deployment_timeout: int):
373
368
resources = ["*" ],
374
369
)
375
370
376
- lambda_function_file = str (Path (__file__ ).parent .parent / "auto_destruction/harakiri.py" )
371
+ lambda_function_file = str (
372
+ Path (__file__ ).parent .parent / "auto_destruction/harakiri.py"
373
+ )
377
374
harakiri = aws_lambda .Function (
378
375
stack ,
379
376
"AutoDestroy" ,
@@ -387,6 +384,8 @@ def create_autodestroy(stack, deployment_timeout: int):
387
384
harakiri .add_to_role_policy (lambdaDeleteStackPolicy )
388
385
389
386
lambda_rule = Rule (
390
- stack , "TimeToDestroy" , schedule = Schedule .rate (Duration .minutes (deployment_timeout ))
387
+ stack ,
388
+ "TimeToDestroy" ,
389
+ schedule = Schedule .rate (Duration .minutes (deployment_timeout )),
391
390
)
392
391
lambda_rule .add_target (LambdaFunction (handler = harakiri ))
0 commit comments