AWS Config Profile Could Not Be Found | Quick Fix Steps

The aws config profile could not be found error means the AWS CLI cannot match your chosen profile to any stored settings or credentials.

When the AWS CLI throws the message the config profile could not be found, work halts right away.
The tool has no idea which access keys, region, or output settings to use, so every command that depends on that profile fails.
The good news is that this error comes from a small set of predictable causes, and once you track those down the fix is usually quick.

What The Aws Config Profile Error Means

The AWS CLI pulls its settings from plain text files in a hidden .aws folder in your home directory.
One file holds credentials, and another holds general configuration such as region and output format.
Each named profile is just a labeled block in those files, and the CLI reads those blocks when you add --profile to a command or when a profile name is chosen through a shell variable.

When the CLI prints aws config profile could not be found, it is saying that the profile name in use does not appear in the loaded configuration.
Either the profile never existed, sits in the wrong file, uses a different label than you expect, or the CLI is reading from different paths than the ones you edited.
In some setups, a typo in a shell variable can send every command to a profile that does not exist at all.

Profiles also matter for tools that sit on top of the AWS CLI, such as wrappers, deployment scripts, or third-party CLIs.
These tools often pass a profile name through to the AWS CLI.
When they send a name that is not present in your .aws folder, the same message appears, even if your default profile works fine in a plain terminal.

Common Causes Of AWS Config Profile Could Not Be Found

Before making big changes, it helps to know the usual suspects behind this error.
Most cases fall into one or more of the points below.

  • Misspelled profile name — The name in --profile or a shell variable does not match the block name in your AWS files.
  • Profile created in only one file — The profile block exists in config but not in credentials, or the other way around, so the CLI cannot load a full set of data.
  • Shell variable points to a dead profile — A variable such as AWS_PROFILE is set to a name that does not exist in your files.
  • Wrong home folder or user — You edit ~/.aws under one user, then run AWS commands under another user, container, or automation runner.
  • Custom file paths — Variables such as AWS_CONFIG_FILE or AWS_SHARED_CREDENTIALS_FILE redirect the CLI to other files, which might not contain the profile yet.
  • Old CLI version with a bug — Certain older releases of the v1 CLI had issues when creating new profiles, and they showed this message even during setup.

Once you know which of these patterns matches your situation, you can lock in a targeted fix, instead of guessing with random commands.
The next sections walk through the fastest checks first, then deeper steps for each operating system.

Quick Checks To Clear Aws Config Profile Issues

Start with quick, low-risk checks that reveal how the AWS CLI sees your setup.
These commands only read settings and do not change anything.

  1. List known profiles — Run aws configure list-profiles and note the output.
    If your chosen profile name is missing from the list, the CLI has no configuration for it yet.
  2. Print the active profile name — In your shell, print the value of the AWS_PROFILE variable.
    On Linux and macOS, use echo $AWS_PROFILE.
    On Windows PowerShell, use echo $Env:AWS_PROFILE.
    If you see a name that is not in the profile list, that mismatch explains the error.
  3. Check the AWS CLI version — Run aws --version.
    If you see a very old v1 version, upgrade to the latest v2 installer from the official AWS download page to avoid past bugs around profile creation.
  4. Confirm file paths — Confirm which files the CLI reads by checking the HOME or USERPROFILE folder and any path variables such as AWS_CONFIG_FILE.
    Make sure you are editing the same files the CLI uses.
  5. Verify the active identity — After you think the profile is fixed, run aws sts get-caller-identity --profile your-profile.
    This confirms that credentials load and that the profile maps to the account you expect.

If these checks show that the profile name does not exist or sits in the wrong place, the next step is to repair the actual configuration files.
That work looks slightly different on each operating system, but the structure stays the same everywhere.

Step By Step Fixes On Each Operating System

The paths for AWS configuration files vary by platform, yet the required contents follow the same pattern.
You need a matching profile block in both the credentials file and the config file so the CLI can load region, output format, and credentials under the same label.

Platform Config File Path Credentials File Path
Linux / macOS ~/.aws/config ~/.aws/credentials
Windows (CMD / PowerShell) %USERPROFILE%\.aws\config %USERPROFILE%\.aws\credentials

Create Or Repair A Profile With Aws Configure

The simplest fix for a missing profile is to run the interactive setup tool and let it create the blocks for you.
This works across Linux, macOS, and Windows.

  1. Run configure with profile name — Use aws configure --profile my-profile, replacing my-profile with the missing profile name.
  2. Enter access keys — Paste the access key and secret key for the IAM user or role you plan to use.
    If you use SSO or a credentials process, follow the pattern required by that method.
  3. Set default region and output — Pick the region you work in most and an output format such as json.
    These settings live in the config file for that profile.
  4. Confirm profile appears in the list — Run aws configure list-profiles again.
    The new profile should now appear, and commands such as aws s3 ls --profile my-profile should work.

