Skip to end of metadata
Go to start of metadata

Scalr automatically defines a certain amount of "built-in" Global Variables, and injects them in the Server (Instance) Scope. These Global Variables are always available, and they are prefixed with SCALR_ to avoid collisions with your own variables.

Given that Servers are inherently ephemeral, you may not supply custom Server-Scope Global Variables through the Scalr UI. You may however use the GlobalVariableSet API Call to configure custom Server-Scope Global Variables.

List of built-in Server-Scope Global Variables

The following Server-Scope Global Variables are available:

Environment VariableDescriptionSample Value
SCALR_IMAGE_IDCloud Image Identifierami-43935d2a
SCALR_EXTERNAL_IPExternal IP Address of the Server (only provided if the IP exists)107.108.109.110
SCALR_INTERNAL_IPInternal IP Address of the Server (only provided if the IP exists)10.11.12.13
SCALR_ROLE_NAME

Name of the Scalr Role this Server belongs to.

This is not the Farm Role Alias.

app-apache-ubuntu-ebs
SCALR_ISDBMASTERWhether this Instance is a Role Master (only provided).

1

SCALR_INSTANCE_INDEXIndex of this Instance within its Farm Role2
SCALR_INSTANCE_FARM_INDEXIndex of this instance within its Farm1
SCALR_SERVER_TYPEInstance typec3.large
SCALR_SERVER_HOSTNAME

The hostname for this Server

This Global Variable is best used in conjunction with a custom Hostname Format.

app-1.example.com
SCALR_LAUNCHED_BY_EMAILThe system email of the user who launched the instancesomeone@company.com
SCALR_LAUNCHED_BY_IDThe system ID of the user who launched the instance1
SCALR_SERVER_IDThe Server ID for this Server. This is an internal Scalr record key.0abb9535-9d1a-4dc4-a38c-7b7b26db7bb0
SCALR_FARM_IDThe Farm ID of the Farm this Server belongs to. This is an internal Scalr record key. 5334
SCALR_FARM_ROLE_IDThe Farm Role ID of the Farm Role this Server belongs to. This is an internal Scalr record key. 4

SCALR_FARM_ROLE_ALIAS

The Farm Role Alias of the Farm Role this Server belongs to.myrole
SCALR_FARM_NAMEThe Name of the Farm this Server belongs to.My App Production
SCALR_FARM_HASH

The Farm Hash of the Farm this Server belongs to. This is an internal Scalr record key.

cc55739bfdf844
SCALR_FARM_OWNER_EMAIL

The email address of the owner of the Farm this Server belongs to.

user@scalr.com
SCALR_BEHAVIORSA comma-separated list of the Scalr built-in automations that are active for this Server.apache,nginx
SCALR_ENV_IDThe ID of the Environment this Server belongs to. This is an internal Scalr record key.1
SCALR_ENV_NAMEThe Name of the Environment this Server belongs to. Staging
SCALR_CLOUD_LOCATIONThe Location where this Server is. This value is provided by your Cloud Platform.us-east-1
SCALR_CLOUD_SERVER_IDThe Cloud ID for this Server. This value is provided by your Cloud Platform.i-866f40a8
SCALR_CLOUD_LOCATION_ZONEA more precise location for this Server, if available. This value is provided by your Cloud Platform.us-east-1a
SCALR_CLOUD_PLATFORMA description of the Cloud Platform.  Available in Scalr  >=7.5.2.openstack, ec2, etc
SCALR_ACCOUNT_IDThe Scalr Account ID.  This is an internal Scalr record key. Available in Scalr  >=7.5.2.1, 5, etc
SCALR_ACCOUNT_NAMEThe Scalr Account Name.  This is an internal Scalr record key. Available in Scalr  >=7.5.2.Account1, Oil and Gas, Healthcare, etc.
SCALR_INSTANCE_ID

Equivalent to SCALR_CLOUD_SERVER_ID.

This Global Variable is a legacy AWS specific variable.


i-866f40a8
SCALR_AMI_ID

Equivalent to SCALR_IMAGE_ID. 

This Global Variable is a legacy AWS specific variable.


ami-43935d2a
SCALR_REGION

Equivalent to SCALR_CLOUD_LOCATION.

This Global Variable is a legacy AWS specific variable.


us-east-1
SCALR_AVAIL_ZONE

Equivalent to SCALR_CLOUD_LOCATION_ZONE.

This Global Variable is a legacy AWS specific variable.


us-east-1a

Cost Analytics built-in Server-Scope Global Variables

The following built-in Server-Scope Global Variables will only be available if Cost Analytics is enabled

Environment VariableDescriptionSample Value
SCALR_COST_CENTER_IDThe ID of the Cost Center this Server is associated with (through the Project the Farm it belongs to is associated with).c3146a74-3135-451e-b09e-d9882965d57f
SCALR_COST_CENTER_BCThe Billing Code of the Cost Center this Server is associated with.CLOUD-EUROPE
SCALR_COST_CENTER_NAMEThe Name of the Cost Center this Server is associated with.Europe Cloud Infrastructure
SCALR_PROJECT_IDThe ID of the Project this Server is associated with (through the Farm it belongs to).05650aa6-e472-4bae-8532-c57503eb5bb4
SCALR_PROJECT_BCThe Billing Code of the Project this Server is associated with (through the Farm it belongs to).CLOUD-EUROPE-IDENTITY
SCALR_PROJECT_NAMEThe Name of the Project this Server is associated with (through the Farm it belongs to).Europe Cloud Identity Management Infrastructure
  • No labels