# SHARE (outbound)

Config path: `/outbound_share.yaml`

Example:

```yaml
test_share:
  accounts:
    - SFSALESSHARED.SFC_SAMPLES_AWS_EU_WEST_2
  grants:
    DATABASE:USAGE:
      - test_db
    SCHEMA:USAGE:
      - test_db.test_schema
    TABLE:SELECT:
      - test_db.test_schema.*
    FUNCTION:USAGE:
      - test_db.test_schema.test_secure_udf(varchar)
    DATABASE_ROLE:USAGE:
      - test_db.test_database_role

  comment: Test share

```

## Schema

* *{key}* (ident) - share name
* *{value}* (dict)
  * **accounts** (list)
    * {items} (ident) - identifiers of consumer accounts: `<organization>.<account>`.
  * **grants** (str)
    * *{key}* (str) - `<object_type>:<privilege>`
    * *{value}* (list)
      * *{items}* (ident) - full objects names or name patterns to grant privilege;
  * **share\_restrictions** (bool) - should be set to `false` in order to create SHARE from Business Critical account to accounts with lower edition;
  * **comment** (str)

## Usage notes

1. Outbound shares are processed if at least one share exists in config.
2. All changes to outbound shares are ["unsafe"](/guides/other-guides/safe-unsafe.md) and should be reviewed carefully, since it may expose data from your account to 3rd parties.
3. Outbound shares require additional privileges for [SnowDDL administration user](/guides/other-guides/admin.md): `IMPORT SHARE`, `CREATE SHARE`.
4. Parameter **share\_restrictions** requires additional privilege: `OVERRIDE SHARE RESTRICTIONS`.
5. All limitations related to [`GRANT ... TO SHARE`](https://docs.snowflake.com/en/sql-reference/sql/grant-privilege-share.html) command applies to **grants**. Please read it carefully.
6. It is possible to use [Unix-style wildcard patterns](https://docs.python.org/3/library/fnmatch.html) for grant object names.
7. Grants created externally and matching Unix-style wildcard patterns **will not be dropped** if objects are not explicitly defined in config. It is an intentional workaround for lack of future grants on shares.
8. You may create and grant [DATABASE ROLE](/basic/yaml-configs/database-role.md) to share using `DATABASE_ROLE:USAGE` privilege.

## &#x20;Links

* [CREATE SHARE](https://docs.snowflake.com/en/sql-reference/sql/create-share.html)
* [ALTER SHARE](https://docs.snowflake.com/en/sql-reference/sql/alter-share.html)
* [Override share restrictions](https://docs.snowflake.com/en/user-guide/override_share_restrictions.html)
* [Data providers](https://docs.snowflake.com/en/user-guide/data-sharing-core-tasks-providers.html)
* [Parser & JSON Schema (GitHub)](https://github.com/littleK0i/SnowDDL/blob/master/snowddl/parser/outbound_share.py)


---

# Agent Instructions: 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:

```
GET https://docs.snowddl.com/basic/yaml-configs/share-outbound.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
