You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow to pass parameter value for 'Enabled' property in ScheduledEvent of 'AWS::Serverless::Function' #1329
When you reference a parameter for 'Enabled' property in ScheduledEvent of 'AWS::Serverless::Function', it is not honoring the parameter value passed and setting the "State": "ENABLED" for Events::Rule in the processed template.
'Enabled' property in ScheduledEvent of 'AWS::Serverless::Function' currently only accepts 'true' or 'false' bool values hard-coded as string in template.
in the background when composing the processed template, 'AWS::Serverless-2016-10-31' transform sees:
if 'Enabled' property is set in the ScheduledEvent,
Thanks for the issue report! We have passed this along to our product team for possible prioritization. Please +1 on the feature to help with prioritization.
Reacted by John Walsh, Victor GRENU, Julia Jacobs, Chuck Fisher and Mario Vela
Reacted by Héctor Vázquez, Julia Jacobs and Diego H. Gurpegui
Since it's abundantly clear now that AWS and the maintainers of this codebase are refusing to prioritize this to be a critical bug, what is everyone's recommendation for disabling the Enabled flag if you are building resources in NP?
I am trying to achieve this kind of conditional logic:
Reacted by Victor GRENU, John Walsh and Michel Fang
Since it's abundantly clear now that AWS and the maintainers of this codebase are refusing to prioritize this to be a critical bug, what is everyone's recommendation for disabling the Enabled flag if you are building resources in NP?
I am trying to achieve this kind of conditional logic:
Same here, what do you think @RichieRunner if we switch to the standard CloudFormation template (not SAM), should it be fine?
@RichieRunner@z0ph@jwalsh2me thanks for bumping this issue and discussing workarounds. I've just now added this to the backlog internally, and I apologize that we struggle with communicating status on issues like this where there are internal and external trackers involved.
Is there a workaround people have found for this particular issue? I was hoping for some cases like this that SAM CLI's recent addition of environments would help, but I can see why it fails here.
Reacted by John Walsh, Richie Ho, Victor GRENU and Chuck Fisher
FWIW, I have a bash script function workaround. It will remove the lambda CloudWatch Event rule trigger and disable the rule itself for SAM rules with the default serverlessrepo*. names. It should be easy to add parameters / variables to.
I can't find an AWS CLI way to just disable a CloudWatch Event in the Lambda so I remove it.
I could work around this by adding a separate resource for AWS::Events::Rule and excluded 'Events' property from AWS::Serverless::Function. Example template:-
Hey all, I am moving through our backlog of PRs and this PR (#1666) was looking to address this.
I am in the middle of updating it but realized a couple things, if you are using Intrinsic Functions as the value, this will break because SAM expects "true" or "false" while the underlying CFN resource uses "enabled" or "disabled".
SAM's history with intrinsic functions are hit or miss. Mostly due to us needing to re-implement how CloudFormation handles these, as there is no library provided by CloudFormation. Instead of going down that path (which has a bunch of flaws/concerns), I am thinking about adding a new property that will be a passthrough to the underlying CloudFormation resource directly. This would require customers to change their templates but existing ones would behave the same and people running into issues (as described here) could be unblocked.
Looking for some thoughts from the community on this.
Activity
SydneyUni-Jim commentedon Jan 4, 2020
This is related to #1360
praneetap commentedon Jan 8, 2020
Thanks for the issue report! We have passed this along to our product team for possible prioritization. Please +1 on the feature to help with prioritization.
RichieRunner commentedon Oct 9, 2020
It has been 10 months, when is this going to be fixed? Even
Enabled: Falsedoesn't even work anymore.jwalsh2me commentedon Oct 12, 2020
@jfuss is this still under review?
RichieRunner commentedon Nov 3, 2020
this is such a shame. you have a core feature broken, and nobody who's paid to work on it even cares.
z0ph commentedon Nov 24, 2020
Same issue here, lost a few hours on troubleshooting this...
RichieRunner commentedon Nov 27, 2020
Since it's abundantly clear now that AWS and the maintainers of this codebase are refusing to prioritize this to be a critical bug, what is everyone's recommendation for disabling the
Enabledflag if you are building resources in NP?I am trying to achieve this kind of conditional logic:

z0ph commentedon Nov 27, 2020
Same here, what do you think @RichieRunner if we switch to the standard CloudFormation template (not SAM), should it be fine?
jwalsh2me commentedon Nov 27, 2020
awsjeffg commentedon Nov 27, 2020
@RichieRunner @z0ph @jwalsh2me thanks for bumping this issue and discussing workarounds. I've just now added this to the backlog internally, and I apologize that we struggle with communicating status on issues like this where there are internal and external trackers involved.
Is there a workaround people have found for this particular issue? I was hoping for some cases like this that SAM CLI's recent addition of environments would help, but I can see why it fails here.
jewelsjacobs commentedon Nov 29, 2020
A workaround would be much appreciated. I'm running into the same issue using the same Condition logic.
z0ph commentedon Nov 30, 2020
Hi there,
Do you think we can apply similar logic to the parent lambda event source?
I don't know where we can set this up in SAM. Any clues ?
jewelsjacobs commentedon Dec 1, 2020
FWIW, I have a bash script function workaround. It will remove the lambda CloudWatch Event rule trigger and disable the rule itself for SAM rules with the default serverlessrepo*. names. It should be easy to add parameters / variables to.
I can't find an AWS CLI way to just disable a CloudWatch Event in the Lambda so I remove it.
https://gist.github.com/jewelsjacobs/2ea1b37dd4db5279d038111e77d9d813
7 remaining items
forzagreen commentedon May 31, 2021
Thank you @nbrational for the workaround.
I think you also have to grant Events the permission to invoke the lambda, using AWS::Lambda::Permission resource :
RichieRunner commentedon Dec 19, 2021
Closing in on the 2 year mark with still no fix from the SAM team on this 🎉
jfalkenstein commentedon Jan 10, 2022
Could we please get some attention on this?
jfuss commentedon Jun 16, 2022
Hey all, I am moving through our backlog of PRs and this PR (#1666) was looking to address this.
I am in the middle of updating it but realized a couple things, if you are using Intrinsic Functions as the value, this will break because SAM expects "true" or "false" while the underlying CFN resource uses "enabled" or "disabled".
SAM's history with intrinsic functions are hit or miss. Mostly due to us needing to re-implement how CloudFormation handles these, as there is no library provided by CloudFormation. Instead of going down that path (which has a bunch of flaws/concerns), I am thinking about adding a new property that will be a passthrough to the underlying CloudFormation resource directly. This would require customers to change their templates but existing ones would behave the same and people running into issues (as described here) could be unblocked.
Looking for some thoughts from the community on this.
jwalsh2me commentedon Jun 28, 2022
I like the idea of a new property!