Skip to main content
Click Duplicate environment to copy an environment. Gapstack adds the selected definitions to a new environment. You choose the AWS account and region. Use the same account or a different one. This is useful when you build the application in a non-prod environment, then promote it to production. Production can be another AWS account or the same account in another region.
Duplicating copies definitions from one environment to another. The new environment gets its own stack when you deploy.

Duplicate Environment. Choose the source, AWS account, region, and what to copy.

What you can copy

On Select the environment element to duplicate, choose any of these: Select Resources when you want the new environment to start from the same resource definitions. You can change names and other settings before you deploy those resources.

First deploy of a duplicate

The first deploy of the new environment creates only the two bootstrap resources Gapstack creates for every new environment:
  1. The artifacts S3 bucket
  2. The GitHub OIDC IAM role used to upload artifacts
The other copied resources stay defined. They are not created in AWS on that first deploy. After the bootstrap finishes, update any names or settings you need. Then deploy again to provision the rest of the resources.
Do not expect Lambdas, APIs, and other application resources to appear in AWS on the first deploy. Review and edit the definitions first.
1

Open Duplicate Environment

Click Duplicate environment. The Duplicate Environment dialog opens.
2

Select the source environment

Choose the environment to duplicate.
3

Choose the AWS account and region

Select the AWS account and region. The form defaults to the project’s account and region. The account must already be connected.
4

Choose what to copy

Select Environment Variables, Resources, and Webhooks as needed. Then click Duplicate.
5

Wait for the bootstrap deploy

The first deploy creates the artifacts bucket and the OIDC role. Watch Workflows until that stack completes.
6

Edit the copied definitions

Update resource names and other settings. Upload artifacts if the new environment needs them. See Deploy a Lambda.
7

Deploy the application resources

Deploy the environment again. Gapstack provisions the resources you left as definitions.
If that first deploy fails, see Failed first deploy.