Skip to content

Variables

perpil edited this page Sep 19, 2022 · 15 revisions

Variables

Interpolate a variable with ${variableName}

#copy
${user}

Expressions

Variables can contain other variables and expressions. i.e. "copiedBy" : "${user} @ ${dayjs()}"

#copy {"copiedBy" : "${user} @ ${dayjs()}"}
This was copied by ${copiedBy}

Built-in Variables

Name Description Example
user username of GitHub user perpil
region region us-east-2
account account 123456789120
partition aws partition for region aws
srServiceName current service name LightSpeedService
content content of the wiki entry

Special Variables

Setting button danger

If the role you are using contains the word admin, full or write the button will be red, indicating this is more dangerous. If your role doesn't contain those words and you want to make the button red, force it with "danger": true

Turning off interpolation and ignoring errors

Sometimes you don't want to interpolate anything in the wiki body. In that case set the variable "raw" : true and it won't replace anything within the interpolation braces: ${} . If you want it to attempt to interpolate stuff between the interpolation braces but not fail if it encounters an error and leave the content as is, set the variable "ignoreErrors" : true

💡 Note Alternatively you can add .raw to your template name when you use it to automatically set raw to true

Turning off prompts

To turn off prompt evaluation, set "noPrompts":true it will leave them as is.

💡 Note Alternatively you can add .noPrompts to your template name when you use it to automatically set noPrompts to true

account, role, region

account, role and region set the account, role and region for AWS credentials. These are typically set by the service and region dropdowns in the toolbar from srConfig, but you can override them for a specific wiki entry or in the wiki content itself.

❗ Warning If you override them in the wiki content, the do it button will not display the correct values.

Clone this wiki locally