---
title: How do I setup env0 to use the same state file even if I'm deploying resources to different accounts?
description: How to centralize my state management to one account
---

[Skip to content](https://support.env0.com/migration/how-do-i-setup-env0-to-use-the-same-state-file-even-if-im-deploying-resources-to-different-accounts#main-content)

English

Show submenu for translations

![env0 logo - transparent.png\]](https://support.env0.com/hs-fs/hubfs/Logos/env0%20logo%20-%20transparent.png?height=40&name=env0%20logo%20-%20transparent.png)

- [Default HubSpot Blog](https://6165570.hs-sites.com/blog)

Open main navigation

Close main navigation

- [Default HubSpot Blog](https://6165570.hs-sites.com/blog)
- English
  
  Show submenu for translations
- [env0.com](https://www.env0.com/)

[env0.com](https://www.env0.com/)

 Hello, How can we help you?

- There are no suggestions because the search field is empty.

1. [Help Center](https://support.env0.com/migration?hsLang=en)
2. [Advanced](https://support.env0.com/migration/advanced?hsLang=en)
3. [Remote State](https://support.env0.com/migration/advanced?hsLang=en#remote-state)

# How do I setup env0 to use the same state file even if I'm deploying resources to different accounts?

## How to centralize my state management to one account

**Background**

As you deploy your infrastructure across many different target cloud accounts, you may want to have a centralized location for all the state files that need to be maintained and managed.

**How To**  
In Terraform, when preparing your backend config it is important to utilize one of the many options to help ensure your backend resides in the same account. For example, with s3, you can utilize the role\_arn and bucket to help ensure that we will authenticate into a singular AWS account and use the same bucket for all of your infrastructure state files.

See the below backend configuration example:

```
backend"s3" {  bucket="env0-acme-tfstate"  dynamodb_table="env0-acme-tfstate-lock"  key="acme-demo-s3"  region="us-west-2"  # env0 will chain from the deployment role configured in the project -   # this means you need to setup trust between the deployer role and the role  # defined below  role_arn="arn:aws:iam::123456789:role/env0-acme-assume-role"    ## (optional)  #external_id = specified in env0 through ENV0_TERRAFORM_BACKEND_CONFIG=external_id=<your external id> }
```

**Alternatives**

The example above uses an assume role, but you can also consider configuring AWS [profiles](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) using [Custom Flows (env0.yaml](https://docs.env0.com/docs/custom-flows)).

**Reference:**

- https://www.terraform.io/language/settings/backends/s3#assume-role-configuration
- https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html

If you'd like more information, please feel free to reach out to us through our website chat or email us at support@env0.com.

- [Using env0](https://support.env0.com/migration/using-env0?hsLang=en#main-content)
  
  
  
  
  
    - [Self-Hosted Agent](https://support.env0.com/migration/using-env0?hsLang=en#self-hosted-agent)
    - [FAQ](https://support.env0.com/migration/using-env0?hsLang=en#faq)
- [Advanced](https://support.env0.com/migration/advanced?hsLang=en#main-content)
  
  
  
  
  
    - [VCS Integrations](https://support.env0.com/migration/advanced?hsLang=en#vcs-integrations)
    - [Remote State](https://support.env0.com/migration/advanced?hsLang=en#remote-state)
    - [Agent](https://support.env0.com/migration/advanced?hsLang=en#agent)
    - [Terragrunt](https://support.env0.com/migration/advanced?hsLang=en#terragrunt)
    - [AWS](https://support.env0.com/migration/advanced?hsLang=en#aws)
- [Troubleshooting](https://support.env0.com/migration/troubleshooting?hsLang=en)

- [Default HubSpot Blog](https://6165570.hs-sites.com/blog)

[![env zero logo](https://support.env0.com/hubfs/envzero_logo_black_rgb-2.svg "env zero logo")](https://www.env0.com)

env0 Help Center

<https://www.facebook.com/envzero/> <https://twitter.com/envZero> <https://www.linkedin.com/company/env0/> <https://www.youtube.com/channel/UC2rSNWiZ2bvIc5NalLTPjJA>

Copyright © 2026, env zero