Tear down accounts
Tear down infrastructure configured with config sets to the specified organizational units and accounts.

Usage

1
tkm org accounts tear-down [ou-path...] \
2
[--account <account_id>]... \
3
[--concurrent-accounts <number>] \
4
[--config-set <config-set>] \
5
[--command-path <command-path>]
Copied!

Positional arguments

    ou-path...
      You can pass one or more organizational unit paths to tear down only the accounts that belong to organizational units located under the given paths in the organization hierarchy.

Options

In addition to the common options, this command has the following options.
    --account <account id>
      Choose accounts to tear down. You can use this option multiple times to specify more accounts.
    --concurrent-accounts <number>
      Number of accounts to tear down concurrently.
    --config-set <config-set>
      Teardown only this config set.
      Optional.
    --command-path <command-path>
      Teardown only stacks under this command path.
      Optional.
      To use this option, also the --config-set option must be given.

IAM permissions

These are the minimum IAM permissions required to run this command.
1
Statement:
2
- Effect: Allow
3
Action:
4
- organizations:ListRoots
5
- organizations:ListTargetsForPolicy
6
- organizations:ListAWSServiceAccessForOrganization
7
- organizations:DescribePolicy
8
- organizations:ListPolicies
9
- organizations:ListAccountsForParent
10
- organizations:ListAccounts
11
- organizations:DescribeOrganization
12
- organizations:ListOrganizationalUnitsForParent
13
Resource: "*"
14
15
# IAM permissions needed to assume role from the target accounts.
16
# Specify resource to restrict access to specific roles.
17
- Sid: IAM
18
Effect: Allow
19
Action:
20
- sts:AssumeRole
21
Resource: "*"
Copied!

Examples

Tear down all accounts in the organization.
1
tkm org accounts tear-down
Copied!
Tear down only accounts that belong to the organizational unit Root/Sandbox or to any organizational units under it.
1
tkm org accounts tear-down Root/Sandbox
Copied!
Last modified 1mo ago