How can I have a custom validAPIGatewayStageNamePattern
?
I need to define the stage
in a CloudFormation Parameter because the CF template is built and deployed in different steps. Additionally, the deploy is via AWS ServiceCatalog which only uses CF parameters. So at deploy of the generated CF template I need to provide the stage name via CF.
Much of this is already done by using https://github.com/santiagocardenas/serverless-cloudformation-sub-variables to add Fn::Sub
to the things I need.
Example works with I manually change validAPIGatewayStageNamePattern
in lib/classes/Service.js
service: PythonApiExample
provider:
name: aws
runtime: python3.7
stage: "#{MyStage}"
resources:
Parameters:
MyStage: 'dev'
I understand that sls deploy
will break if the regex is changed. I am not using the deploy, so my stack name is defined else where by me. That rule/regex is only necessary if I am deploying it seems.
I am willing to write a plugin but I don’t know where the tutorial is for those or if this is possible to change in a plugin.