---
title: Connection
description: >-
  lightning connection credentials my-bucket –format profile &gt;&gt;
  ~/.aws/config
canonical: 'https://lightning.ai/docs/cli/stable/command-details/connection'
---
# Connection {#connection}

Work with teamspace data connections.

**Usage:**

```console
lightning connection [OPTIONS] COMMAND [ARGS]...
```

## Commands {#connection-commands}

| Command | Description |
| --- | --- |
| [`credentials`](#connection-credentials) | Print short-lived credentials for a data connection’s bucket. |

## lightning connection credentials {#connection-credentials}

Print short-lived credentials for a data connection’s bucket.

These credentials expire, usually within the hour. Rather than refreshing them yourself, wire this command into an AWS profile as a credential\_process and let the tool re-run it on expiry - the AWS CLI, boto3, rclone, s5cmd and the Go SDK all understand that setting.

Setup:

lightning connection credentials my-bucket –format profile >> ~/.aws/config

Then use it:

aws s3 ls s3://my-bucket –profile my-bucket

**Usage:**

```console
lightning connection credentials [OPTIONS] CONNECTION
```

### Arguments {#connection-credentials-arguments}

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `CONNECTION` | `text` | yes | No description provided. |

### Options {#connection-credentials-options}

| Option | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `--teamspace` | `TEXT` | no | — | The teamspace to use, as a bare name or an ‘owner/teamspace’ slug. Defaults to the current teamspace. |
| `--org` | `TEXT` | no | — | The organization owning the teamspace (if any). Defaults to the current organization.(DEPRECATED: Pass the owner as part of –teamspace instead, e.g. ‘–teamspace owner/teamspace’. This option will be removed in a future release.) |
| `--user` | `TEXT` | no | — | The user owning the teamspace (if any). Defaults to the current user.(DEPRECATED: Pass the owner as part of –teamspace instead, e.g. ‘–teamspace owner/teamspace’. This option will be removed in a future release.) |
| `--format` | `[credential-process|profile]` | no | `'credential-process'` | credential-process emits the JSON AWS tools expect from a credential\_process command. profile emits an ~/.aws/config stanza that calls this command to refresh. |

---

**Navigation**

- Parent: [Command details](/docs/cli/2026.11.20/command-details.md)
