ALTER GATEWAY¶
Modifies the configuration of an existing gateway. Use this command to update the traffic split or shadow traffic configuration for a gateway.
- See also:
CREATE GATEWAY , DESCRIBE GATEWAY, DROP GATEWAY , SHOW GATEWAYS
Syntax¶
Parameters¶
nameSpecifies the identifier for the gateway to alter.
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.
For more information, see Identifier requirements.
FROM SPECIFICATIONSpecifies the updated gateway specification inline. The specification defines a traffic split or shadow traffic configuration.
For a traffic split gateway, the specification uses the following format:
For a shadow traffic gateway, the specification uses the following format:
Specification parameters¶
typeThe 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_typeFor a
traffic_splitgateway, the fixed valuecustom.Don’t specify this parameter for a
shadow_trafficgateway.targetsFor a
traffic_splitgateway, a list of target endpoints to route traffic to. Each target must specify:typeFixed value. Must be set to
endpoint.valueThe fully qualified endpoint name in the format
db.schema.service!endpoint. Each target endpoint must exist.weightThe traffic weight for this endpoint, specified as an integer. All weights must add up to 100.
primaryFor a
shadow_trafficgateway, a list containing exactly one primary endpoint. The primary endpoint receives all requests and returns responses to clients.Don’t specify
weightfor the primary endpoint.shadowFor a
shadow_trafficgateway, a list of one or more shadow endpoints. Each shadow endpoint receives a copy of the percentage of requests specified byweight. Responses from shadow endpoints aren’t returned to clients.Each shadow target uses the same
typeandvaluefields as a traffic split target. Setweightto an integer from 0 through 100. Weights for multiple shadow targets don’t need to add up to 100.
Note
- Maximum number of endpoints per gateway is 5 by default.
Access control requirements¶
A role used to execute this operation must have the following privileges at a minimum:
| Privilege | Object | Notes |
|---|---|---|
| MODIFY or OWNERSHIP | Gateway | Required to alter the gateway configuration. |
| 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. |
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.
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.
Examples¶
Alter a gateway to update the traffic split configuration:
Alter a shadow traffic gateway to mirror 25 percent of requests to a challenger endpoint: