Skip to content

Commit

Permalink
Merge branch 'current' into mwong-auto-copy-header
Browse files Browse the repository at this point in the history
  • Loading branch information
mirnawong1 authored Nov 9, 2023
2 parents 6fe2e77 + 901add3 commit 22bf197
Show file tree
Hide file tree
Showing 18 changed files with 294 additions and 90 deletions.
8 changes: 8 additions & 0 deletions contributing/content-style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,14 @@ dbt officially provides two command line tools for running dbt commands:
- [dbt Cloud CLI](/docs/cloud/cloud-cli-installation) — This tool allows you to develop locally and execute dbt commands against your dbt Cloud development environment from your local command line.
- [dbt Core](https://github.com/dbt-labs/dbt-core) — This open-source tool is designed for local installation, enabling you to use dbt Core on the command line and communicate with databases through adapters.

Here are some examples of what to use and what to avoid: <br />

✅ Set up in the dbt Cloud CLI or dbt Core<br />
✅ Set up in the dbt Cloud CLI or dbt Core CLI<br />

❌ Set up via dbt CLI<br />
❌ Set up in dbt Cloud, **or** via the CLI<br />

### Terms to use or avoid

Use industry-specific terms and research new/improved terminology. Also, refer to the Inclusive Language section of this style guide for inclusive and accessible language and style.
Expand Down
2 changes: 1 addition & 1 deletion website/docs/docs/cloud/about-cloud-develop-defer.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Both the dbt Cloud IDE and the dbt Cloud CLI allow users to natively defer to pr

## Required setup

- You must select the **[Production environment](/docs/deploy/deploy-environments#set-as-production-environment-beta)** checkbox in the **Environment Settings** page.
- You must select the **[Production environment](/docs/deploy/deploy-environments#set-as-production-environment)** checkbox in the **Environment Settings** page.
- This can be set for one deployment environment per dbt Cloud project.
- You must have a successful job run first.

Expand Down
4 changes: 2 additions & 2 deletions website/docs/docs/cloud/about-cloud/regions-ip-addresses.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dbt Cloud is [hosted](/docs/cloud/about-cloud/architecture) in multiple regions
| Region | Location | Access URL | IP addresses | Developer plan | Team plan | Enterprise plan |
|--------|----------|------------|--------------|----------------|-----------|-----------------|
| North America multi-tenant [^1] | AWS us-east-1 (N. Virginia) | cloud.getdbt.com | 52.45.144.63 <br /> 54.81.134.249 <br />52.22.161.231 ||||
| North America Cell 1 [^1] | AWS use-east-1 (N.Virginia) | {account prefix}.us1.dbt.com | [Located in Account Settings](#locating-your-dbt-cloud-ip-addresses) ||||
| North America Cell 1 [^1] | AWS us-east-1 (N.Virginia) | {account prefix}.us1.dbt.com | [Located in Account Settings](#locating-your-dbt-cloud-ip-addresses) ||||
| EMEA [^1] | AWS eu-central-1 (Frankfurt) | emea.dbt.com | 3.123.45.39 <br /> 3.126.140.248 <br /> 3.72.153.148 ||||
| APAC [^1] | AWS ap-southeast-2 (Sydney)| au.dbt.com | 52.65.89.235 <br /> 3.106.40.33 <br /> 13.239.155.206 <br />||||
| Virtual Private dbt or Single tenant | Customized | Customized | Ask [Support](/community/resources/getting-help#dbt-cloud-support) for your IPs ||||
Expand All @@ -34,4 +34,4 @@ dbt Cloud, like many cloud services, relies on underlying AWS cloud infrastructu

* Using hostnames for consistent access &mdash; To ensure uninterrupted access, we recommend that you dbt Cloud services using hostnames. Hostnames provide a consistent reference point, regardless of any changes in underlying IP addresses. We are aligning with an industry-standard practice employed by organizations such as Snowflake.

* Optimizing VPN connections &mdash: You should integrate a proxy alongside VPN for users who leverage VPN connections. This strategy enables steady IP addresses for your connections, facilitating smooth traffic flow through the VPN and onward to dbt Cloud. By employing a proxy and a VPN, you can direct traffic through the VPN and then to dbt Cloud. It's crucial to set up the proxy if you need to integrate with additional services.
* Optimizing VPN connections &mdash; You should integrate a proxy alongside VPN for users who leverage VPN connections. This strategy enables steady IP addresses for your connections, facilitating smooth traffic flow through the VPN and onward to dbt Cloud. By employing a proxy and a VPN, you can direct traffic through the VPN and then to dbt Cloud. It's crucial to set up the proxy if you need to integrate with additional services.
2 changes: 1 addition & 1 deletion website/docs/docs/cloud/secure/ip-restrictions.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ To add an IP to the allowlist, from the **IP Restrictions** page:
4. Select **Allow**
5. Add the ranges in the CIDR notation
- For example, 1.1.1.1/8
- You cannot add multiple ranges in the same rule. Instead, create a rule per CIDR range.
- You can add multiple ranges in the same rule.
6. Click **Save**

Note that simply adding the IP Ranges will not enforce IP restrictions. For more information, see the section “Enabling Restrictions.”
Expand Down
2 changes: 1 addition & 1 deletion website/docs/docs/collaborate/explore-projects.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Try dbt Explorer! It's available in [Public Preview](/docs/dbt-versions/product-
## Prerequisites

- You have a [multi-tenant](/docs/cloud/about-cloud/tenancy#multi-tenant) or AWS single-tenant dbt Cloud account on the [Team or Enterprise plan](https://www.getdbt.com/pricing/).
- You have set up a [production deployment environment](/docs/deploy/deploy-environments#set-as-production-environment-beta) for each project you want to explore.
- You have set up a [production deployment environment](/docs/deploy/deploy-environments#set-as-production-environment) for each project you want to explore.
- There has been at least one successful job run in the production deployment environment.
- You are on the dbt Explorer page. To do this, select **Explore** from the top navigation bar in dbt Cloud.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Starting in dbt v1.6 or higher, `packages.yml` has been renamed to `dependencies

In order to add project dependencies and resolve cross-project `ref`, you must:
- Use dbt v1.6 or higher for **both** the upstream ("producer") project and the downstream ("consumer") project.
- Have a deployment environment in the upstream ("producer") project [that is set to be your production environment](/docs/deploy/deploy-environments#set-as-production-environment-beta)
- Have a deployment environment in the upstream ("producer") project [that is set to be your production environment](/docs/deploy/deploy-environments#set-as-production-environment)
- Have a successful run of the upstream ("producer") project
- Have a multi-tenant or single-tenant [dbt Cloud Enterprise](https://www.getdbt.com/pricing) account (Azure ST is not supported but coming soon)

Expand Down
2 changes: 1 addition & 1 deletion website/docs/docs/dbt-cloud-environments.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ To use the dbt Cloud IDE or dbt Cloud CLI, each developer will need to set up [p

Deployment environments in dbt Cloud are necessary to execute scheduled jobs and use other features. A dbt Cloud project can have multiple deployment environments, allowing for flexibility and customization. However, a dbt Cloud project can only have one deployment environment that represents the production source of truth.

To learn more about dbt Cloud deployment environments and how to configure them, visit the [Deployment environments](/docs/deploy/deploy-environments) page. For our best practices guide, read [dbt Cloud environment best practices](https://docs.getdbt.com/guides/best-practices/environment-setup/1-env-guide-overview) for more info.
To learn more about dbt Cloud deployment environments and how to configure them, refer to the [Deployment environments](/docs/deploy/deploy-environments) page. For our best practices guide, read [dbt Cloud environment best practices](/guides/orchestration/set-up-ci/overview) for more info.
8 changes: 2 additions & 6 deletions website/docs/docs/deploy/deploy-environments.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,12 @@ To create a new dbt Cloud development environment, navigate to **Deploy** -> **E

<Lightbox src="/img/docs/dbt-cloud/cloud-configuring-dbt-cloud/create-deploy-env.jpg" width="85%" title="Navigate to Deploy -> Environments to create a deployment environment" />

### Set as production environment (Beta)
### Set as production environment

import ExpBeta from '/snippets/_explorer-beta-banner.md';

<ExpBeta/>
In dbt Cloud, each project can have one designated deployment environment, which serves as its production environment. This production environment is _essential_ for using features like dbt Explorer and cross-project references. It acts as the source of truth for the project's production state in dbt Cloud.

<Lightbox src="/img/docs/dbt-cloud/using-dbt-cloud/prod-settings.jpg" width="70%" title="Set your production environment as the default environment in your Environment Settings"/>

In dbt Cloud, each project can have one designated deployment environment, which serves as its production environment. This production environment is _essential_ for using features like dbt Explorer and cross-project references. It acts as the source of truth for the project's production state in dbt Cloud.

### Semantic Layer

For Semantic Layer-eligible customers, the next section of environment settings is the Semantic Layer configurations. [The Semantic Layer setup guide](/docs/use-dbt-semantic-layer/setup-sl) has the most up-to-date setup instructions!
Expand Down
2 changes: 1 addition & 1 deletion website/docs/docs/deploy/webhooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ You can also check out the free [dbt Fundamentals course](https://courses.getdbt
- For `write` access to webhooks:
- **Enterprise plan accounts** &mdash; Permission sets are the same for both API service tokens and the dbt Cloud UI. You, or the API service token, must have the [Account Admin](/docs/cloud/manage-access/enterprise-permissions#account-admin), [Admin](/docs/cloud/manage-access/enterprise-permissions#admin), or [Developer](/docs/cloud/manage-access/enterprise-permissions#developer) permission set.
- **Team plan accounts** &mdash; For the dbt Cloud UI, you need to have a [Developer license](/docs/cloud/manage-access/self-service-permissions). For API service tokens, you must assign the service token to have the [Account Admin or Member](/docs/dbt-cloud-apis/service-tokens#team-plans-using-service-account-tokens) permission set.
- You have a multi-tenant deployment model in dbt Cloud. For more information, refer to [Tenancy](/docs/cloud/about-cloud/tenancy).
- You have a multi-tenant or an AWS single-tenant deployment model in dbt Cloud. For more information, refer to [Tenancy](/docs/cloud/about-cloud/tenancy).

## Create a webhook subscription {#create-a-webhook-subscription}

Expand Down
112 changes: 97 additions & 15 deletions website/docs/reference/resource-configs/alias.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,50 @@
---
resource_types: [models, seeds, snapshots, tests]
description: "Read this guide to understand the alias configuration in dbt."
description: "Aliasing a resource lets you give it a custom name in the database instead of using the filename."
datatype: string
---

:::caution Heads up!
This is a work in progress document. While this configuration applies to multiple resource types, the documentation has only been written for seeds.

:::
<Tabs>
<TabItem value="model" label="Models">

## Definition
Specify a custom alias for a model in your `dbt_project.yml` file or config block.

Optionally specify a custom alias for a [model](/docs/build/models) or [seed](/docs/build/seeds).
For example, if you have a model that calculates `sales_total` and want to give it a more user-friendly alias, you can alias it like this:

When dbt creates a relation (<Term id="table" />/<Term id="view" />) in a database, it creates it as: `{{ database }}.{{ schema }}.{{ identifier }}`, e.g. `analytics.finance.payments`
<File name='dbt_project.yml'>

The standard behavior of dbt is:
* If a custom alias is _not_ specified, the identifier of the relation is the resource name (i.e. the filename).
* If a custom alias is specified, the identifier of the relation is the `{{ alias }}` value.
```yml
models:
your_project:
sales_total:
+alias: sales_dashboard
```
</File>
To learn more about changing the way that dbt generates a relation's `identifier`, read [Using Aliases](/docs/build/custom-aliases).
This would return `analytics.finance.sales_dashboard` in the database, instead of the default `analytics.finance.sales_total`.

</TabItem>

<TabItem value="seeds" label="Seeds">

## Usage

### Seeds
Configure a seed's alias in your `dbt_project.yml` file.
Configure a seed's alias in your `dbt_project.yml` file or config block.

The seed at `seeds/country_codes.csv` will be built as a <Term id="table" /> named `country_mappings`.
For example, if you have a seed that represents `product_categories` and want to alias it as `categories_data`, you would alias like this:

<File name='dbt_project.yml'>

```yml
seeds:
your_project:
product_categories:
+alias: categories_data
```

This would return the name `analytics.finance.categories_data` in the database.

In the following second example, the seed at `seeds/country_codes.csv` will be built as a <Term id="table" /> named `country_mappings`.

<File name='dbt_project.yml'>

Expand All @@ -40,3 +57,68 @@ seeds:
```

</File>

</File>
</TabItem>

<TabItem value="snapshot" label="Snapshots">

Configure a seed's alias in your `dbt_project.yml` file or config block.

For example, if you have a snapshot that represents `your_snapshot` and want to alias it as `updated_at_id`, you would alias like this:

<File name='dbt_project.yml'>

```yml
snapshots:
- name: your_snapshot
config:
target_database: analytics
target_schema: finance
unique_key: id
strategy: timestamp
updated_at: updated_at
alias: your_snapshot
```

This would return the name `analytics.finance.your_snapshot` in the database.

</File>
</TabItem>

<TabItem value="test" label="Tests">

Configure a test's alias in your `schema.yml` file or config block.

For example, to add a unique test to the `order_id` column and give it an alias `unique_order_id_test` to identify this specific test, you would alias like this:

<File name='schema.yml'>

```yml
models:
- name: orders
columns:
- name: order_id
tests:
- unique
alias: unique_order_id_test
```

When using `--store-failures`, this would return the name `analytics.finance.orders_order_id_unique_order_id_test` in the database.

</File>
</TabItem>
</Tabs>

## Definition

Optionally specify a custom alias for a [model](/docs/build/models), [tests](/docs/build/tests), [snapshots](/docs/build/snapshots), or [seed](/docs/build/seeds).

When dbt creates a relation (<Term id="table" />/<Term id="view" />) in a database, it creates it as: `{{ database }}.{{ schema }}.{{ identifier }}`, e.g. `analytics.finance.payments`

The standard behavior of dbt is:
* If a custom alias is _not_ specified, the identifier of the relation is the resource name (i.e. the filename).
* If a custom alias is specified, the identifier of the relation is the `{{ alias }}` value.

To learn more about changing the way that dbt generates a relation's `identifier`, read [Using Aliases](/docs/build/custom-aliases).

75 changes: 61 additions & 14 deletions website/docs/reference/resource-configs/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,85 @@
sidebar_label: "database"
resource_types: [models, seeds, tests]
datatype: string
description: "Read this guide to understand the database configuration in dbt."
description: "Override the default database when dbt creates resources in your data platform."
---

:::caution Heads up!
This is a work in progress document. While this configuration applies to multiple resource types, the documentation has only been written for seeds.
<Tabs>
<TabItem value="model" label="Model">

:::
Specify a custom database for a model in your `dbt_project.yml` file.

## Definition
For example, if you have a model that you want to load into a database other than the target database, you can configure it like this:

Optionally specify a custom database for a [model](/docs/build/sql-models) or [seed](/docs/build/seeds). (To specify a database for a [snapshot](/docs/build/snapshots), use the [`target_database` config](/reference/resource-configs/target_database)).
<File name='dbt_project.yml'>

When dbt creates a relation (<Term id="table" />/<Term id="view" />) in a database, it creates it as: `{{ database }}.{{ schema }}.{{ identifier }}`, e.g. `analytics.finance.payments`
```yml
models:
your_project:
sales_metrics:
+database: reporting
```
</File>
The standard behavior of dbt is:
* If a custom database is _not_ specified, the database of the relation is the target database (`{{ target.database }}`).
* If a custom database is specified, the database of the relation is the `{{ database }}` value.
This would result in the generated relation being located in the `reporting` database, so the full relation name would be `reporting.finance.sales_metrics` instead of the default target database.
</TabItem>

To learn more about changing the way that dbt generates a relation's `database`, read [Using Custom Databases](/docs/build/custom-databases)
<TabItem value="seeds" label="Seeds">

Configure a database in your `dbt_project.yml` file.

## Usage
For example, to load a seed into a database called `staging` instead of the target database, you can configure it like this:

### Load seeds into the RAW database
<File name='dbt_project.yml'>

```yml
seeds:
+database: RAW
your_project:
product_categories:
+database: staging
```

This would result in the generated relation being located in the `staging` database, so the full relation name would be `staging.finance.product_categories`.

</File>
</TabItem>

<TabItem value="test" label="Tests">

Configure a database in your `dbt_project.yml` file.

For example, to load a test into a database called `reporting` instead of the target database, you can configure it like this:

<File name='dbt_project.yml'>

```yml
tests:
- my_not_null_test:
column_name: order_id
type: not_null
+database: reporting
```

This would result in the generated relation being located in the `reporting` database, so the full relation name would be `reporting.finance.my_not_null_test`.

</File>
</TabItem>
</Tabs>


## Definition

Optionally specify a custom database for a [model](/docs/build/sql-models), [seed](/docs/build/seeds), or [tests](/docs/build/tests). (To specify a database for a [snapshot](/docs/build/snapshots), use the [`target_database` config](/reference/resource-configs/target_database)).

When dbt creates a relation (<Term id="table" />/<Term id="view" />) in a database, it creates it as: `{{ database }}.{{ schema }}.{{ identifier }}`, e.g. `analytics.finance.payments`

The standard behavior of dbt is:
* If a custom database is _not_ specified, the database of the relation is the target database (`{{ target.database }}`).
* If a custom database is specified, the database of the relation is the `{{ database }}` value.

To learn more about changing the way that dbt generates a relation's `database`, read [Using Custom Databases](/docs/build/custom-databases)



## Warehouse specific information
* BigQuery: `project` and `database` are interchangeable
Expand Down
26 changes: 16 additions & 10 deletions website/docs/reference/resource-configs/enabled.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,20 +261,26 @@ Support for disabling semantic models has been added in dbt Core v1.7

<VersionBlock firstVersion="1.7">

<File name='semantic_models.yml'>

```yml
semantic_models:
- name: semantic_people
model: ref('people')
config:
enabled: false
<File name='dbt_project.yml'>

```yaml
semantic-models:
[<resource-path>](/reference/resource-configs/resource-path):
[+](/reference/resource-configs/plus-prefix)enabled: true | false
```
</File>
The `enabled` configuration can be nested under the `config` key.
<File name='models/semantic_models.yml'>
```yaml
semantic_models:
- name: [<semantic_model_name>]
[config](/reference/resource-properties/config):
enabled: true | false
```
</File>
</VersionBlock>
Expand All @@ -283,7 +289,7 @@ The `enabled` configuration can be nested under the `config` key.
</Tabs>
## Definition
An optional configuration for disabling models, seeds, snapshots, tests, and semantic models.
An optional configuration for enabling or disabling a resource.
* Default: true
Expand Down
Loading

0 comments on commit 22bf197

Please sign in to comment.