@@ -15,6 +15,8 @@ def setUp(self):
1515 "Api" : {"Type" : "AWS::Serverless::Api" },
1616 "Layer" : {"Type" : "AWS::Serverless::LayerVersion" },
1717 "NonSam" : {"Type" : "AWS::Lambda::Function" },
18+ "Fn::ForEach::LambdaFunctions" : [ "FunctionName" , ["1" , "2" ], { "${FunctioName}" : {"Type" : "AWS::Lambda::Function" , "a" : "b" }}],
19+ "Fn::ForEach::ServerlessFunctions" : ["FunctionName" , ["3" , "4" ], {"${FunctionName}" : {"Type" : "AWS::Serverless::Function" , "a" : "b" }}],
1820 },
1921 }
2022
@@ -26,6 +28,7 @@ def test_iterate_must_yield_sam_resources_only(self):
2628 ("Function2" , {"Type" : "AWS::Serverless::Function" , "a" : "b" , "Properties" : {}}),
2729 ("Api" , {"Type" : "AWS::Serverless::Api" , "Properties" : {}}),
2830 ("Layer" , {"Type" : "AWS::Serverless::LayerVersion" , "Properties" : {}}),
31+ ("ServerlessFunctions::${FunctionName}" , {"Type" : "AWS::Serverless::Function" , "a" : "b" , "Properties" : {}}),
2932 ]
3033
3134 actual = [(id , resource .to_dict ()) for id , resource in template .iterate ()]
@@ -38,6 +41,7 @@ def test_iterate_must_filter_by_resource_type(self):
3841 expected = [
3942 ("Function1" , {"Type" : "AWS::Serverless::Function" , "DependsOn" : "SomeOtherResource" , "Properties" : {}}),
4043 ("Function2" , {"Type" : "AWS::Serverless::Function" , "a" : "b" , "Properties" : {}}),
44+ ("ServerlessFunctions::${FunctionName}" , {"Type" : "AWS::Serverless::Function" , "a" : "b" , "Properties" : {}}),
4145 ]
4246
4347 actual = [(id , resource .to_dict ()) for id , resource in template .iterate ({type })]
0 commit comments