Edit Aws Files Directly When Needed

Sometimes a scripted environment or container makes interactive prompts awkward.
In those situations you can edit the AWS files by hand, as long as you follow the expected format for each file.

  1. Open the credentials file — Use a text editor to open the file at the path from the table above.
    Add a block like this for your profile:
    [my-profile]
    aws_access_key_id = YOUR_ACCESS_KEY
    aws_secret_access_key = YOUR_SECRET_KEY
    
  2. Open the config file — In the config file, add a matching block for the same profile:
    [profile my-profile]
    region = us-east-1
    output = json
    

    Note the profile prefix in the header line.
    That prefix is required for named profiles in the config file.

  3. Save and test — Save both files, then run a simple command such as aws sts get-caller-identity --profile my-profile to confirm that the CLI now finds and uses the profile.

Fix Paths And Profiles In Containers And Ci Pipelines

When this error appears only in CI jobs or containers, the cause is often a missing .aws folder inside the container or a mismatch between profile names in your pipeline settings and the files inside the image.

  • Mount the correct .aws folder — Ensure the container receives a volume mount that exposes the host .aws folder, or bake the needed files into the image.
  • Align profile names with secrets — If your pipeline stores keys as separate variables, make sure the scripts that write those keys into files use the same profile name that your commands expect.
  • Upgrade the CLI in your image — Use an up-to-date AWS CLI v2 release in your Docker image or CI executor to avoid old profile handling bugs.

Keeping Aws Config Profiles Aligned Across Tools

Fixing one instance of the error is helpful, but long term stability comes from a clean naming strategy and consistent files.
When scripts, local development, and automation all share the same conventions, the chance of seeing aws config profile could not be found drops sharply.

  1. Choose clear profile names — Use names that reflect the account and stage, such as dev, staging, and prod, or labels that match account aliases.
    Avoid random names that are easy to mistype.
  2. Keep a shared config template — Store a sample config and credentials layout in version control, with placeholder values.
    New team members can copy this pattern and fill in their own keys without guessing the header format.
  3. Document required profiles per project — In each repository, list which profile names scripts expect.
    That way anyone running the tooling knows which profiles they must set up before running deploy or build commands.
  4. Standardize region choices — Pick a main region for each profile and reflect that in the config file.
    When every developer and pipeline uses the same region, surprises around missing resources drop as well.
  5. Check profiles after key rotation — When you rotate IAM access keys or change role setups, update both the credentials file and any secrets storage used by pipelines so that profile names and keys still line up.

Over time this small amount of structure keeps your AWS CLI usage calm.
Instead of chasing random profile mismatches in production deploys, you see predictable profile names and files that line up neatly across machines.

When AWS Config Profile Could Not Be Found Hides Bigger Problems

Sometimes the first sight of AWS Config Profile Could Not Be Found is just the surface symptom of deeper configuration gaps.
A profile might be missing because an account was deleted, a user lost access, or a shared script never had clear ownership in the first place.
Treat the first fix as a chance to tidy up how your team handles AWS access in general.

One common pattern is a single shared profile on a build server that many people rely on.
When that profile disappears or shifts to a different account, the error appears everywhere at once.
Moving toward named profiles per account or per workload, each tied to traceable IAM principals, makes it easier to see who owns which access path.

Another pattern is drift between local machines and automation.
A developer might test commands with a profile that has broad permissions, while the CI pipeline uses a narrower profile that still lacks a proper block in .aws/config.
When aws config profile could not be found appears only in the pipeline, that gap reveals both a missing profile and an opportunity to align access between manual work and automation.

In regulated or security-sensitive environments, profile health ties directly to audit trails.
When every profile name maps cleanly to a role with logging in place, a missing profile message stands out right away and gets fixed before it turns into a quiet outage.
Use these moments as a prompt to check logging, rotation habits, and the way profiles map to accounts and workloads.

With these pieces in place, the AWS CLI becomes a stable and predictable tool instead of a source of surprise errors.
Clear profile names, tidy files, and up-to-date tooling turn the dreaded message AWS Config Profile Could Not Be Found into a short maintenance task instead of a blocking mystery.

Please use a real email you check. If it's fake or mistyped, your message won't reach us and we can't reply — wrong addresses are rejected automatically.