- A CloudThinker workspace. The quickstart creates one.
- Permission to create IAM roles in each AWS account, and access to AWS CloudShell in each one.
- For cost questions: Cost Explorer turned on in each account. AWS can take up to 24 hours to activate it on a new account. The role’s
ReadOnlyAccesspolicy already includes thece:Get*reads Optimize uses. AWS bills Cost Explorer API requests separately (USD 0.01 per request at AWS list price).
How multiple accounts work
Each AWS account is its own connection in CloudThinker. There’s no hub account and no role chaining to set up. When you connect an account, CloudThinker assumes a read-only role in that account (CloudThinkerAccessRole) and gets short-lived credentials for it.
Agents pick an account from two fields you fill in when you connect it:
Connect the accounts
Repeat these steps once per account. There’s no organization-wide or StackSets onboarding: each account needs its own connect dialog, because each dialog generates its own External ID. If you’d rather create the roles with Terraform or CloudFormation, expand Manual steps in each dialog for the trust policy. The full reference, including the access-key method, is on the AWS connection page.1
Open the connect dialog
In the sidebar, click More → Workspace settings → Connections, select Amazon Web Services, and click Connect. Keep Role-Based (recommended) selected.
2
Name the account
Fill in Alias and Description using the table above. Default AWS region (optional) is only a starting point: agents can use any region the role can reach.
3
Run the setup script in that account
Click Open CloudShell and sign in to the AWS account you’re connecting. Back in the dialog, click Copy Script to Clipboard, paste it into CloudShell, and press Enter. The script creates
CloudThinkerAccessRole with the AWS managed ReadOnlyAccess policy and prints the role’s ARN.ReadOnlyAccess can read data as well as configuration, such as S3 objects. For a narrower role, see Required permissions for the ViewOnlyAccess plus SecurityAudit option and what it gives up.4
Paste the Role ARN and connect
Paste the ARN into AWS Role ARN, leave AWS External ID as it is, and click Connect.Success state: the account shows a Connected status.
5
After connecting, set the environment
The connect dialog doesn’t ask for an environment, so set it now. On the Amazon Web Services detail panel, click the pencil icon on the account’s row and set Environment to Production, Staging, or Development in Edit Instance. It labels the account for people and agents. Approval Rules don’t read it. A Rule has no Environment field, so it covers an account only when you pick that connection under Connections.
production, staging, and development, each Connected.
Check which accounts agents can reach
Before you compare anything, confirm every account answers. In a new conversation, ask:AccessDenied there. If an account is missing or shows an error, fix it now (see Troubleshooting) so later comparisons don’t silently skip it.
Compare spend across accounts
You have two routes. Use Optimize when you want saved, repeatable numbers. Use a chat prompt when you have a one-off question.Generate an all-accounts report
1
Open Reports
In the sidebar, select Optimize → Reports.
2
Pick the scope
Choose All accounts in the selector above the report cards.
3
Pick a report
Select Savings opportunities.Success state: a new conversation opens, and the finished report appears as an artifact with one section per account.
Ask in chat
Name the accounts by alias so there’s no guessing:Find cost waste in each account
Non-production accounts often collect forgotten resources. Ask the same question of every account at once:Find security issues across accounts
TheReadOnlyAccess role lets agents review IAM roles, users, and policies in every connected account. Two prompts that pay off quickly:
Every call an agent makes is an ordinary AWS API call. To see exactly what ran in an account, filter CloudTrail in that account by
CloudThinkerAccessRole.Let agents make changes in some accounts only
The setup script’s role is read-only, so AWS refuses every write in every account until you grant more. To let agents fix things in, say, development but never in production:-
Add only the write actions you need to
CloudThinkerAccessRolein the development account. Leave the production role onReadOnlyAccess. For example, this inline policy lets agents stop and start only instances taggedenv=dev: - Check the Allow writes switch on the Amazon Web Services detail panel in Connections. It’s on by default for AWS. Turn it off on any connection that should stay read-only even if its role changes later.
- Add an Ask first Rule and pick the staging and production connections under Connections, so a person signs off before a write runs there. Rule enforcement is off by default and CloudThinker turns it on per workspace, so until then keep the Approval mode on Manual — that is what makes a write wait for a person today.
Troubleshooting
An account is missing from the answer
An account is missing from the answer
Cause: the connection isn’t Connected, or its Description is too vague for agents to match it to your prompt.Fix: check the account’s status in More → Workspace settings → Connections. Then edit its Description to say what the account holds, and name it by alias in your prompt.
The second account fails with AccessDenied on sts:AssumeRole
The second account fails with AccessDenied on sts:AssumeRole
Cause: the script or trust policy came from a different account’s dialog, so the External ID doesn’t match.Fix: open a fresh connect dialog for that account and run the script it shows. If Otherwise, expand Manual steps in the dialog and update the existing role’s trust policy with the External ID it shows.
CloudThinkerAccessRole already exists there, the script stops. If no other CloudThinker connection uses that role, delete it in CloudShell and run the new script:Cost questions return no data for one account
Cost questions return no data for one account
Check: Cost Explorer is on in that account and has had 24 hours to activate. Member accounts in AWS Organizations may be blocked from Cost Explorer by the management account.Fix: turn on Cost Explorer, or connect the management account to see costs for the whole organization.
A scheduled all-accounts report skips a new account
A scheduled all-accounts report skips a new account
Cause: a report schedule keeps the accounts it captured when you created it. Accounts you connect later aren’t added.Fix: recreate the schedule on Optimize → Reports with All accounts selected.
Next steps
Connect an AWS account
Every field, permission, and fix for a single AWS connection.
Optimize reports
Generate or schedule savings reports for one account or all of them.