CREATE GATEWAY
statementdeferredContainer services & dev toolingCreates a new gateway in the current schema. A gateway enables traffic splitting or shadow traffic across multiple service endpoints. Snowpark Container Services is available to accounts in AWS, Microsoft Azure, and Google Cloud Platform commercial regions, with some exceptions. For more information, see Available regions and considerations.
Syntax
supportedpartialnot supportednot scored
CREATE [ OR REPLACE ] GATEWAY [ IF NOT EXISTS ] <name>
FROM SPECIFICATION <specification_text>
Parameters
| Name | Required | Description |
|---|---|---|
name | required | String that specifies the identifier for the gateway; it must be unique for the schema in which the gateway is created. |
FROM SPECIFICATION | required | Specifies the gateway specification inline. The specification defines a traffic split or shadow traffic configuration. For a traffic split gateway, the specification uses the following format:Copy code spec: type: traffic_split split_type: custom targets: - type: endpoint value: <db>.<schema>.<service>!<endpoint> weight: <weight> - type: endpoint value: <db>.<schema>.<service>!<endpoint> weight: <weight> For a shadow traffic gateway, the specification uses the following format: Preview Feature — Open Shadow traffic gateways are available to all accounts.Copy code spec: type: shadow_traffic primary: - type: endpoint value: <db>.<schema>.<service>!<endpoint> shadow: - type: endpoint value: <db>.<schema>.<service>!<endpoint> weight: <weight> |
type | The gateway configuration type. Supported values: traffic_split: Routes requests among target endpoints according to their weights. shadow_traffic: Routes all requests to one primary endpoint and mirrors a percentage of requests to one or more shadow endpoints. | |
split_type | For a traffic_split gateway, the fixed value custom. Don’t specify this parameter for a shadow_traffic gateway. | |
targets | For a traffic_split gateway, a list of target endpoints to route traffic to. Each target must specify:
| |
primary | For a shadow_traffic gateway, a list containing exactly one primary endpoint. The primary endpoint receives all requests and returns responses to clients. Don’t specify weight for the primary endpoint. | |
shadow | For a shadow_traffic gateway, a list of one or more shadow endpoints. Each shadow endpoint receives a copy of the percentage of requests specified by weight. Responses from shadow endpoints aren’t returned to clients. Each shadow target uses the same type and value fields as a traffic split target. Set weight to an integer from 0 through 100. Weights for multiple shadow targets don’t need to add up to 100. |
Usage notes
- Regarding metadata: Attention Customers should ensure that no personal data (other than for a User object), sensitive data, export-controlled data, or other regulated data is entered as metadata when using the Snowflake service. For more information, see Metadata fields in Snowflake.
Access control requirements
A role used to execute this operation must have the following privileges at a minimum: Privilege | Object | Notes CREATE GATEWAY | Schema | Required to create a gateway in the schema. BIND SERVICE ENDPOINT | Account | Required to bind service endpoints to the gateway. USAGE | Database | Required on the database containing the gateway. USAGE | Schema | Required on the schema containing the gateway. USAGE | Service endpoints | Required on the target service endpoints. Grant the service role ALL_ENDPOINTS_USAGE to provide access. To grant the required privileges, use the following commands: For instructions on creating a custom role with a specified set of privileges, see Creating custom roles. For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.
Known gaps
- Metadata-only creation, replacement and no-op behavior are provisional: both Cloud accounts reject the suspended-service endpoint fixture with 392506 (23001). Successful lifecycle, live endpoint authorization and runtime address captures await an eligible standing SPCS service fixture; grant-only evidence is not verified lifecycle support.