Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion samtranslator/model/lambda_.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class LambdaLayerVersion(Resource):
'Content': PropertyType(True, is_type(dict)),
'Description': PropertyType(False, is_str()),
'LayerName': PropertyType(False, is_str()),
'CompatibleRuntimes': PropertyType(False, list_of(is_str())),
'CompatibleRuntimes': PropertyType(False, list_of(one_of(is_str(), is_type(dict)))),
'LicenseInfo': PropertyType(False, is_str())
}

Expand Down
2 changes: 1 addition & 1 deletion samtranslator/model/sam_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ class SamLayerVersion(SamResourceMacro):
'LayerName': PropertyType(False, one_of(is_str(), is_type(dict))),
'Description': PropertyType(False, is_str()),
'ContentUri': PropertyType(True, one_of(is_str(), is_type(dict))),
'CompatibleRuntimes': PropertyType(False, list_of(is_str())),
'CompatibleRuntimes': PropertyType(False, list_of(one_of(is_str(), is_type(dict)))),
'LicenseInfo': PropertyType(False, is_str()),
'RetentionPolicy': PropertyType(False, is_str())
}
Expand Down
6 changes: 6 additions & 0 deletions tests/translator/input/layers_with_intrinsics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ Parameters:
Default: MIT-0 License
LayerRuntimeList:
Type: CommaDelimitedList
LayerRuntimeString1:
Type: String
Default: nodejs6.10
LayerRuntimeString2:
Type: String
Default: nodejs8.10

Resources:
LayerWithLicenseIntrinsic:
Expand Down
49 changes: 28 additions & 21 deletions tests/translator/output/aws-cn/layers_with_intrinsics.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
{
"Parameters": {
"LayerLicenseInfo": {
"Default": "MIT-0 License",
"Default": "MIT-0 License",
"Type": "String"
},
},
"LayerRuntimeList": {
"Type": "CommaDelimitedList"
},
},
"LayerNameParam": {
"Default": "SomeLayerName",
"Default": "SomeLayerName",
"Type": "String"
},
"LayerRuntimeString1": {
"Default": "nodejs6.10",
"Type": "String"
},
"LayerRuntimeString2": {
"Default": "nodejs8.10",
"Type": "String"
}
},
},
"Resources": {
"LayerWithNameIntrinsiccf8baed8b9": {
"DeletionPolicy": "Retain",
"Type": "AWS::Lambda::LayerVersion",
"DeletionPolicy": "Retain",
"Type": "AWS::Lambda::LayerVersion",
"Properties": {
"Content": {
"S3Bucket": "sam-demo-bucket",
"S3Bucket": "sam-demo-bucket",
"S3Key": "layer.zip"
},
},
"LayerName": "SomeLayerName"
}
},
Expand Down Expand Up @@ -49,28 +57,28 @@
}
},
"LayerWithRuntimesIntrinsic1a006faa85": {
"DeletionPolicy": "Retain",
"Type": "AWS::Lambda::LayerVersion",
"DeletionPolicy": "Retain",
"Type": "AWS::Lambda::LayerVersion",
"Properties": {
"Content": {
"S3Bucket": "sam-demo-bucket",
"S3Bucket": "sam-demo-bucket",
"S3Key": "layer.zip"
},
"LayerName": "LayerWithRuntimesIntrinsic",
},
"LayerName": "LayerWithRuntimesIntrinsic",
"CompatibleRuntimes": {
"Ref": "LayerRuntimeList"
}
}
},
},
"LayerWithLicenseIntrinsic965c8d0c9b": {
"DeletionPolicy": "Retain",
"Type": "AWS::Lambda::LayerVersion",
"DeletionPolicy": "Retain",
"Type": "AWS::Lambda::LayerVersion",
"Properties": {
"Content": {
"S3Bucket": "sam-demo-bucket",
"S3Bucket": "sam-demo-bucket",
"S3Key": "layer.zip"
},
"LayerName": "LayerWithLicenseIntrinsic",
},
"LayerName": "LayerWithLicenseIntrinsic",
"LicenseInfo": "MIT-0 License"
}
},
Expand All @@ -89,4 +97,3 @@
}
}
}

