Skip to content
2 changes: 1 addition & 1 deletion samtranslator/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.6.1'
__version__ = '1.8.0'
30 changes: 30 additions & 0 deletions samtranslator/policy_templates_data/policy_templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,36 @@
]
}
},
"RekognitionFacesManagementPolicy": {
"Description": "Gives permission to add, delete and search faces in a collection",
"Parameters": {
"CollectionId": {
"Description": "ID of the collection"
}
},
"Definition": {
"Statement": [{
"Effect": "Allow",
"Action": [
"rekognition:IndexFaces",
"rekognition:DeleteFaces",
"rekognition:SearchFaces",
"rekognition:SearchFacesByImage",
"rekognition:ListFaces"
],
"Resource": {
"Fn::Sub": [
"arn:${AWS::Partition}:rekognition:${AWS::Region}:${AWS::AccountId}:collection/${collectionId}",
{
"collectionId": {
"Ref": "CollectionId"
}
}
]
}
}]
}
},
"RekognitionFacesPolicy": {
"Description": "Gives permission to compare and detect faces and labels",
"Parameters": {
Expand Down
3 changes: 3 additions & 0 deletions tests/translator/input/all_policy_templates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,6 @@ Resources:
PinpointApplicationId: id

- RekognitionDetectOnlyPolicy: {}

- RekognitionFacesManagementPolicy:
CollectionId: collection
25 changes: 25 additions & 0 deletions tests/translator/output/all_policy_templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,31 @@
}
]
}
},
{
"PolicyName": "KitchenSinkFunctionRolePolicy40",
"PolicyDocument": {
"Statement": [
{
"Action": [
"rekognition:IndexFaces",
"rekognition:DeleteFaces",
"rekognition:SearchFaces",
"rekognition:SearchFacesByImage",
"rekognition:ListFaces"
],
"Resource": {
"Fn::Sub": [
"arn:${AWS::Partition}:rekognition:${AWS::Region}:${AWS::AccountId}:collection/${collectionId}",
{
"collectionId": "collection"
}
]
},
"Effect": "Allow"
}
]
}
}
],
"AssumeRolePolicyDocument": {
Expand Down
25 changes: 25 additions & 0 deletions tests/translator/output/aws-cn/all_policy_templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,31 @@
}
]
}
},
{
"PolicyName": "KitchenSinkFunctionRolePolicy40",
"PolicyDocument": {
"Statement": [
{
"Action": [
"rekognition:IndexFaces",
"rekognition:DeleteFaces",
"rekognition:SearchFaces",
"rekognition:SearchFacesByImage",
"rekognition:ListFaces"
],
"Resource": {
"Fn::Sub": [
"arn:${AWS::Partition}:rekognition:${AWS::Region}:${AWS::AccountId}:collection/${collectionId}",
{
"collectionId": "collection"
}
]
},
"Effect": "Allow"
}
]
}
}
],
"AssumeRolePolicyDocument": {
Expand Down
25 changes: 25 additions & 0 deletions tests/translator/output/aws-us-gov/all_policy_templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -1004,6 +1004,31 @@
}
]
}
},
{
"PolicyName": "KitchenSinkFunctionRolePolicy40",
"PolicyDocument": {
"Statement": [
{
"Action": [
"rekognition:IndexFaces",
"rekognition:DeleteFaces",
"rekognition:SearchFaces",
"rekognition:SearchFacesByImage",
"rekognition:ListFaces"
],
"Resource": {
"Fn::Sub": [
"arn:${AWS::Partition}:rekognition:${AWS::Region}:${AWS::AccountId}:collection/${collectionId}",
{
"collectionId": "collection"
}
]
},
"Effect": "Allow"
}
]
}
}
],
"AssumeRolePolicyDocument": {
Expand Down
5 changes: 3 additions & 2 deletions tests/translator/validator/test_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
from samtranslator.yaml_helper import yaml_parse
from samtranslator.validator.validator import SamTemplateValidator

input_folder = 'tests/translator/input'
BASE_PATH = os.path.dirname(__file__)
INPUT_FOLDER = os.path.join(BASE_PATH, os.pardir, 'input')

@pytest.mark.parametrize('testcase', [
'basic_function',
Expand Down Expand Up @@ -102,7 +103,7 @@ def test_validate_template_success(testcase):
]
if testcase in excluded:
return
manifest = yaml_parse(open(os.path.join(input_folder, testcase + '.yaml'), 'r'))
manifest = yaml_parse(open(os.path.join(INPUT_FOLDER, testcase + '.yaml'), 'r'))
validation_errors = SamTemplateValidator.validate(manifest)
has_errors = len(validation_errors)
if has_errors:
Expand Down
3 changes: 2 additions & 1 deletion versions/2016-10-31.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ Property Name | Type | Description
---|:---:|---
Handler | `string` | **Required.** Function within your code that is called to begin execution.
Runtime | `string` | **Required.** The runtime environment.
CodeUri | `string` <span>&#124;</span> [S3 Location Object](#s3-location-object) | **Required.** S3 Uri or location to the function code. The S3 object this Uri references MUST be a [Lambda deployment package](http://docs.aws.amazon.com/lambda/latest/dg/deployment-package-v2.html).
CodeUri | `string` <span>&#124;</span> [S3 Location Object](#s3-location-object) | **Either CodeUri or InlineCode must be specified.** S3 Uri or location to the function code. The S3 object this Uri references MUST be a [Lambda deployment package](http://docs.aws.amazon.com/lambda/latest/dg/deployment-package-v2.html).
InlineCode | `string` | **Either CodeUri or InlineCode must be specified.** The inline code for the lambda.
FunctionName | `string` | A name for the function. If you don't specify a name, a unique name will be generated for you. [More Info](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-functionname)
Description | `string` | Description of the function.
MemorySize | `integer` | Size of the memory allocated per invocation of the function in MB. Defaults to 128.
Expand Down