Skip to main content
CloudThinker runs the AWS CLI against your account to answer questions about compute, storage, identity, cost, and monitoring. You connect with an IAM role that CloudThinker assumes for short-lived credentials (recommended), or with an IAM user’s access keys.

Prerequisites

  • An AWS account where you can create IAM roles (or IAM users, for the access-key method).
  • Access to AWS CloudShell in that account. The setup script runs there, so you install nothing.
  • For cost questions and Optimize: Cost Explorer turned on in the account (Billing and Cost Management → Cost Explorer → Launch Cost Explorer, in the management account for an organization). AWS can take up to 24 hours to activate it on a new account.
  • In an AWS Organization, check your service control policies (SCPs). An SCP that denies sts:AssumeRole from outside principals blocks the role, and one that denies regions hides those regions from agents. From the management account, list the SCPs on the account under AWS Organizations → AWS accounts → your account → Policies, or run aws organizations list-policies-for-target --target-id <account-id> --filter SERVICE_CONTROL_POLICY.
  • Opt-in regions, such as ap-east-1 or me-south-1, are invisible to agents until you enable them under Account → AWS Regions in the AWS console.

Setup

Open the connect dialog first: in the sidebar, click More → Workspace settings → Connections, select Amazon Web Services, and click Connect. Then follow the tab for the method you pick at the top of the dialog.

Connect more accounts

Each AWS account is its own connection. Click Connect again on Amazon Web Services, give the account its own alias, and run the script from that dialog in the new account’s CloudShell. Always copy the script from the dialog you’re completing, so the trust policy carries the External ID that dialog shows. Bulk onboarding isn’t supported yet. Each dialog generates its own External ID, so a StackSet or a single Terraform apply can’t create roles for several connections at once. Each account needs its own dialog and its own role. For many accounts, the fastest path is the Terraform module above, applied once per account with the values from that account’s open dialog. For costs across an AWS Organization, connect the management account. That gives Optimize organization-wide cost only. Agents see resources in a member account only through that account’s own connection.

Connection details

Environment (Production, Staging, Development, or Not set) isn’t in the connect dialog. Set it after connecting, as in the last setup step: it labels the account for people and agents. Approval rules don’t read it, so a Rule that should cover one account names that connection.

Required permissions

The setup scripts attach the AWS managed ReadOnlyAccess policy. It lets agents describe and list resources across services, read CloudWatch metrics, and read Cost Explorer. It can’t create, change, or delete anything.
ReadOnlyAccess can read data as well as configuration, such as S3 objects. A narrower option is AWS managed ViewOnlyAccess plus SecurityAudit, with the ce:Get* reads added for Optimize. It covers listing and describing resources, but not data reads such as S3 object contents or log events. A missing permission never disconnects the account: the answer that needed it fails with AccessDenied, which names the missing action, so you can add just that action to the inline policy.
To switch an existing role to the narrower set, run this in CloudShell:
In Terraform, replace the read_only attachment with attachments for those two policy ARNs and an aws_iam_role_policy holding the ce:Get* statement.

Agent capabilities

Verify the connection

The answer names your real 12-digit account ID.

Example prompts

Write access

Allow writes on the connection’s detail panel controls whether agents may change anything in AWS. It’s on by default for AWS, but the role the script creates is read-only, so AWS itself refuses every write until you grant more. To lock writes in CloudThinker as well, open Amazon Web Services in More → Workspace settings → Connections and turn off the Allow writes switch on its detail panel.

Troubleshooting

Cause: an earlier setup in this account created the role, likely with a different External ID.Fix: if no other CloudThinker connection uses that role, remove its policies and delete it, then run the new script. delete-role fails until every attached and inline policy is gone, so list them first:
To check whether a CloudThinker connection still uses the role, open CloudTrail Event history, filter Event name = AssumeRole, and look for recent events on CloudThinkerAccessRole with a session name starting cloudthinker-. If one does, don’t replace its External ID. Use Manual steps to create a second role with a different name for this workspace instead.
Cause: the trust policy doesn’t match what CloudThinker presents.Check: the ARN you pasted is the one the script printed, and the trust policy’s sts:ExternalId matches AWS External ID in the dialog exactly.Fix: a failed test doesn’t save the connection. Correct the trust policy, then click Connect again in the same dialog so the External ID stays the same. If you closed the dialog, re-run the setup from a fresh one. Retry appears only on a saved connection that later shows Error.
Cause: three background credential failures in a row (a deleted role, a broken trust policy, or a revoked key) switch the connection to Error. Optimize cost refreshes, scheduled automations, and Pulse polling pause for it, and workspace admins get one notification.Fix: repair the role or key in AWS, then click Retry on the connection, or Replace credentials to enter new keys. Scheduled work resumes on its next cycle once the status is Connected.
Check: Cost Explorer is turned on in the AWS Billing console, and at least 24 hours have passed since you turned it on. For a member account in AWS Organizations, the management account may block member access to Cost Explorer.Fix: turn on Cost Explorer, or connect the management account to see costs for the whole organization.
Cause: the test didn’t finish in time. AWS endpoints are public, so it’s rarely your network.Fix: connect again. If it keeps timing out, contact us.
Cause: a service control policy blocks it. The AWS error says the request was denied with an explicit deny in a service control policy. If the SCP denies sts:AssumeRole, the test itself fails.Check: list the SCPs on the account, as in Prerequisites.Fix: ask your AWS Organizations admin to exempt CloudThinkerAccessRole from the SCP, or accept that agents can’t see that region or service.

Security

  • Least privilege — grant only the permissions the agents need for your use case; start read-only and widen later.
  • Read-only by default — use read-only credentials unless you want agents to make changes through this connection.
  • Rotate credentials — rotate keys and tokens on your normal schedule; CloudThinker picks up the new value when you update the connection.
  • Revoke on offboarding — remove the credential at the provider when you delete a connection or a teammate leaves.
  • Prefer the role. CloudThinker assumes the role through AWS STS and gets short-lived credentials, so there’s no long-lived secret to leak. The External ID stops anyone else from using your role through CloudThinker.
  • Audit with CloudTrail. Every call agents make is an ordinary AWS API call. CloudThinker names each role session cloudthinker-<first 8 characters of your workspace ID>-<Unix timestamp>, and CloudTrail Event history shows that session name as the User name. To see every call across sessions, filter on userIdentity.sessionContext.sessionIssuer.userName = CloudThinkerAccessRole in CloudTrail Lake or Athena. For access keys, filter Event history by User name = CloudThinkerUser.

Optimize quickstart

Turn this connection into cost findings and savings recommendations.

Connections

Rotate credentials, set the environment, and read Discovery results.

Approvals

Decide which changes need a person before you grant any write permission.