> ## Documentation Index
> Fetch the complete documentation index at: https://doc.gapstack.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect an AWS account

> Link your AWS account with a CloudFormation stack and confirm it shows as Connected.

Gapstack provisions infrastructure in **your** AWS account. Connecting an account creates a CloudFormation stack that grants Gapstack permission to do that. You own the account and can revoke access at any time.

<Note>
  You must have **AdministratorAccess** (recommended) or be the root user (not recommended) to create the stack.
</Note>

<Steps>
  <Step title="Open Connect a new account">
    In Gapstack, click **Connect a new account**. You can also open [Organization settings](https://app.gapstack.dev/settings/aws-account) and add the account from there.
  </Step>

  <Step title="Name the account">
    Enter an **Account name** you will recognize, such as `Prod` or `Dev`.

    Select **I have Administrator Access** if you already have an AWS account. Select **Create new AWS Account** only if you need to create one.

    <Frame caption="Name the AWS account, then open the authorization page.">
      <img src="https://mintcdn.com/gapstack/hZS-J-dm559AKp1s/images/connect-aws-account.png?fit=max&auto=format&n=hZS-J-dm559AKp1s&q=85&s=5ec83709176353378119137a73bd4aa0" alt="Connect AWS Account dialog with an account name field, Administrator Access selected, and an Open AWS Authorization Page button." style={{ width: "520px", maxWidth: "100%", height: "auto" }} width="1024" height="792" data-path="images/connect-aws-account.png" />
    </Frame>
  </Step>

  <Step title="Open the AWS authorization page">
    Confirm you are signed in to the correct AWS account in the browser. Click **Open AWS Authorization Page**. AWS opens the CloudFormation **Quick create stack** page in a new tab.

    Gapstack fills the stack name and parameters for you. Leave them unchanged. Do not edit **GapstackAwsAccountId** or **GapstackTenantId**. Those values link the stack to your organization and AWS account.

    <Warning>
      Do not change the CloudFormation template, stack name, parameters, or region. The connection stack must be created in `us-west-1`. You can still deploy environments to any supported region.
    </Warning>

    <Frame caption="Leave the stack name and parameters exactly as Gapstack filled them.">
      <img src="https://mintcdn.com/gapstack/Yx2xDTmoY9M3m64Z/images/connect-aws-cloudformation.png?fit=max&auto=format&n=Yx2xDTmoY9M3m64Z&q=85&s=fcef4b7872b8c723be35b7365a1e1124" alt="AWS CloudFormation Quick create stack page with a pre-filled stack name and GapstackAwsAccountId and GapstackTenantId parameters that must not be edited." width="3984" height="2772" data-path="images/connect-aws-cloudformation.png" />
    </Frame>
  </Step>

  <Step title="Accept the stack and create it">
    Scroll to **Capabilities**. Do not change any parameters on the way.

    1. Select **I acknowledge that AWS CloudFormation might create IAM resources with custom names.**
    2. Click **Create stack**.
  </Step>

  <Step title="Confirm the account is Connected">
    Stack creation takes a few minutes. When it finishes, open [Organization settings](https://app.gapstack.dev/settings/aws-account).

    Refresh the page. The account status should show **Connected**.
  </Step>
</Steps>

<Check>
  The AWS account appears in Organization settings with a **Connected** status.
</Check>

Connecting an account is free. AWS charges begin when you create environments and provision resources in that account.

To show those charges in Gapstack, see [View AWS costs](/guides/view-aws-costs). Leave cost analytics off until you need it.
