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

# CREATE DATA SOURCE

<a id="sql-create-data-source" />

Creates a new [data source](/content/concepts/data_sources), which contains
the location and connection information for a data store that is external to
*Kinetica*.  A *data source* serves as an authentication & access mechanism to a
remote resource and can optionally be used as a streaming source as well.

```sql title="CREATE DATA SOURCE Syntax" theme={null}
CREATE [OR REPLACE] [EXTERNAL] DATA SOURCE [<data source schema name>.]<data source name>
LOCATION = '<provider>[://[<host>[:<port>]]]'
[USER = '<username>']
[PASSWORD = '<password>']
[WITH OPTIONS (<option name> = '<option value>'[,...])]
```

A *data source* does not reference specific data files within the source; file
references (if applicable) can be made by using the *data source* in a
[CREATE EXTERNAL TABLE](/content/sql/ddl/create-external-table#sql-create-ext-table) call (for creating a persistent view of the
file data) or a [LOAD INTO](/content/sql/load#sql-load-file-server) call (for either a one-time
load or a subscribed loading of data from the external source to a locally
persisted [table](/content/sql/ddl/create-table#sql-create-table)).

<Info>
  The *data source* will be validated upon creation, by default, and
  will fail to be created if an authorized connection cannot be established.
</Info>

The following *data source* providers are supported:

* Azure *(Microsoft blob storage)*

* GCS *(Google Cloud Storage)*

* HDFS *(Apache Hadoop Distributed File System)*

* JDBC *(Java Database Connectivity, using a user-supplied driver or one of the*
  *drivers on the [supported list](/content/concepts/jdbc_drivers))*

* Kafka *(streaming feed)*

  * *Apache*
  * *Confluent*

* S3 *(Amazon S3 Bucket)*

<Info>
  - Azure anonymous *data sources* are only supported when both the container
    and the contained objects allow anonymous access.
  - HDFS systems with wire encryption are not supported.
  - Confluent & Kafka *data sources* require an associated
    [credential](/content/sql/ddl/create-credential#sql-create-credential) for authentication.
</Info>

For provider-specific syntax, see [Provider-Specific Syntax](/content/sql/ddl/create-data-source#sql-create-data-source-syntax).
For provider-specific examples, see [Creating Data Sources](/content/snippets/create-data-sources).

## Parameters

<AccordionGroup>
  <Accordion title="OR REPLACE" id="or-replace" defaultOpen>
    Any existing *data source* with the same name will be dropped before creating this one
  </Accordion>

  <Accordion title="EXTERNAL" id="external" defaultOpen>
    Optional keyword for clarity
  </Accordion>

  <Accordion title="<schema name>" id="<schema-name>" defaultOpen>
    Name of the *schema* that will contain the created *data source*; if no *schema* is specified,
    the *data source* will be created in the user's [default schema](/content/concepts/schemas#schema-default)
  </Accordion>

  <Accordion title="<data source name>" id="<data-source-name>" defaultOpen>
    Name of the *data source* to create; must adhere to the supported
    [naming criteria](/content/sql/naming#sql-naming-criteria)
  </Accordion>

  <Accordion title="<provider>" id="<provider>" defaultOpen>
    Provider of the *data source*

    Supported providers include:

    <div>
      <table class="table w-full [&_td]:min-w-[150px] [&_th]:text-left [&_td[data-numeric]]:tabular-nums">
        <thead>
          <tr>
            <th>Provider</th>
            <th>Description</th>
          </tr>
        </thead>

        <tbody>
          <tr>
            <td><code>AZURE</code></td>
            <td>Microsoft Azure blob storage</td>
          </tr>

          <tr>
            <td><code>CONFLUENT</code></td>
            <td>Confluent Kafka streaming feed <Note>The `LOCATION` can be a comma-delimited list of Kafka URLs, to be used for high-availability; only one of which will be streamed from at any given time.</Note></td>
          </tr>

          <tr>
            <td><code>GCS</code></td>
            <td>Google Cloud Storage</td>
          </tr>

          <tr>
            <td><code>HDFS</code></td>
            <td>Apache Hadoop Distributed File System</td>
          </tr>

          <tr>
            <td><code>JDBC</code></td>
            <td>JDBC connection, where <code>LOCATION</code> is the JDBC URL. <pre><code class="language-sql">LOCATION = 'jdbc:postgresql://example.com:5432/mydb'</code></pre> See the [supported list](/content/concepts/jdbc_drivers) for the full list of supported drivers, or specify one with <code>JDBC\_DRIVER\_JAR\_PATH</code> and <code>JDBC\_DRIVER\_CLASS\_NAME</code>.</td>
          </tr>

          <tr>
            <td><code>KAFKA</code></td>
            <td>Apache Kafka streaming feed <Note>The `LOCATION` can be a comma-delimited list of Kafka URLs, to be used for high-availability; only one of which will be streamed from at any given time.</Note></td>
          </tr>

          <tr>
            <td><code>S3</code></td>
            <td>Amazon S3 bucket</td>
          </tr>
        </tbody>
      </table>
    </div>
  </Accordion>

  <Accordion title="<host>" id="<host>" defaultOpen>
    Host to use to connect to the *data source*; the following providers have a default *host*, if
    `host` is left blank:

    <div>
      <table class="table w-full [&_td]:min-w-[150px] [&_th]:text-left [&_td[data-numeric]]:tabular-nums">
        <thead>
          <tr>
            <th>Provider</th>
            <th>Default Host</th>
          </tr>
        </thead>

        <tbody>
          <tr>
            <td>*Azure*</td>
            <td><code>\<storage\_account\_name>.blob.core.windows.net</code></td>
          </tr>

          <tr>
            <td>*GCS*</td>
            <td><code>storage.googleapis.com</code></td>
          </tr>

          <tr>
            <td>*S3*</td>
            <td><code>\<region>.amazonaws.com</code></td>
          </tr>
        </tbody>
      </table>
    </div>
  </Accordion>

  <Accordion title="<port>" id="<port>" defaultOpen>
    Port, for HDFS or Kafka, to use to connect to the *data source*
  </Accordion>

  <Accordion title="USER" id="user" defaultOpen>
    Optional user name, given in `<username>`, to use for authenticating to the
    *data source*
  </Accordion>

  <Accordion title="PASSWORD" id="password" defaultOpen>
    Optional password, given in `<password>`, to use for authenticating to the
    *data source*
  </Accordion>

  <Accordion title="WITH OPTIONS" id="with-options" defaultOpen>
    Optional indicator that a comma-delimited list of connection option/value assignments will
    follow.  See [Options](/content/sql/ddl/create-data-source#sql-ds-opts) for the full list of options.
  </Accordion>
</AccordionGroup>

## Examples

To create a *data source*, `kin_ds`, that connects to an Amazon S3 bucket,
`kinetica_ds`, in the **US East (N. Virginia)** region:

```sql CREATE DATA SOURCE Example theme={null}
CREATE DATA SOURCE kin_ds
LOCATION = 'S3'
USER = '<aws access id>'
PASSWORD = '<aws access key>'
WITH OPTIONS
(
    BUCKET NAME = 'kinetica-ds',
    REGION = 'us-east-1'
)
```

<a id="sql-ds-opts" />

## Options

| Option                             | Provider             | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ---------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `CREDENTIAL`                       | *Any*                | [Credential](/content/sql/ddl/create-credential#sql-create-credential) object to use to authenticate to the remote system                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `VALIDATE`                         | *Any*                | Whether to test the connection to the *data source* upon creation; if `TRUE` *(default)*, the creation of a *data source* that cannot be connected to will fail; if `FALSE`, the *data source* will be created regardless of connectivity                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `WAIT TIMEOUT`                     | *Any* except `JDBC`  | Timeout in seconds for reading from the storage provider                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `USE_MANAGED_CREDENTIALS`          | `AZURE`, `GCS`, `S3` | Whether to connect to the storage provider with provider-managed credentials <br /> <br /> `AZURE`: Use the *Azure Instance Metadata Service (IMDS)* endpoint local to the Kinetica cluster to acquire credentials *(only for on-prem clusters deployed within Azure)* <br /> <br /> `GCS`: Satisfy the [Application Default Credentials](https://cloud.google.com/docs/authentication/application-default-credentials) requirements for credentials, making sure any supporting server-side configuration (files, environment variables) is done on every node in the cluster *(only for on-prem clusters deployed within GCS)* <br /> <br /> `S3`: Use the [AWS Default Credential Provider Chain](https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html) to acquire credentials, making sure any supporting server-side configuration (files, environment variables) is done on every node in the cluster *(only for on-prem clusters deployed within S3)* |
| `CONNECTION TIMEOUT`               | `HDFS`, `S3`         | Timeout in seconds for connecting to a given storage provider                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `CONTAINER NAME`                   | `AZURE`              | Azure storage container name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `SAS TOKEN`                        | `AZURE`              | Azure storage account shared access signature token; this should be an account-level access token, not a container-level one                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `STORAGE ACCOUNT NAME`             | `AZURE`              | Azure storage account name *(only used if* `TENANT ID` *is specified)*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `TENANT ID`                        | `AZURE`              | Azure Active Directory tenant identifier                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `GCS_BUCKET_NAME`                  | `GCS`                | Name of the GCS bucket to use as the data source                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `GCS_PROJECT_ID`                   | `GCS`                | Name of the Google Cloud project to use for request billing                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `GCS_SERVICE_ACCOUNT_KEYS`         | `GCS`                | Text of the JSON key file containing the GCS private key                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `DELEGATION TOKEN`                 | `HDFS`               | Optional Kerberos delegation token for *worker nodes*; if not specified, the token will be acquired from HDFS                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `KERBEROS KEYTAB`                  | `HDFS`               | Location of the Kerberos keytab file in [KiFS](/content/tools/kifs)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `USE KERBEROS`                     | `HDFS`               | Whether to attempt Kerberos authentication to HDFS                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `JDBC_DRIVER_CLASS_NAME`           | `JDBC`               | JDBC driver class name *(optional, if the name is available in the* *JAR file's manifest)*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `JDBC_DRIVER_JAR_PATH`             | `JDBC`               | [KiFS](/content/tools/kifs) path of the JDBC driver JAR file to use                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `KAFKA_TOPIC_NAME`                 | `KAFKA`, `CONFLUENT` | Kafka topic to access                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `SCHEMA_REGISTRY_CREDENTIAL`       | `KAFKA`, `CONFLUENT` | [Credential](/content/sql/ddl/create-credential#sql-create-credential) object to use to authenticate to the Confluent Schema Registry                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `SCHEMA_REGISTRY_LOCATION`         | `KAFKA`,             | Location of the Confluent Schema Registry in format: <br /> <br /> `[storage_path[:storage_port]]` <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `SCHEMA_REGISTRY_PORT`             | `KAFKA`, `CONFLUENT` | Port of the Confluent Schema Registry                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `BUCKET NAME`                      | `S3`                 | Amazon S3 bucket name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `REGION`                           | `S3`                 | Amazon S3 region identifier                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `S3_AWS_ROLE_ARN`                  | `S3`                 | Amazon Resource Name (ARN) specifying the role                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `S3_ENCRYPTION_CUSTOMER_ALGORITHM` | `S3`                 | Algorithm used to encrypt/decrypt data                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `S3_ENCRYPTION_CUSTOMER_KEY`       | `S3`                 | Key used to encrypt/decrypt data                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `S3_USE_VIRTUAL_ADDRESSING`        | `S3`                 | Whether to use virtual addressing when referencing the S3 sink <br /> <br /> `true`: The requests URI should be specified in virtual-hosted-style format where the bucket name is part of the domain name in the URL <br /> <br /> `false`: Use path-style URI for requests                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `S3_VERIFY_SSL`                    | `S3`                 | Whether to verify SSL connections <br /> <br /> `true`: Verify SSL connections *(default)* <br /> <br /> `false`: Don't verify SSL connections; for testing purposes, bypassing TLS errors, self-signed certificates, etc.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |

<a id="sql-create-data-source-syntax" />

## Provider-Specific Syntax

Several authentication schemes across multiple providers are supported.

* [Azure](/content/sql/ddl/create-data-source#sql-create-data-source-azure)
* [GCS](/content/sql/ddl/create-data-source#sql-create-data-source-gcs)
* [HDFS](/content/sql/ddl/create-data-source#sql-create-data-source-hdfs)
* [JDBC](/content/sql/ddl/create-data-source#sql-create-data-source-jdbc)
* [Kafka (Apache)](/content/sql/ddl/create-data-source#sql-create-data-source-kafka)
* [Kafka (Confluent)](/content/sql/ddl/create-data-source#sql-create-data-source-confluent)
* [S3](/content/sql/ddl/create-data-source#sql-create-data-source-s3)

<a id="sql-create-data-source-azure" />

### Azure

Syntax below, examples [here](/content/snippets/create-data-sources#snippet-sql-create-data-source-azure).

<CodeGroup>
  ```sql Credential theme={null}
  CREATE DATA SOURCE [<data source schema name>.]<data source name>
  LOCATION = 'AZURE[://<host>]'
  WITH OPTIONS
  (
      CREDENTIAL = '[<credential schema name>.]<credential name>',
      CONTAINER NAME = '<azure container name>'
  )
  ```

  ```sql Public (No Auth) theme={null}
  CREATE DATA SOURCE [<data source schema name>.]<data source name>
  LOCATION = 'AZURE[://<host>]'
  USER = '<azure storage account name>'
  WITH OPTIONS (CONTAINER NAME = '<azure container name>')
  ```

  ```sql Managed Credentials theme={null}
  CREATE DATA SOURCE [<data source schema name>.]<data source name>
  LOCATION = 'AZURE[://<host>]'
  [USER = '<ad client id>']
  WITH OPTIONS
  (
      USE_MANAGED_CREDENTIALS = true,
      STORAGE ACCOUNT NAME = '<azure storage account name>',
      CONTAINER NAME = '<azure container name>',
      TENANT ID = '<ad tenant id>'
  )
  ```

  ```sql Password theme={null}
  CREATE DATA SOURCE [<data source schema name>.]<data source name>
  LOCATION = 'AZURE[://<host>]'
  USER = '<azure storage account name>'
  PASSWORD = '<azure storage account key>'
  WITH OPTIONS (CONTAINER NAME = '<azure container name>')
  ```

  ```sql SAS Token theme={null}
  CREATE DATA SOURCE [<data source schema name>.]<data source name>
  LOCATION = 'AZURE[://<host>]'
  USER = '<azure storage account name>'
  WITH OPTIONS
  (
      SAS TOKEN = '<sas token>',
      CONTAINER NAME = '<azure container name>'
  )
  ```

  ```sql Active Directory theme={null}
  CREATE DATA SOURCE [<data source schema name>.]<data source name>
  LOCATION = 'AZURE[://<host>]'
  USER = '<ad client id>'
  PASSWORD = '<ad client secret key>'
  WITH OPTIONS
  (
      STORAGE ACCOUNT NAME = '<azure storage account name>',
      CONTAINER NAME = '<azure container name>',
      TENANT ID = '<ad tenant id>'
  )
  ```
</CodeGroup>

<a id="sql-create-data-source-gcs" />

### GCS

Syntax below, examples [here](/content/snippets/create-data-sources#snippet-sql-create-data-source-gcs).

<CodeGroup>
  ```sql Credential theme={null}
  CREATE DATA SOURCE [<data source schema name>.]<data source name>
  LOCATION = 'GCS[://<host>]'
  WITH OPTIONS
  (
  	CREDENTIAL = '[<credential schema name>.]<credential name>',
  	[GCS_PROJECT_ID = '<gcs project id>',]
  	GCS_BUCKET_NAME = '<gcs bucket name>'
  )
  ```

  ```sql Managed Credentials theme={null}
  CREATE DATA SOURCE [<data source schema name>.]<data source name>
  LOCATION = 'GCS[://<host>]'
  WITH OPTIONS
  (
  	USE_MANAGED_CREDENTIALS = true,
  	[GCS_PROJECT_ID = '<gcs project id>',]
  	GCS_BUCKET_NAME = '<gcs bucket name>'
  )
  ```

  ```sql Public (No Auth) theme={null}
  CREATE DATA SOURCE [<data source schema name>.]<data source name>
  LOCATION = 'GCS[://<host>]'
  WITH OPTIONS
  (
  	[GCS_PROJECT_ID = '<gcs project id>',]
  	GCS_BUCKET_NAME = '<gcs bucket name>'
  )
  ```

  ```sql User ID & Key theme={null}
  CREATE DATA SOURCE [<data source schema name>.]<data source name>
  LOCATION = 'GCS[://<host>]'
  USER = '<gcs account id>'
  PASSWORD = '<gcs account private key>'
  WITH OPTIONS
  (
  	[GCS_PROJECT_ID = '<gcs project id>',]
  	GCS_BUCKET_NAME = '<gcs bucket name>'
  )
  ```

  ```sql JSON Key theme={null}
  CREATE DATA SOURCE [<data source schema name>.]<data source name>
  LOCATION = 'GCS[://<host>]'
  WITH OPTIONS
  (
  	GCS_SERVICE_ACCOUNT_KEYS = '<gcs account json key text>',
  	[GCS_PROJECT_ID = '<gcs project id>',]
  	GCS_BUCKET_NAME = '<gcs bucket name>'
  )
  ```
</CodeGroup>

<a id="sql-create-data-source-hdfs" />

### HDFS

Syntax below, examples [here](/content/snippets/create-data-sources#snippet-sql-create-data-source-hdfs).

<CodeGroup>
  ```sql Credential theme={null}
  CREATE DATA SOURCE [<data source schema name>.]<data source name>
  LOCATION = 'HDFS://<host>:<port>'
  WITH OPTIONS (CREDENTIAL = '[<credential schema name>.]<credential name>')
  ```

  ```sql Password theme={null}
  CREATE DATA SOURCE [<data source schema name>.]<data source name>
  LOCATION = 'HDFS://<host>:<port>'
  USER = '<hdfs username>'
  PASSWORD = '<hdfs password>'
  ```

  ```sql Kerberos Keytab theme={null}
  CREATE DATA SOURCE [<data source schema name>.]<data source name>
  LOCATION = 'HDFS://<host>:<port>'
  USER = '<hdfs username>'
  WITH OPTIONS (KERBEROS KEYTAB = 'kifs://<keytab file path>')
  ```

  ```sql Kerberos Token theme={null}
  CREATE DATA SOURCE [<data source schema name>.]<data source name>
  LOCATION = 'HDFS://<host>:<port>'
  USER = '<hdfs username>'
  WITH OPTIONS (USE KERBEROS = true)
  ```
</CodeGroup>

<a id="sql-create-data-source-jdbc" />

### JDBC

Syntax below, examples [here](/content/snippets/create-data-sources#snippet-sql-create-data-source-jdbc).

<CodeGroup>
  ```sql Credential theme={null}
  CREATE DATA SOURCE [<data source schema name>.]<data source name>
  LOCATION = '<jdbc url>'
  WITH OPTIONS
  (
  	CREDENTIAL = '[<credential schema name>.]<credential name>',
  	JDBC_DRIVER_CLASS_NAME = '<jdbc driver class full path>',
  	JDBC_DRIVER_JAR_PATH = 'kifs://<jdbc driver jar path>'
  )
  ```

  ```sql Password theme={null}
  CREATE DATA SOURCE [<data source schema name>.]<data source name>
  LOCATION = '<jdbc url>'
  USER = '<jdbc username>'
  PASSWORD = '<jdbc password>'
  WITH OPTIONS
  (
  	JDBC_DRIVER_CLASS_NAME = '<jdbc driver class full path>',
  	JDBC_DRIVER_JAR_PATH = 'kifs://<jdbc driver jar path>'
  )
  ```
</CodeGroup>

<a id="sql-create-data-source-kafka" />

### Kafka (Apache)

Syntax below, examples [here](/content/snippets/create-data-sources#snippet-sql-create-data-source-kafka).

<CodeGroup>
  ```sql Credential theme={null}
  CREATE DATA SOURCE [<data source schema name>.]<data source name>
  LOCATION = 'KAFKA://<host>:<port>'
  WITH OPTIONS
  (
      CREDENTIAL = '[<credential schema name>.]<credential name>',
      KAFKA_TOPIC_NAME = '<kafka topic name>'
  )
  ```

  ```sql Credential w/ Schema Registry theme={null}
  CREATE DATA SOURCE [<data source schema name>.]<data source name>
  LOCATION = 'KAFKA://<host>:<port>'
  WITH OPTIONS
  (
      CREDENTIAL = '[<credential schema name>.]<credential name>',
      KAFKA_TOPIC_NAME = '<kafka topic name>',
      SCHEMA_REGISTRY_CREDENTIAL = '[<sr credential schema name>.]<sr credential name>',
      SCHEMA_REGISTRY_LOCATION = '<schema registry url>'
  )
  ```

  ```sql Public (No Auth) theme={null}
  CREATE DATA SOURCE [<data source schema name>.]<data source name>
  LOCATION = 'KAFKA://<host>:<port>'
  WITH OPTIONS (KAFKA_TOPIC_NAME = '<kafka topic name>')
  ```
</CodeGroup>

<a id="sql-create-data-source-confluent" />

### Kafka (Confluent)

Syntax below, examples [here](/content/snippets/create-data-sources#snippet-sql-create-data-source-confluent).

<CodeGroup>
  ```sql Credential theme={null}
  CREATE DATA SOURCE [<data source schema name>.]<data source name>
  LOCATION = 'CONFLUENT://<host>:<port>'
  WITH OPTIONS
  (
      CREDENTIAL = '[<credential schema name>.]<credential name>',
      KAFKA_TOPIC_NAME = '<kafka topic name>'
  )
  ```

  ```sql Credential w/ Schema Registry theme={null}
  CREATE DATA SOURCE [<data source schema name>.]<data source name>
  LOCATION = 'CONFLUENT://<host>:<port>'
  WITH OPTIONS
  (
      CREDENTIAL = '[<credential schema name>.]<credential name>',
      KAFKA_TOPIC_NAME = '<kafka topic name>',
      SCHEMA_REGISTRY_CREDENTIAL = '[<sr credential schema name>.]<sr credential name>',
      SCHEMA_REGISTRY_LOCATION = '<schema registry url>'
  )
  ```

  ```sql Public (No Auth) theme={null}
  CREATE DATA SOURCE [<data source schema name>.]<data source name>
  LOCATION = 'CONFLUENT://<host>:<port>'
  WITH OPTIONS (KAFKA_TOPIC_NAME = '<kafka topic name>')
  ```
</CodeGroup>

<a id="sql-create-data-source-s3" />

### S3

Syntax below, examples [here](/content/snippets/create-data-sources#snippet-sql-create-data-source-s3).

<CodeGroup>
  ```sql Credential theme={null}
  CREATE DATA SOURCE [<data source schema name>.]<data source name>
  LOCATION = 'S3[://<host>]'
  WITH OPTIONS
  (
      CREDENTIAL = '[<credential schema name>.]<credential name>',
      BUCKET NAME = '<aws bucket name>',
      REGION = '<aws region>'
  )
  ```

  ```sql Public (No Auth) theme={null}
  CREATE DATA SOURCE [<data source schema name>.]<data source name>
  LOCATION = 'S3[://<host>]'
  WITH OPTIONS
  (
      BUCKET NAME = '<aws bucket name>',
      REGION = '<aws region>'
  )
  ```

  ```sql Managed Credentials theme={null}
  CREATE DATA SOURCE [<data source schema name>.]<data source name>
  LOCATION = 'S3[://<host>]'
  WITH OPTIONS
  (
      USE_MANAGED_CREDENTIALS = true,
      BUCKET NAME = '<aws bucket name>',
      REGION = '<aws region>'
  )
  ```

  ```sql Access Key theme={null}
  CREATE DATA SOURCE [<data source schema name>.]<data source name>
  LOCATION = 'S3[://<host>]'
  USER = '<aws access key id>'
  PASSWORD = '<aws secret access key>'
  WITH OPTIONS
  (
      BUCKET NAME = '<aws bucket name>',
      REGION = '<aws region>'
  )
  ```

  ```sql IAM Role theme={null}
  CREATE DATA SOURCE [<data source schema name>.]<data source name>
  LOCATION = 'S3[://<host>]'
  USER = '<aws access key id>'
  PASSWORD = '<aws secret access key>'
  WITH OPTIONS
  (
      S3_AWS_ROLE_ARN = '<aws iam role arn>',
      BUCKET NAME = '<aws bucket name>',
      REGION = '<aws region>'
  )
  ```
</CodeGroup>
