> For the complete documentation index, see [llms.txt](https://v2.dataos.info/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://v2.dataos.info/concepts/resources/lakehouse/supported-sources/lakehouse-on-s3.md).

# Lakehouse on S3

Create a Lakehouse Resource on an Amazon Simple Storage Service (S3) data source.

## Prerequisites

* Access to an S3 bucket with the right permissions.
* PostgreSQL database credentials for the metastore.
* A valid compute resource in your DataOS instance.
* The Lakehouse domain present in the instance.

## Procedure

{% stepper %}
{% step %}

#### Create the metastore secret

Create a secret manifest for the PostgreSQL metastore credentials:

```yaml
name: ${metastore-secret-name}
version: v2alpha
type: secret
description: PostgreSQL metastore secret for Lakehouse
secret:
  type: key-value
  data:
    username: ${postgres-username}
    password: ${postgres-password}
```

Apply the manifest:

```bash
dataos-ctl resource apply -f ${metastore-secret-manifest-path}
```

{% endstep %}

{% step %}

#### Create the storage secret

Create a secret manifest for the S3 storage credentials:

```yaml
name: ${storage-secret-name}
version: v2alpha
type: secret
description: S3 storage secret for Lakehouse
secret:
  type: key-value
  data:
    aws_access_key: ${aws-access-key}
    aws_secret_key: ${aws-secret-key}
    storage_type: s3
```

Apply the manifest:

```bash
dataos-ctl resource apply -f ${storage-secret-manifest-path}
```

{% endstep %}

{% step %}

#### Create the Lakehouse manifest

After you set up the secrets, create the Lakehouse manifest file. This file defines the Lakehouse configuration: compute resource, metastore, storage, and Spark Cluster settings.

```yaml
name: ${lakehouse-name}
version: v1alpha
type: lakehouse
description: Lakehouse on S3 storage
tags:
  - lakehouse
  - s3
spec:
  compute: ${compute-name}
  runAsUser: ${user-id}
  logLevel: INFO
  iceberg:
    metastore:
      type: iceberg-jdbc-catalog
      replicas: 1
      secret: ${tenant}:${metastore-secret-name}
      postgresql:
        host: ${postgres-host}
        port: "5432"
        database: ${database-name}
        schema: public
      hadoopConf:
        fs.s3a.connection.maximum: 1000
      resources:
        requests:
          cpu: "1"
          memory: 1000Mi
        limits:
          cpu: "1"
          memory: 2000Mi
    storage:
      type: s3
      s3:
        bucket: ${s3-bucket-name}
        relativePath: ${relative-path}
        scheme: s3a
        format: ICEBERG
      secret: ${tenant}:${storage-secret-name}
    sherpa:
      replicas: 1
      resources:
        requests:
          cpu: 200m
          memory: 512Mi
        limits:
          cpu: 500m
          memory: 1000Mi
    sparkCluster:
      server:
        requests:
          cpu: 200m
          memory: 512Mi
        limits:
          cpu: 500m
          memory: 1000Mi
      driver:
        coreLimit: "2048m"
        cores: 1
        memory: "2048m"
      executor:
        coreLimit: "2048m"
        cores: 1
        memory: "2048m"
        instances: 1
```

{% endstep %}

{% step %}

#### Apply the Lakehouse manifest

Apply the Lakehouse manifest to provision the Lakehouse. Replace all placeholders (`${}`) with actual values before applying.

```bash
dataos-ctl resource apply -f ${lakehouse-manifest-path}
```

{% endstep %}

{% step %}

#### Verify the Lakehouse creation

Check that the Lakehouse was created successfully:

```bash
dataos-ctl resource get -t lakehouse
```

For detailed status including internal service URLs:

```bash
dataos-ctl resource get -t lakehouse -n ${lakehouse-name} -d
```

{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://v2.dataos.info/concepts/resources/lakehouse/supported-sources/lakehouse-on-s3.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
