I am migrating from CloudFormation to Serverless. In the old CloudFormation template I have a string parameter that toggles a EventBridge rule’s enablement:
Parameters:
Param1:
Default: ENABLED
Type: String
AllowedValues:
- ENABLED
- DISABLED
Resources:
Rule1:
Type: AWS::Events::Rule
Properties:
State: !Ref Param1
Now that I have moved to Serverless, I want to retain the Param1 parameter in the generated Cloudformation template so that my teammates control the enablement in the Cloudformation console:
serverless package --param "Param1=ENABLED"
Param1:
Default: ${param:Param1}
Type: String
AllowedValues:
- ENABLED
- DISABLED
but there is no way of mapping that value to the enablement in the serverless.yml file, because now we have a true/false value of enabled
instead of a string value of State.
events:
- schedule:
enabled: false # Cannot be mapped to ENABLED/DISABLED
What are the options we have?