Serverless-application-model: Allow to pass parameter value for 'Enabled' property in ScheduledEvent of 'AWS::Serverless::Function'

Created on 16 Dec 2019  Â·  14Comments  Â·  Source: aws/serverless-application-model

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:

stagpm-review typfeature

Most helpful comment

@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.

All 14 comments

This is related to #1360

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.

It has been 10 months, when is this going to be fixed? Even Enabled: False doesn't even work anymore.

@jfuss is this still under review?

this is such a shame. you have a core feature broken, and nobody who's paid to work on it even cares.

Same issue here, lost a few hours on troubleshooting this...

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:
image

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:
image

Same here, what do you think @RichieRunner if we switch to the standard CloudFormation template (not SAM), should it be fine?

That was the same conditional logic I had tried. @victor

On Fri, Nov 27, 2020 at 1:36 AM Victor GRENU notifications@github.com
wrote:

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:
[image: image]
https://user-images.githubusercontent.com/20289967/100397949-496e5480-3001-11eb-8c2a-8b8bdcf572b8.png

Same here, what do you think @RichieRunner
https://github.com/RichieRunner if we switch to the standard
CloudFormation template (not SAM), should it be fine?

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/aws/serverless-application-model/issues/1329#issuecomment-734691438,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AFODGAKIN3LZPGIC4YHHJYDSR5JGPANCNFSM4J3GXJOA
.

@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.

A workaround would be much appreciated. I'm running into the same issue using the same Condition logic.

Hi there,

Do you think we can apply similar logic to the parent lambda event source?

image

I don't know where we can set this up in SAM. Any clues ?

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

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

Thanks, so...you just run this as a last step in every build? 😖

Was this page helpful?
0 / 5 - 0 ratings