Configuration
Read, update, and manage Elastic Beanstalk environment configuration using the EB CLI.
When to Use
- View or edit environment configuration
- Set or view environment variables
- Scale instances
- Save/apply configuration templates
- Manage environment tags
- Configure HTTPS, scaling, instance type, enhanced health
When NOT to Use
- Creating environments → use
environmentskill - SSL certificate management → use
eb-infraskill - Deploying code → use
deployskill - Secrets Manager / SSM → use
eb-infraskill
Interactive Config Editor
Note:
eb configopens an interactive editor ($EDITOR). For non-interactive use, preferaws elasticbeanstalk describe-configuration-settingsto read andaws elasticbeanstalk update-environment --option-settingsto write.
eb config
eb config <env-name>
Environment Variables
eb printenv # View
eb printenv <env-name> # View specific env
eb setenv KEY1=value1 KEY2=value2 # Set
eb setenv KEY1= # Remove
Quick Scale
eb scale <number>
eb scale <number> <env-name>
Save/Apply Configuration Templates
eb config save --cfg <config-name> # Save current config
eb config --cfg <config-name> # Apply saved config
eb config get <config-name> # Download saved config to .elasticbeanstalk/
eb config put <config-name> # Upload local config to S3
Validate Configuration Before Applying
aws elasticbeanstalk validate-configuration-settings \
--application-name <app-name> \
--environment-name <env-name> \
--option-settings file://options.json \
--output json
Tag Management
eb tags --list # List tags
eb tags --add "Team=backend,Env=prod" # Add
eb tags --update "Env=staging" # Update
eb tags --delete "OldTag" # Delete
Common Configuration Tasks
HTTPS listener:
aws:elbv2:listener:443:
ListenerEnabled: 'true'
Protocol: HTTPS
SSLCertificateArns: arn:aws:acm:region:account:certificate/cert-id
Scaling:
aws:autoscaling:asg:
MinSize: '2'
MaxSize: '10'
aws:autoscaling:trigger:
MeasureName: CPUUtilization
UpperThreshold: '70'
Instance type:
aws:autoscaling:launchconfiguration:
InstanceType: t3.medium
Enhanced health:
aws:elasticbeanstalk:healthreporting:system:
SystemType: enhanced
Platform Gotchas
AL2023/AL2 Node.js: The aws:elasticbeanstalk:container:nodejs namespace (NodeCommand, NodeVersion, etc.) is NOT supported on Amazon Linux 2 or AL2023. It only works on legacy Amazon Linux 1 (AMI). On AL2/AL2023, use a Procfile instead:
# Procfile
web: node app.js
Composability
- Deploy after config change: Use
deployskill - Check status: Use
statusskill - Create new environment: Use
environmentskill - SSL/secrets/database config: Use
eb-infraskill
Additional Resources
Converted and distributed by TomeVault — claim your Tome and manage your conversions.