> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# credentials

# `prefect_aws.credentials`

Module handling AWS credentials

## Classes

### `ClientType` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-aws/prefect\_aws/credentials.py#L23](https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-aws/prefect_aws/credentials.py#L23)</sup>

The supported boto3 clients.

### `AwsCredentials` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-aws/prefect\_aws/credentials.py#L60](https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-aws/prefect_aws/credentials.py#L60)</sup>

Block used to manage authentication with AWS. AWS authentication is
handled via the `boto3` module. Refer to the
[boto3 docs](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html)
for more info about the possible credential configurations.

**Methods:**

#### `get_boto3_session` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-aws/prefect\_aws/credentials.py#L136](https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-aws/prefect_aws/credentials.py#L136)</sup>

```python theme={null}
get_boto3_session(self) -> boto3.Session
```

Returns an authenticated boto3 session that can be used to create clients
for AWS services.

If `assume_role_arn` is provided, this method will assume the specified IAM role
and return a session with the temporary credentials from the assumed role.

#### `get_client` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-aws/prefect\_aws/credentials.py#L230](https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-aws/prefect_aws/credentials.py#L230)</sup>

```python theme={null}
get_client(self, client_type: Union[str, ClientType])
```

Helper method to dynamically get a client type.

**Args:**

* `client_type`: The client's service name.

**Returns:**

* An authenticated client.

**Raises:**

* `ValueError`: if the client is not supported.

#### `get_s3_client` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-aws/prefect\_aws/credentials.py#L248](https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-aws/prefect_aws/credentials.py#L248)</sup>

```python theme={null}
get_s3_client(self) -> 'S3Client'
```

Gets an authenticated S3 client.

**Returns:**

* An authenticated S3 client.

#### `get_secrets_manager_client` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-aws/prefect\_aws/credentials.py#L257](https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-aws/prefect_aws/credentials.py#L257)</sup>

```python theme={null}
get_secrets_manager_client(self) -> 'SecretsManagerClient'
```

Gets an authenticated Secrets Manager client.

**Returns:**

* An authenticated Secrets Manager client.

### `MinIOCredentials` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-aws/prefect\_aws/credentials.py#L267](https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-aws/prefect_aws/credentials.py#L267)</sup>

Block used to manage authentication with MinIO. Refer to the
[MinIO docs](https://docs.min.io/docs/minio-server-configuration-guide.html)
for more info about the possible credential configurations.

**Attributes:**

* `minio_root_user`: Admin or root user.
* `minio_root_password`: Admin or root password.
* `region_name`: Location of server, e.g. "us-east-1".

**Methods:**

#### `get_boto3_session` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-aws/prefect\_aws/credentials.py#L321](https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-aws/prefect_aws/credentials.py#L321)</sup>

```python theme={null}
get_boto3_session(self) -> boto3.Session
```

Returns an authenticated boto3 session that can be used to create clients
and perform object operations on MinIO server.

#### `get_client` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-aws/prefect\_aws/credentials.py#L353](https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-aws/prefect_aws/credentials.py#L353)</sup>

```python theme={null}
get_client(self, client_type: Union[str, ClientType])
```

Helper method to dynamically get a client type.

**Args:**

* `client_type`: The client's service name.

**Returns:**

* An authenticated client.

**Raises:**

* `ValueError`: if the client is not supported.

#### `get_s3_client` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-aws/prefect\_aws/credentials.py#L371](https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-aws/prefect_aws/credentials.py#L371)</sup>

```python theme={null}
get_s3_client(self) -> 'S3Client'
```

Gets an authenticated S3 client.

**Returns:**

* An authenticated S3 client.
