# How to Log into AWS

> [!TIP]
>
> Leapp is no longer used for authentication. If you see references to Leapp in older documentation, they are
> deprecated. We now use **Atmos Auth** for AWS authentication.

Locally authenticating with Atmos Auth and AWS Identity Center (AWS SSO)

## Requirements

Atmos Auth is built into the Atmos CLI, so no additional tools are required beyond what's already in the project.

## Authentication

Authentication with Atmos Auth is simple and streamlined. The authentication configuration is already set up in
`atmos.yaml`.

### Quick Login

To authenticate with AWS, run:

```console
atmos auth login --identity vbpt-identity
```

This will:

1. Open your browser to the AWS SSO login page
2. Prompt you to authenticate with your IdP
3. Securely store your credentials in your system keychain
4. Set up the necessary AWS credentials for accessing the infrastructure

### Check Authentication Status

To verify you're authenticated and see your current session details:

```console
atmos auth whoami
```

This will show you:

- Which identity you're using
- The AWS account and role
- Credential expiration time

## Launching Geodesic

After authenticating with Atmos Auth, launch Geodesic as usual:

**First time setup:**

```console
make all
```

**Subsequent launches:**

```console
make run
```

Or directly with the namespace:

```console
vbpt
```

![Geodesic Check](https://docs.cloudposse.com/assets/refarch/geodesic-check.png)

## Daily Workflow

Your typical workflow is now much simpler:

1. Authenticate with Atmos Auth:

   ```console
   atmos auth login --identity vbpt-identity
   ```

2. Launch Geodesic:

   ```console
   make run
   ```

   or

   ```console
   vbpt
   ```

3. Done! You're ready to work with the infrastructure.

## Running Atmos Without Geodesic

With Atmos Auth, you can now run Atmos commands directly on your local machine without launching Geodesic. Once you've
authenticated, the `vbpt-identity` is configured as the default identity, so all Atmos commands will automatically use
your authenticated credentials.

### Direct Atmos Usage

After running `atmos auth login --identity vbpt-identity`, you can execute Atmos commands directly:

```console
# Plan a terraform component
atmos terraform plan vpc -s data-usw2-dev

# Validate your stack configuration
atmos validate stacks

# Describe a component
atmos describe component vpc -s data-usw2-dev

# Run an AWS CLI command
atmos auth exec -- aws sts get-caller-identity
```

All these commands will automatically use the `vbpt-identity` credentials without needing to specify `--identity` each
time.

### When to Use Geodesic vs. Direct Atmos

**Use Geodesic when:**

- You need the full toolbox environment with all pre-installed tools
- You're working on multiple components and want a persistent shell session
- You need to set up Kubernetes access with the `set-cluster` script
- You prefer the containerized environment

**Use direct Atmos when:**

- You're running quick one-off commands
- You want to integrate Atmos into your local scripts or workflows
- You prefer working directly on your local machine

Both approaches work seamlessly with Atmos Auth!

## Additional Information

For more details about Atmos Auth, including advanced features like identity chaining, multiple identities, and
troubleshooting, see the [Atmos Auth documentation](https://atmos.tools/cli/commands/auth/usage/#overview).
