Ephemeral Environment
What is an ephemeral environment?
An ephemeral environment is a short-lived clone of the user acceptance testing (UAT) or production environment. Software teams create ephemeral environments to run tests, preview features or collaborate with other teams. Ephemeral environments enable them to catch and remediate bugs and security issues early in the software development lifecycle.
Ephemeral environments are also called "on-demand environments," "dynamic environments" or "temporary environments." They may last only as long as a continuous integration and continuous delivery (CI/CD) pipeline run or an open pull request, or for several weeks in some cases.
How ephemeral environments work
Working with a single staging environment can create a bottleneck for development and QA teams. With ephemeral environments, teams can spin up multiple environments on demand, such as a temporary environment for each pull request. That lets them work on distinct branches for individual features and run all necessary tests before they merge.
An ephemeral environment mirrors the production environment as closely as the team needs, including its configuration and services. A close match helps DevOps teams see how changes will affect existing applications and catch performance or security issues before they reach production. Teams typically use masked or synthetic data instead of copying production data, so a test environment doesn't expose real customer information.
Benefits of ephemeral environments
Ephemeral environments offer several benefits:
- Better collaboration. DevOps, QA, product and sales teams can review updates and their potential impact on the organization and its customers.
- Fewer bottlenecks. On-demand temporary environments reduce bottlenecks in testing and changes. This can lead to faster, more frequent deployments and speed up the whole software development lifecycle.
- Higher software quality. Fewer bugs can increase satisfaction for customers and end users.
- Earlier security testing. Teams can find and fix security vulnerabilities before changes reach production.
- Lower costs. Teams can spin environments up and down in the cloud, including short-lived server instances, which can save money. Organizations pay for resources only while an environment is running.
How to secure ephemeral environments
Ephemeral environments are short-lived, but the access and secrets they use can outlast them. These practices help keep them secure:
- Avoid standing credentials. Give each environment its own ephemeral credentials instead of shared, long-lived ones, and revoke them when the environment is torn down.
- Keep secrets out of code and images. Store application secrets in a secrets manager and inject them at runtime.
- Limit access to what each environment needs. Give developers and test automation just-in-time access scoped to one environment.
- Tear down completely. Delete credentials, network rules and storage when an environment ends, and look for environments that were left running.
- Keep a record. Log who created and used each environment.
More resources
Blogs
Just-in-time access: Strengthening security in a zero-trust world