Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ jobs:
pagerduty
homebrew
datadog
snowflake
)
for i in "${array[@]}"
do
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ This repository contains documentation for StackQL providers, which is published
| Netlify Deploy Confluent | [![Netlify Status](https://api.netlify.com/api/v1/badges/63149c2f-6c3d-43f1-be38-80c55c223ac0/deploy-status)](https://app.netlify.com/sites/stackql-confluent-docs/deploys) | [confluent-docs.stackql.io](https://confluent-docs.stackql.io)<br/>[confluent.stackql.io](https://confluent.stackql.io) |
| Netlify Deploy Databricks Account | [![Netlify Status](https://api.netlify.com/api/v1/badges/9250b360-9e36-49dd-8cc8-b8cbe2f8d983/deploy-status)](https://app.netlify.com/sites/stackql-databricks-account-docs/deploys) | [databricks-account-docs.stackql.io](https://databricks-account-docs.stackql.io)<br/>[databricks-account.stackql.io](https://databricks-account.stackql.io) |
| Netlify Deploy Databricks Workspace | [![Netlify Status](https://api.netlify.com/api/v1/badges/7456d122-1d4a-445c-b410-7a9aa1bd3f05/deploy-status)](https://app.netlify.com/sites/stackql-databricks-workspace-docs/deploys) | [databricks-workspace-docs.stackql.io](https://databricks-workspace-docs.stackql.io)<br/>[databricks-workspace.stackql.io](https://databricks-workspace.stackql.io) |
| Netlify Deploy Snowflake | [![Netlify Status](https://api.netlify.com/api/v1/badges/e14bf4c8-1dca-4250-a19b-bffaa62fac9a/deploy-status)](https://app.netlify.com/projects/stackql-snowflake-docs/deploys) | [snowflake-docs.stackql.io](https://snowflake-docs.stackql.io)<br/>[snowflake.stackql.io](https://snowflake.stackql.io) |

## Adding Docs for a New Provider

Expand Down
1 change: 1 addition & 0 deletions ci-scripts/get-providers-to-deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const allProviders = [
'pagerduty',
'datadog',
'homebrew',
'snowflake',
rootName];

const appendToOutput = (providers) => {
Expand Down
117 changes: 117 additions & 0 deletions docs/snowflake-docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
---
title: snowflake
hide_title: false
hide_table_of_contents: false
keywords:
- snowflake
- stackql
- infrastructure-as-code
- configuration-as-data
- cloud inventory
description: Query, deploy and manage Snowflake resources using SQL
custom_edit_url: null
image: /img/providers/snowflake/stackql-snowflake-provider-featured-image.png
id: snowflake-doc
slug: /providers/snowflake

---

import CopyableCode from '@site/src/components/CopyableCode/CopyableCode';

Snowflake for managing data warehousing, analytics, and secure data sharing with scalable cloud-native architecture and pay-as-you-go pricing.


:::info Provider Summary

<div class="row">
<div class="providerDocColumn">
<span>total services:&nbsp;<b>32</b></span><br />
<span>total resources:&nbsp;<b>47</b></span><br />
</div>
</div>

:::

See also:
[[` SHOW `]](https://stackql.io/docs/language-spec/show) [[` DESCRIBE `]](https://stackql.io/docs/language-spec/describe) [[` REGISTRY `]](https://stackql.io/docs/language-spec/registry)
* * *

## Installation

To pull the latest version of the `snowflake` provider, run the following command:

```bash
REGISTRY PULL snowflake;
```
> To view previous provider versions or to pull a specific provider version, see [here](https://stackql.io/docs/language-spec/registry).

## Authentication

The following system environment variables are used for authentication by default:

- <CopyableCode code="SNOWFLAKE_PAT" /> - Snowflake Programmatic Access Token (PAT) (see <a href="https://docs.snowflake.com/developer-guide/snowflake-rest-api/authentication#using-a-programmatic-access-token-pat">Using a programmatic access token (PAT)</a>)

These variables are sourced at runtime (from the local machine or as CI variables/secrets).

<details>

<summary>Using different environment variables</summary>

To use different environment variables (instead of the defaults), use the `--auth` flag of the `stackql` program. For example:

```bash

AUTH='{ "snowflake": { "type": "bearer", "credentialsenvvar": "YOUR_SNOWFLAKE_PAT_VAR" }}'
stackql shell --auth="${AUTH}"

```
or using PowerShell:

```powershell

$Auth = "{ 'snowflake': { 'type': 'bearer', 'credentialsenvvar': 'YOUR_SNOWFLAKE_PAT_VAR' }}"
stackql.exe shell --auth=$Auth

```
</details>


## Services
<div class="row">
<div class="providerDocColumn">
<a href="/providers/snowflake/account/">account</a><br />
<a href="/providers/snowflake/alert/">alert</a><br />
<a href="/providers/snowflake/api_integration/">api_integration</a><br />
<a href="/providers/snowflake/catalog_integration/">catalog_integration</a><br />
<a href="/providers/snowflake/compute_pool/">compute_pool</a><br />
<a href="/providers/snowflake/database/">database</a><br />
<a href="/providers/snowflake/database_role/">database_role</a><br />
<a href="/providers/snowflake/dynamic_table/">dynamic_table</a><br />
<a href="/providers/snowflake/event_table/">event_table</a><br />
<a href="/providers/snowflake/external_volume/">external_volume</a><br />
<a href="/providers/snowflake/function/">function</a><br />
<a href="/providers/snowflake/grant/">grant</a><br />
<a href="/providers/snowflake/iceberg_table/">iceberg_table</a><br />
<a href="/providers/snowflake/image_repository/">image_repository</a><br />
<a href="/providers/snowflake/managed_account/">managed_account</a><br />
<a href="/providers/snowflake/network_policy/">network_policy</a><br />
</div>
<div class="providerDocColumn">
<a href="/providers/snowflake/notebook/">notebook</a><br />
<a href="/providers/snowflake/notification_integration/">notification_integration</a><br />
<a href="/providers/snowflake/pipe/">pipe</a><br />
<a href="/providers/snowflake/procedure/">procedure</a><br />
<a href="/providers/snowflake/result/">result</a><br />
<a href="/providers/snowflake/role/">role</a><br />
<a href="/providers/snowflake/schema/">schema</a><br />
<a href="/providers/snowflake/sqlapi/">sqlapi</a><br />
<a href="/providers/snowflake/stage/">stage</a><br />
<a href="/providers/snowflake/streams/">streams</a><br />
<a href="/providers/snowflake/table/">table</a><br />
<a href="/providers/snowflake/task/">task</a><br />
<a href="/providers/snowflake/user/">user</a><br />
<a href="/providers/snowflake/user_defined_function/">user_defined_function</a><br />
<a href="/providers/snowflake/view/">view</a><br />
<a href="/providers/snowflake/warehouse/">warehouse</a><br />
</div>
</div>
181 changes: 181 additions & 0 deletions docs/snowflake-docs/providers/snowflake/account/accounts/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
---
title: accounts
hide_title: false
hide_table_of_contents: false
keywords:
- accounts
- account
- snowflake
- infrastructure-as-code
- configuration-as-data
- cloud inventory
description: Query, deploy and manage snowflake resources using SQL
custom_edit_url: null
image: /img/providers/snowflake/stackql-snowflake-provider-featured-image.png
---

import CopyableCode from '@site/src/components/CopyableCode/CopyableCode';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

Creates, updates, deletes, gets or lists a <code>accounts</code> resource.

## Overview
<table><tbody>
<tr><td><b>Name</b></td><td><code>accounts</code></td></tr>
<tr><td><b>Type</b></td><td>Resource</td></tr>
<tr><td><b>Id</b></td><td><CopyableCode code="snowflake.account.accounts" /></td></tr>
</tbody></table>

## Fields
| Name | Datatype | Description |
|:-----|:---------|:------------|
| <CopyableCode code="name" /> | `string` | A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. |
| <CopyableCode code="account_locator" /> | `string` | System-assigned identifier of the acccount. |
| <CopyableCode code="account_locator_url" /> | `string` | Legacy Snowflake account URL syntax that includes the region_name and account_locator. |
| <CopyableCode code="account_old_url_last_used" /> | `string` | If the original account URL was saved when the account was renamed, indicates the last time the account was accessed using the original URL. |
| <CopyableCode code="account_old_url_saved_on" /> | `string` | If the original account URL was saved when the account was renamed, provides the date and time when the original account URL was saved. |
| <CopyableCode code="account_url" /> | `string` | Preferred Snowflake account URL that includes the values of organization_name and account_name. |
| <CopyableCode code="admin_name" /> | `string` | Name of the account administrator. |
| <CopyableCode code="admin_password" /> | `string` | Password for the account administrator. |
| <CopyableCode code="admin_rsa_public_key" /> | `string` | RSA public key for the account administrator. |
| <CopyableCode code="admin_user_type" /> | `string` | User type of the account administrator. |
| <CopyableCode code="comment" /> | `string` | Optional comment in which to store information related to the account. |
| <CopyableCode code="consumption_billing_entity_name" /> | `string` | Name of the consumption billing entity. |
| <CopyableCode code="created_on" /> | `string` | Date and time the account was created. |
| <CopyableCode code="dropped_on" /> | `string` | Date and time the account was dropped. |
| <CopyableCode code="edition" /> | `string` | Snowflake Edition of the account. |
| <CopyableCode code="email" /> | `string` | Email address of the account administrator. |
| <CopyableCode code="first_name" /> | `string` | First name of the account administrator. |
| <CopyableCode code="is_events_account" /> | `boolean` | Indicates whether an account is an events account. For more information, see Set up logging and event sharing for an application. |
| <CopyableCode code="is_org_admin" /> | `boolean` | Indicates whether the ORGADMIN role is enabled in an account. If TRUE, the role is enabled. |
| <CopyableCode code="last_name" /> | `string` | Last name of the account administrator. |
| <CopyableCode code="managed_accounts" /> | `integer` | Indicates how many managed accounts have been created by the account. |
| <CopyableCode code="marketplace_consumer_billing_entity_name" /> | `string` | Name of the marketplace consumer billing entity. |
| <CopyableCode code="marketplace_provider_billing_entity_name" /> | `string` | Name of the marketplace provider billing entity. |
| <CopyableCode code="moved_on" /> | `string` | Date and time when the account was moved to a different organization. |
| <CopyableCode code="moved_to_organization" /> | `string` | If the account was moved to a different organization, provides the name of that organization. |
| <CopyableCode code="must_change_password" /> | `boolean` | Indicates whether the account administrator must change the password at the next login. |
| <CopyableCode code="old_account_url" /> | `string` | If the original account URL was saved when the account was renamed, provides the original URL. If the original account URL was dropped, the value is NULL even if the account was renamed |
| <CopyableCode code="organization_URL_expiration_on" /> | `string` | If the account’s organization was changed in a way that created a new account URL and the original account URL was saved, provides the date and time when the original account URL will be dropped. Dropped URLs cannot be used to access the account. |
| <CopyableCode code="organization_name" /> | `string` | Name of the organization. |
| <CopyableCode code="organization_old_url" /> | `string` | If the account’s organization was changed in a way that created a new account URL and the original account URL was saved, provides the original account URL. If the original account URL was dropped, the value is NULL even if the organization changed. |
| <CopyableCode code="organization_old_url_last_used" /> | `string` | If the account’s organization was changed in a way that created a new account URL and the original account URL was saved, indicates the last time the account was accessed using the original account URL. |
| <CopyableCode code="organization_old_url_saved_on" /> | `string` | If the account’s organization was changed in a way that created a new account URL and the original account URL was saved, provides the date and time when the original account URL was saved. |
| <CopyableCode code="polaris" /> | `boolean` | Indicates whether the account is a Polaris account. |
| <CopyableCode code="region" /> | `string` | Snowflake Region where the account is located. A Snowflake Region is a distinct location within a cloud platform region that is isolated from other Snowflake Regions. A Snowflake Region can be either multi-tenant or single-tenant (for a Virtual Private Snowflake account). |
| <CopyableCode code="region_group" /> | `string` | Region group where the account is located. Note - This column is only displayed for organizations that span multiple region groups. |
| <CopyableCode code="restored_on" /> | `string` | Date and time when the account was last restored. |
| <CopyableCode code="retention_time" /> | `integer` | Number of days that historical data is retained for Time Travel. |
| <CopyableCode code="scheduled_deletion_time" /> | `string` | Date and time when the account is scheduled to be permanently deleted. Accounts are deleted within one hour after the scheduled time. |

## Methods
| Name | Accessible by | Required Params | Description |
|:-----|:--------------|:----------------|:------------|
| <CopyableCode code="list_accounts" /> | `SELECT` | <CopyableCode code="endpoint" /> | Lists the accessible accounts. |
| <CopyableCode code="create_account" /> | `INSERT` | <CopyableCode code="data__admin_name, data__edition, data__email, data__name, endpoint" /> | Creates a account. You must provide the full account definition when creating a account. |
| <CopyableCode code="delete_account" /> | `DELETE` | <CopyableCode code="gracePeriodInDays, name, endpoint" /> | Deletes the specified account. If you enable the `ifExists` parameter, the operation succeeds even if the account does not exist. Otherwise, a 404 failure is returned if the account does not exist. if the drop is unsuccessful. |
| <CopyableCode code="undrop_account" /> | `EXEC` | <CopyableCode code="name, endpoint" /> | Restores a dropped account that has not yet been permanently deleted (a dropped account that is within its grace period). |

## `SELECT` examples

Lists the accessible accounts.


```sql
SELECT
name,
account_locator,
account_locator_url,
account_old_url_last_used,
account_old_url_saved_on,
account_url,
admin_name,
admin_password,
admin_rsa_public_key,
admin_user_type,
comment,
consumption_billing_entity_name,
created_on,
dropped_on,
edition,
email,
first_name,
is_events_account,
is_org_admin,
last_name,
managed_accounts,
marketplace_consumer_billing_entity_name,
marketplace_provider_billing_entity_name,
moved_on,
moved_to_organization,
must_change_password,
old_account_url,
organization_URL_expiration_on,
organization_name,
organization_old_url,
organization_old_url_last_used,
organization_old_url_saved_on,
polaris,
region,
region_group,
restored_on,
retention_time,
scheduled_deletion_time
FROM snowflake.account.accounts
WHERE endpoint = '{{ endpoint }}';
```
## `INSERT` example

Use the following StackQL query and manifest file to create a new <code>accounts</code> resource.

<Tabs defaultValue="all" values={[ { label: 'All Properties', value: 'all' }, { label: 'Manifest', value: 'manifest' } ]}>
<TabItem value="all">

```sql
/*+ create */
INSERT INTO snowflake.account.accounts (
data__name,
data__admin_name,
data__email,
endpoint,
data__edition
)
SELECT
'{ email }',
'{ name }',
'{ admin_name }',
'{ endpoint }',
'{ edition }'
;
```
</TabItem>
<TabItem value="manifest">

```yaml
- name: accounts
props:
- name: data__admin_name
value: string
- name: data__edition
value: string
- name: data__email
value: string
- name: data__name
value: string
- name: endpoint
value: string

```
</TabItem>
</Tabs>

## `DELETE` example

Deletes the specified <code>accounts</code> resource.

```sql
/*+ delete */
DELETE FROM snowflake.account.accounts
WHERE gracePeriodInDays = '{ gracePeriodInDays }' AND name = '{ name }' AND endpoint = '{ endpoint }';
```
37 changes: 37 additions & 0 deletions docs/snowflake-docs/providers/snowflake/account/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: account
hide_title: false
hide_table_of_contents: false
keywords:
- account
- snowflake
- stackql
- infrastructure-as-code
- configuration-as-data
- cloud inventory
description: Query, deploy and manage snowflake resources using SQL
custom_edit_url: null
image: /img/providers/snowflake/stackql-snowflake-provider-featured-image.png
---

account service documentation.

:::info Service Summary

<div class="row">
<div class="providerDocColumn">
<span>total resources:&nbsp;<b>1</b></span><br />
</div>
</div>

:::

## Resources
<div class="row">
<div class="providerDocColumn">
<a href="/providers/snowflake/account/accounts/">accounts</a>
</div>
<div class="providerDocColumn">

</div>
</div>
Loading