48 changes: 28 additions & 20 deletions tests/translator/output/aws-us-gov/layers_with_intrinsics.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
{
"Parameters": {
"LayerLicenseInfo": {
"Default": "MIT-0 License",
"Default": "MIT-0 License",
"Type": "String"
},
},
"LayerRuntimeList": {
"Type": "CommaDelimitedList"
},
},
"LayerNameParam": {
"Default": "SomeLayerName",
"Default": "SomeLayerName",
"Type": "String"
},
"LayerRuntimeString1": {
"Default": "nodejs6.10",
"Type": "String"
},
"LayerRuntimeString2": {
"Default": "nodejs8.10",
"Type": "String"
}
},
},
"Resources": {
"LayerWithNameIntrinsiccf8baed8b9": {
"DeletionPolicy": "Retain",
"Type": "AWS::Lambda::LayerVersion",
"DeletionPolicy": "Retain",
"Type": "AWS::Lambda::LayerVersion",
"Properties": {
"Content": {
"S3Bucket": "sam-demo-bucket",
"S3Bucket": "sam-demo-bucket",
"S3Key": "layer.zip"
},
},
"LayerName": "SomeLayerName"
}
},
Expand Down Expand Up @@ -49,28 +57,28 @@
}
},
"LayerWithRuntimesIntrinsic1a006faa85": {
"DeletionPolicy": "Retain",
"Type": "AWS::Lambda::LayerVersion",
"DeletionPolicy": "Retain",
"Type": "AWS::Lambda::LayerVersion",
"Properties": {
"Content": {
"S3Bucket": "sam-demo-bucket",
"S3Bucket": "sam-demo-bucket",
"S3Key": "layer.zip"
},
"LayerName": "LayerWithRuntimesIntrinsic",
},
"LayerName": "LayerWithRuntimesIntrinsic",
"CompatibleRuntimes": {
"Ref": "LayerRuntimeList"
}
}
},
},
"LayerWithLicenseIntrinsic965c8d0c9b": {
"DeletionPolicy": "Retain",
"Type": "AWS::Lambda::LayerVersion",
"DeletionPolicy": "Retain",
"Type": "AWS::Lambda::LayerVersion",
"Properties": {
"Content": {
"S3Bucket": "sam-demo-bucket",
"S3Bucket": "sam-demo-bucket",
"S3Key": "layer.zip"
},
"LayerName": "LayerWithLicenseIntrinsic",
},
"LayerName": "LayerWithLicenseIntrinsic",
"LicenseInfo": "MIT-0 License"
}
},
Expand Down
48 changes: 28 additions & 20 deletions tests/translator/output/layers_with_intrinsics.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
{
"Parameters": {
"LayerLicenseInfo": {
"Default": "MIT-0 License",
"Default": "MIT-0 License",
"Type": "String"
},
},
"LayerRuntimeList": {
"Type": "CommaDelimitedList"
},
},
"LayerNameParam": {
"Default": "SomeLayerName",
"Default": "SomeLayerName",
"Type": "String"
},
"LayerRuntimeString1": {
"Default": "nodejs6.10",
"Type": "String"
},
"LayerRuntimeString2": {
"Default": "nodejs8.10",
"Type": "String"
}
},
},
"Resources": {
"LayerWithNameIntrinsiccf8baed8b9": {
"DeletionPolicy": "Retain",
"Type": "AWS::Lambda::LayerVersion",
"DeletionPolicy": "Retain",
"Type": "AWS::Lambda::LayerVersion",
"Properties": {
"Content": {
"S3Bucket": "sam-demo-bucket",
"S3Bucket": "sam-demo-bucket",
"S3Key": "layer.zip"
},
},
"LayerName": "SomeLayerName"
}
},
Expand Down Expand Up @@ -49,28 +57,28 @@
}
},
"LayerWithRuntimesIntrinsic1a006faa85": {
"DeletionPolicy": "Retain",
"Type": "AWS::Lambda::LayerVersion",
"DeletionPolicy": "Retain",
"Type": "AWS::Lambda::LayerVersion",
"Properties": {
"Content": {
"S3Bucket": "sam-demo-bucket",
"S3Bucket": "sam-demo-bucket",
"S3Key": "layer.zip"
},
"LayerName": "LayerWithRuntimesIntrinsic",
},
"LayerName": "LayerWithRuntimesIntrinsic",
"CompatibleRuntimes": {
"Ref": "LayerRuntimeList"
}
}
},
},
"LayerWithLicenseIntrinsic965c8d0c9b": {
"DeletionPolicy": "Retain",
"Type": "AWS::Lambda::LayerVersion",
"DeletionPolicy": "Retain",
"Type": "AWS::Lambda::LayerVersion",
"Properties": {
"Content": {
"S3Bucket": "sam-demo-bucket",
"S3Bucket": "sam-demo-bucket",
"S3Key": "layer.zip"
},
"LayerName": "LayerWithLicenseIntrinsic",
},
"LayerName": "LayerWithLicenseIntrinsic",
"LicenseInfo": "MIT-0 License"
}
},
Expand Down