serverless-cloudformation-sub-variables icon indicating copy to clipboard operation
serverless-cloudformation-sub-variables copied to clipboard

Add ability to customize search pattern

Open khornberg opened this issue 6 years ago • 2 comments

This adds the ability to customize the prefix and suffix of the search pattern.

My intention is written in more detail at https://forum.serverless.com/t/can-i-customize-the-valid-api-gateway-stage-name-pattern/9217

With this change I can create an API Gateway valid stage but one that is later replaced e.g. AbcStageXyz

The custom section in serverless.yml looks like

custom:
  sub:
    prefix: Abc
    suffix: Xyz

khornberg avatar Sep 04 '19 18:09 khornberg

Hi @khornberg, Thank you for this PR.

I think I understand what you mention, but just for clarity. You'd still want to use the Fn::Sub addition conversion part of this module? That is, when you have something equal AbcStageXyz, you'd want it to later become Fn::Sub: ${Stage} in the final CFN template?

santiagocardenas avatar Sep 12 '19 16:09 santiagocardenas

Yes This comes from wanting to get Fn::Sub into places where some characters are not allowed. Specifically, setting the provider.stage and wanting to replace that later on.

khornberg avatar Sep 12 '19 18:09 khornberg