.ebextensions is a directory in an application’s root folder containing instructions that Elastic Beanstalk processes before the application starts. It customizes the hosting environment when local filesystem mounting is unavailable. section 12.3.5
A configuration file can prepare a deployment by:
- Creating a directory on the EC2 instance. section 12.3.5
- Writing a file with multiline content using the pipe character and indentation. section 12.3.5
- Setting file permissions, owner, and group. section 12.3.5
Providing Streamlit secrets
Create .ebextensions/secrets_file.config with a files entry targeting /var/app/secrets/.streamlit/secrets.toml. Set mode to 000644, assign ownership to webapp, and place the secrets.toml contents under content. An edited docker-compose.yml can then mount /var/app/secrets/.streamlit into /app/.streamlit.
Listing 12.5 .ebextensions/secrets_file.config
files:
"/var/app/secrets/.streamlit/secrets.toml":
mode: "000644"
owner: webapp
group: webapp
content: |
llm_api_key = "sk-proj-..." #1
Inspect the complete configuration example for generating a secrets.toml file during Elastic Beanstalk deployment. section 12.3.5
