The Stacktape Console works with your AWS accounts through a connection: an IAM role in your account that Stacktape assumes with short-lived credentials, so you never create or rotate access keys for Stacktape. With it, the Console runs Git deployments, shows logs, metrics and costs, and runs deploys for the CLI when it is signed in. You connect each AWS account once.
The open-source CLI doesn't need a connection. Without a Stacktape account, it deploys with your own AWS credentials. See Use the CLI without an account.
There are two ways to connect an account:
- From the terminal, if you already deploy with the CLI:
stacktape connectsigns you in, creates the connection with your local AWS credentials and adds the Stacktape stacks already in the account as projects and stages. Nothing is redeployed. - In the Console, on the AWS accounts page, as described below.
Connecting costs nothing by itself. The Console is free while the AWS spend it manages for your organization stays at or under $200 a month; see Billing and subscription. AWS bills your account for the resources.
Connect an account in the Console
You need to be an Owner or Admin of the organization.
- Open AWS accounts. With no account connected yet, the page shows Connect an AWS account. To add another account later, click Connect AWS account.
- Fill in Account name, a name your team recognizes, such as
production. You use it in the CLI as--aws-account production. - Click Open AWS CloudFormation. AWS opens in a new tab with everything filled in.
- At the bottom of the AWS page, check the box that lets CloudFormation create IAM resources, then choose Create stack.
- Come back to the Console. Setup takes about a minute after you choose Create stack. The page shows Connected when it's done.
The role has administrator access, so Stacktape can create and update everything your configurations declare. See AWS permissions for what it can do and how to restrict it.
The connection stack is always created in eu-west-1. That doesn't limit where you deploy: your projects can deploy
to any region Stacktape supports.
To bring in stacks that were deployed before the account was connected, open the account's menu and choose Find existing stacks.
Account status
The Status column on the AWS accounts page says what Stacktape can do with each account:
| Status | Meaning | What to do |
|---|---|---|
| Connected, Can deploy | Stacktape deploys your projects here and shows their logs, metrics and costs. | Nothing. |
| Connected, Read-only | Stacktape shows logs, metrics and costs but can't deploy. | An Owner or Admin can click Allow deploys. |
| Connecting | The role is being created in AWS. | Wait; the page updates by itself. |
| Setup not finished | Someone started connecting, and AWS hasn't confirmed it. | Click Finish setup to see what to check. |
| Could not connect | The CloudFormation stack in AWS failed. | Click Finish setup to see what to do. |
| No access | The role was deleted in AWS, or Stacktape can't reach the account. | Disconnect the account, then connect it again. |
Common tasks
Connecting multiple AWS accounts
Organizations commonly connect separate AWS accounts for different purposes, such as a production account with stricter controls and a development account for experimentation. Click Connect AWS account and repeat the steps for each additional account.
Choosing the account for a CLI command
CLI commands that work with a deployed stack, such as deploy, delete and rollback, run in one connected account. The CLI picks it in this order:
--aws-account <name>, the account's name in the Console.- The account your local AWS credentials belong to:
--profile, thenAWS_PROFILE, thenAWS_ACCESS_KEY_IDin the environment. The CLI reads the account ID from the profile'ssso_account_idorrole_arnwhen it can, and otherwise asks AWS STS. - The default saved with
stacktape defaults set. - Your organization's only connected account.
If the local credentials belong to an account that is not connected, the command stops before it changes anything and lists the connected accounts. It also stops when their account cannot be determined, for example when an SSO session has expired, and when a profile and environment keys point to different accounts. To deploy anyway, pass --aws-account, unset the profile, or connect the account.
--aws-account takes precedence over a profile; the CLI prints a line saying the profile is ignored. AWS credentials in environment variables are still used for the deployment when they are set, so they must belong to the selected account.
Each of these commands prints the account it uses, for example AWS credentials loaded via Stacktape for account production (222222222222).
Revoking access
Revoking stops Console deploys to the account. Your deployed stacks keep running. You can revoke access in two ways:
- Disconnect the account in the Stacktape Console: open the account's menu on the AWS accounts page and choose Disconnect account. This removes the connection from Stacktape's side.
- Delete the CloudFormation connection stack in the AWS Console: this removes the IAM role from your AWS account. The Console then shows the account as No access.
Updating an older connection
A connection made from an older template shows an Update button next to it. It opens a dialog with the steps and a link that updates the connection stack in AWS CloudFormation, so the audit log can name the person behind each AWS action.
Checking which regions an account uses
The Regions column of the AWS accounts page shows the regions each account has deployments in. Stacktape checks them once the account is connected.
Troubleshooting
Account stuck in Connecting or Setup not finished
- Click Finish setup. If you closed AWS before creating the stack, choose Open AWS again. If AWS reports a stack creation failure, the Console shows why.
- Check that the stack is created in the eu-west-1 region. The link the Console opens targets it automatically.
- If you can't complete the AWS side, an Owner or Admin can remove the account from its menu and start a new connection.
Cannot disconnect an AWS account
Disconnect account fails while Git deployments of a project target the account, and the error lists those projects. In each one, open the Project settings menu (the cog on the project page), choose Configure Git deployments and remove the rules that deploy to this account. Then disconnect again. Right after that, the Console may still be removing the account's build runner; try again a few minutes later.
Account shows No access
The connection is no longer usable: someone deleted Stacktape's role in AWS, or Stacktape can't reach the account. Deploys to it fail and its logs can't be shown. Disconnect the account, then connect it again.
"You do not have permission to manage AWS accounts"
Connecting and disconnecting accounts is for Owners and Admins. Ask one of them, or ask for that role. See Team and access control for details.
Related features
- AWS permissions — details on what the cross-account role can do
- Organizations, projects, and stages — how connected accounts relate to your project structure
- Git deployments — deploy to connected accounts on push
- Add the Console — connect the Console to stacks you deployed with the CLI