File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed
Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change 2020 hooks :
2121 - id : yamllint
2222 - repo : https://github.com/awslabs/cfn-python-lint
23- rev : v1.19.0
23+ rev : v1.20.1
2424 hooks :
2525 - id : cfn-python-lint
2626 args :
3939 hooks :
4040 - id : black
4141 - repo : https://github.com/sirosen/check-jsonschema
42- rev : 0.29.4
42+ rev : 0.30.0
4343 hooks :
4444 - id : check-github-workflows
4545 - id : check-github-actions
Original file line number Diff line number Diff line change @@ -60,13 +60,36 @@ def __init__(
6060 )
6161 )
6262
63+ # default ECS execution policy plus Guardduty access
64+ execution_role = iam .Role (
65+ self ,
66+ "ExecutionRole" ,
67+ assumed_by = iam .ServicePrincipal ("ecs-tasks.amazonaws.com" ),
68+ managed_policies = [
69+ iam .ManagedPolicy .from_aws_managed_policy_name (
70+ "service-role/AmazonECSTaskExecutionRolePolicy"
71+ ),
72+ ],
73+ )
74+ execution_role .add_to_policy (
75+ iam .PolicyStatement (
76+ actions = [
77+ "logs:CreateLogStream" ,
78+ "logs:PutLogEvents" ,
79+ ],
80+ resources = ["*" ],
81+ effect = iam .Effect .ALLOW ,
82+ )
83+ )
84+
6385 # ECS task with fargate
6486 self .task_definition = ecs .FargateTaskDefinition (
6587 self ,
6688 "TaskDef" ,
6789 cpu = 1024 ,
6890 memory_limit_mib = 4096 ,
6991 task_role = task_role ,
92+ execution_role = execution_role ,
7093 )
7194
7295 image = ecs .ContainerImage .from_registry (props .container_location )
You can’t perform that action at this time.
0 commit comments