Getting Started: Your First Scan in 15 Minutes
LeftSize is like Dependabot for cloud waste. A GitHub Action scans your AWS, Azure or Cloudflare account with read-only access and opens GitHub Issues for idle and orphaned resources, with remediation steps. On the Team and Business plans it also reports upcoming service retirements and security and governance gaps.
Setting up takes about 15 minutes. The first issues appear a few minutes after the first scan runs.
How it works
- Install the LeftSize GitHub App on your organization or personal account
- Connect your cloud account with read-only access: OIDC on AWS and Azure (no cloud credentials are stored), a read-only API token on Cloudflare
- Scan automatically every day with GitHub Actions
- Act on findings delivered as GitHub Issues with step-by-step guidance
Step 1: Install the GitHub App
Install the LeftSize GitHub App and choose the repositories that should receive scan results. You can start with one repository and add more later.
Use a private repository. LeftSize issues list your resource names, and on a public repository any GitHub user can comment @leftsize commands that close them. A dedicated private repository such as cloud-findings works well.
After installation, GitHub sends you to the LeftSize onboarding page. Sign in with GitHub so LeftSize can confirm you have access to the installation, then pick the repository and the cloud you want to scan. The onboarding page gives you:
- Your installation ID and a repository token, which you store as the
LEFTSIZE_INSTALLATION_IDandLEFTSIZE_REPOSITORY_TOKENsecrets. Save the token right away. If you lose it, remove the repository from the GitHub App and add it again to get a new one. - The workflow file for your cloud, ready to commit.
- The steps to set up read-only access in Azure, AWS or Cloudflare. For Cloudflare it also gives a link that opens the Cloudflare dashboard with a read-only API token ready to create.
Step 2: Set up cloud authentication
On AWS and Azure, the generated workflow uses OpenID Connect (OIDC) to sign in to your cloud, the recommended setup. No long-lived cloud credentials are stored: GitHub Actions requests a short-lived token for each scan run. Other sign-in methods also work; see the setup guides.
Cloudflare has no OIDC for API tokens, so the Cloudflare workflow uses a read-only API token that you store as a GitHub secret. It stays on your runner; LeftSize never receives it.
- Azure Setup Guide: an App Registration with federated credentials
- AWS Setup Guide: an IAM OIDC provider with an assumed role
- Cloudflare Setup Guide: an account-owned, read-only API token
Step 3: Add the workflow
The onboarding page generates a workflow for your repository. Commit it as .github/workflows/leftsize.yml. The Workflow Reference shows the full file, explains each part and lists every input and output.
The workflow includes:
- A daily schedule at a fixed time that is different for each repository, to spread the load
- Manual runs via
workflow_dispatch - OIDC sign-in to AWS or Azure, which needs the
id-token: writepermission (the Cloudflare workflow passes the API token instead) - Multiple environments via a matrix on AWS and Azure (for example, scan PROD and DEV separately)
To scan more than one cloud, put one job per cloud in the same workflow. See Scanning several clouds from one workflow.
Use a Linux runner such as ubuntu-latest. The action installs Python 3.11 and Cloud Custodian on the runner at the start of each run; Linux is the runner type it’s tested on.
Step 4: Add secrets and variables
Add the secrets the onboarding page lists under Settings > Secrets and variables > Actions.
Azure
| Secret | Description |
|---|---|
AZURE_CLIENT_ID_MAIN |
App Registration client ID |
AZURE_SUBSCRIPTION_ID_MAIN |
Subscription to scan |
AZURE_TENANT_ID |
Microsoft Entra tenant ID |
LEFTSIZE_INSTALLATION_ID |
Provided during onboarding |
LEFTSIZE_REPOSITORY_TOKEN |
Provided during onboarding |
AWS
| Secret | Description |
|---|---|
AWS_ROLE_ARN_MAIN |
ARN of the IAM role the workflow assumes |
LEFTSIZE_INSTALLATION_ID |
Provided during onboarding |
LEFTSIZE_REPOSITORY_TOKEN |
Provided during onboarding |
| Variable | Description |
|---|---|
AWS_REGIONS |
Regions to scan, comma-separated (for example us-east-1,eu-west-1), or all. If you leave it empty, only the login region (us-east-1 in the generated workflow) is scanned. |
Cloudflare
| Secret | Description |
|---|---|
CLOUDFLARE_API_TOKEN |
The read-only Cloudflare API token |
LEFTSIZE_INSTALLATION_ID |
Provided during onboarding |
LEFTSIZE_REPOSITORY_TOKEN |
Provided during onboarding |
| Variable | Description |
|---|---|
CLOUDFLARE_ACCOUNT_IDS |
Optional. Account IDs to scan, comma-separated. If you leave it empty, every account the token can read is scanned. |
LEFTSIZE_REPOSITORY_TOKEN lets the workflow send findings to LeftSize for this repository only. Keep it secret like any other token.
Step 5: Run your first scan
Wait for the scheduled run or start one yourself:
- Go to your repository’s Actions tab
- Select LeftSize Cost Optimization Scan (on Cloudflare: LeftSize Cloudflare Scan)
- Click Run workflow
The run’s job summary lists what the scan found. A minute or two later, the findings appear as issues in the repository’s Issues tab. Each issue includes:
- What the problem is and why it matters
- The affected resources
- Estimated monthly savings (for cost findings)
@leftsizecommands for more guidance
Plans
The Free plan opens issues for the 81 cost optimization rules in up to 3 repositories. Team ($79/month) adds the deprecation, security and governance rules for up to 10 repositories, and Business ($249/month) has unlimited repositories. Plans apply per GitHub organization or personal account. See Plans and Pricing.
What’s next
- Learn about the commands you can use on issues
- Set up reports to track findings and savings
- Browse the rules catalog to see what LeftSize checks
- Read how it works for a deeper look
Was this article helpful?