Skip to content

Commit 2d1d870

Browse files
committed
Merge branch 'dev' into create-lambda
2 parents a5d73bd + 9965cd4 commit 2d1d870

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ repos:
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:
@@ -39,7 +39,7 @@ repos:
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

openchallenges/service_stack.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)