Skip to content

Function Event Schedule - Can't use conditional for "Enabled" property #1271

Closed

Description

@muzehyun

Description:
I have created Schedule event for a function.
And I wanted to enable it conditionally
Whatever conditional I have used, it's always enabled.
(I already verified with inverted true/false - conditional might wrong - still always enabled)
I have confirmed through cloudwatch log too.
If I use Enabled: false directly, it works well.

Conditions:
  IsDev:
    Fn::Equals:
      - Ref: Stage
      - dev

SomeFunction:
  Type: AWS::Serverless::Function
  Properties:
    ...
    Events:
      warming:
        Type: Schedule
        Properties:
          Enabled:
            Fn::If:
              - IsDev
              - false
              - true
          Schedule: "cron(* * * * ? *)"

Observed result:
Screen Shot 2019-11-28 at 12 40 26 AM

Expected result:
Properly "Disabled" based on conditional.

Activity

  1. added
    stage/bug-repro
    on Feb 22, 2021
  2. added
    area/intrinsics
    on Apr 12, 2021
  3. added
    stage/pm-review
    and removed
    stage/pm-review
    on May 5, 2021
  4. jfuss commented on Aug 5, 2021

    @jfuss
    Contributor

    This is a duplicate of #1329

    Closing this one in favor of that since #1329 has a bunch of comments.

  5. added and removed
    stage/bug-repro
    on Aug 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/intrinsics

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions