aws / aws/serverless-application-model

EcsRunTaskPolicy should take ECS ARN, not task definition (family:revision)

Open
#1,740 1 comment 5 reactions 0 assignees View on GitHub
area/policy-templates maintainer/need-response type/feature
Dominant language
Python
Stars
9.6k
Forks
2.5k
Avg merge
1d 11h
Merged PRs (30d)
7

Description

**Description:**

"EcsRunTaskPolicy" policy template in [`policy_templates.json`](https://github.com/aws/serverless-application-model/blob/develop/samtranslator/policy_templates_data/policy_templates.json) takes one argument, `TaskDefinition`. It is assumed to be (family:revision), e.g. "EcsTaskName:1"

But `Ref` for `AWS::ECS::TaskDefinition` returns Task's ARN. So, following code would not work.

```yaml
Resources:
SomeFunction:
Type: AWS::Serverless::Function
Properties:
Policies:
- EcsRunTaskPolicy
TaskDefinition: !Ref SomeECSTaskDefinition

SomeECSTaskDefinition:
Type: AWS::ECS::TaskDefinition
Properties:
```

If `TaskDefinition` argument takes ARN format, the above code would work. We can refer ECS task definition in the CloudFormation template.

I think `TaskDefinition` should takes ARN format. How about it?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.