Is it possible to create lambda based on condition?

aws

#1

CFN supports the conditional creation of resource including lambda.e.g.

“Conditions” : {
“CreateLambdaResources” : {“Fn::Equals” : [{“Ref” : “EnvType”}, “prod”]}
},

“NewLambda” : {
“Type” : “AWS::Lambda::Function”,
“Condition” : “CreateLambdaResources”,

}

Does serverless frame support it and how?
Thanks


#2

This plugin might be useful

You could so something like

serverlessIfElse: 
 - If: '"${self:custom.currentStage}" != "PROD"'
        Exclude: 
          functions. NewLambda