Home icon

Build preview environments for Amazon ECS applications with AWS Copilot

Containers Blog



This article provides a step-by-step guide on how to build preview environments for Amazon ECS applications using AWS Copilot and GitLab. It discusses the advantages of having dedicated preview environments for testing code changes before merging them into the main codebase, and how AWS Copilot can help automate this process.

Specifically, the article covers:

  • Prerequisites: Git, GitLab, GitLab Runner, AWS CLI, Docker, AWS Copilot CLI, and an AWS account
  • Walkthrough steps:
    1. Creating a GitLab repository
    2. Building and pushing a CI image to the GitLab Registry
    3. Bootstrapping AWS Copilot App and Dev environments using scripts
    4. Setting up GitLab Pipeline environment variables
    5. Pushing code to the GitLab repository to trigger preview environment creation
    6. Creating merge requests and cleaning up preview environments
  • Conclusion: Adopting this architecture improves development workflow, mitigates risks, and enhances software quality and reliability.


Go to article

The AWS News Feed is currently looking for gold sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.

Related articles

Nov 21
2025
Build production-ready applications without infrastructure complexity using Amazon ECS Express Mode
Mar 6
2026
Announcing the end-of-support for the AWS Copilot CLI
Jul 10
2024
Announcing AWS App Studio preview
Jul 16
2024
Accelerating development feedback loops with AWS CDK hotswap deployments for Amazon ECS

The AWS News Feed is currently looking for silver sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.