Variables

Overview

Variables in Tapitalee are environment variables that are automatically passed to every container in your application. They provide a secure and flexible way to manage application configuration, API keys, database connections, and other settings without hardcoding values in your application code.

Purpose and Benefits

  • Environment Configuration: Manage application settings across different environments
  • Secret Management: Secure storage of sensitive data like API keys and passwords
  • Container Injection: Automatic injection into all processes, tasks, and commands

How Variables Work

Variable Types

  • Regular Variables: Stored in Tapitalee’s database, readable in plain text
  • Secret Variables: Stored encrypted in AWS Secrets Manager within your AWS account
  • Add-on Variables: Automatically created by add-ons (databases, caches, etc.)
  • System Variables: Automatically created by Tapitalee (PORT, etc.)

CLI Usage

Set Variable

tapit  set variable <variable_name> <variable_value> [secret=yes]

Required Parameters

  • variable_name: Name of the environment variable
  • variable_value: Value to assign to the variable

Optional Parameters

  • secret=yes: Store variable as encrypted secret in AWS Secrets Manager

Examples

# Set regular variable
tapit set variable NODE_ENV production

# Set secret variable
tapit set variable API_KEY sk_live_abc123def456 secret=yes

# Set API endpoint
tapit set variable EXTERNAL_API_URL https://api.external.com

Show Variable Value

tapit  show variable <variable_name>

Displays the value of a specific variable (useful for scripts and automation).

List Variables

tapit  list variables

Shows all environment variables configured for your application.

Delete Variable

tapit  delete variable <variable_name>

Removes a variable from your application. Note: Add-on and system variables cannot be deleted directly.

Clone Variables

tapit [-a dest_app_name] clone variables <source_app_name> [exclude=KEY1,KEY2] [from_team=team_name]

Copies environment variables from one application to another.

Parameters

  • source_app_name: Source application to copy variables from
  • exclude: Comma-separated list of variables to exclude from copying
  • from_team: Copy variables from app owned by different team (requires admin access)

Examples

# Copy all variables from staging to production
tapit -a myapp-prod clone variables myapp-staging

# Copy variables excluding secrets
tapit -a myapp-dev clone variables myapp-prod exclude=API_KEY,DATABASE_PASSWORD

# Copy from different team's app
tapit -a myapp clone variables shared-app from_team=shared-team

Import Variables from File

tapit  import variables [secret=yes] < file_with_KEY=value_entries

Bulk import environment variables from a file in KEY=value format.

Parameters

  • secret=yes: Import all variables as encrypted secrets

Examples

# Create variables file
cat > app.env << EOF
NODE_ENV=production
DEBUG=false
CACHE_TTL=3600
EOF

# Import as regular variables
tapit import variables < app.env

# Create secrets file
cat > secrets.env << EOF
DATABASE_PASSWORD=secret123
API_KEY=sk_live_abc123
ENCRYPTION_KEY=key456
EOF

# Import as secrets
tapit import variables secret=yes < secrets.env