Skip to content

Variables

perpil edited this page Dec 27, 2023 · 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
service service LightSpeedService
account account 123456789120
partition aws partition for region aws
srServiceName current display service name Light Speed Service
srRegionName current display region name without suffix us-west-2 - Prod
content content of the Speedrun block

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 content. 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 the .raw extension on your template name 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

Filtering dropdowns

srServiceFilter and srRegionFilter can be used to display a subset of the services or regions on a page. They support either a string or array for the filter: srServiceFilter:'DecacornService' or srServiceFilter:['DecacornService','MoonWalkerService']

Forcing configuration to display

srShowConfig:true will display config on a page instead of hiding it by default. It will be automatically displayed if there is only 1 pre block on the page.

Hiding user service

srHideUserService:true will cause your personal AWS account to not appear in the service dropdown

Including comments

stripComments:false will leave comments in the output.

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 Speedrun block or in the Speedrun block content itself.

Warning

If you override these variables in Speedrun block content, the do it button will not display the correct values since it is evaluated before the button is clicked.

roleDuration

By default, when you assume a role it will get credentials for 1 hour. If you modify the max duration of a role and sync it, speedrun will allow you to specify a custom duration > 1 hour. Use the roleDuration variable to set the duration. Depending on the value, it will automatically change the units according to the following table:

Value Units
<=12 hours
<=720 minutes
>720 seconds

For example, if you set roleDuration to 3, it will mean 3 hours. If you set it to 15, it will be 15 minutes. If you set it to 900, it will be 900 seconds.