How to use dot in custom variables’ key?

I reported this issue in https://github.com/serverless/serverless/issues/4652

Looking for help in this forum.

What went wrong?

If the variable key in custom definition has dot, serverless will always report: could not be found.

What was the config you used?

$ cat dev.yml
version:
  v1.0: value-1
  v2.0: value-2

When I reference the variable ${self:custom.version.v1.0} , always got the error:

could not be found.

I understand that custom variable use dot (.) as splitter, but how to escape dot when reference it?

If I escape dot ( ${self:custom.version.v1\.0} ) , it can pass cloudformation validation, but can’t be deployed.

Invalid HTTP endpoint specified for URI.

If serverless print, I can’t see the variable is replaced by the real value, and in updated CFN, it becomes to :

"${self:custom.version.v1\\.0}"

Can you just use _ instead of a . , like so v1_0 ?

agree, looks I have to adjust the key to avoid to use dot in it.