serverless-step-functions
serverless-step-functions copied to clipboard
Allowing "Conditions" in step function definition
This is a Feature Proposal
Description
Hi all, I've done a definition which is inside the "more complex" serverless deploy I'm using in my company. We have two stages (test and prod) where (obviously) the test one is were we try to check if everything works... My current step function has a recurring schedulation, and I don't want to have that in the test environment... Is there a way to say so without using the custom variables of serverless??
Right now my serverless.ts file is (with custom vars):
name: '${self:service}-${self:provider.stage}-myStepFunction',
events: [{
schedule: {
rate: 'cron(5 2 * * ? *)',
enabled: '${self:custom.config.isProd.${self:provider.stage}}',
},
}],
definition: {}
I'd like to have something more similar to this:
name: '${self:service}-${self:provider.stage}-myStepFunction',
events: [{
schedule: {
rate: 'cron(5 2 * * ? *)',
enabled: { 'Fn::Equals': ['${self:provider.stage}', 'production'] },
},
}],
definition: {}
but right now I can't make it work...
Any ideas? Is it something disabled by definition?
Thanks!!!