Titan Core
  • Overview
  • Getting Started
  • Working With Resources
  • Blueprint
  • GitHub Action
  • Resources
    • APIAuthenticationSecurityIntegration
    • APIIntegration
    • AccountParameter
    • AggregationPolicy
    • Alert
    • AuthenticationPolicy
    • AzureStorageIntegration
    • ComputePool
    • Database
    • DatabaseRole
    • DynamicTable
    • EmailNotificationIntegration
    • EventTable
    • ExternalAccessIntegration
    • ExternalStage
    • FailoverGroup
    • FutureGrant
    • GCSStorageIntegration
    • GenericSecret
    • GlueCatalogIntegration
    • Grant
    • GrantOnAll
    • HybridTable
    • ImageRepository
    • InternalStage
    • JSONFileFormat
    • JavascriptUDF
    • MaterializedView
    • NetworkPolicy
    • NetworkRule
    • OAuthSecret
    • ObjectStoreCatalogIntegration
    • PackagesPolicy
    • ParquetFileFormat
    • PasswordPolicy
    • PasswordSecret
    • Pipe
    • PythonStoredProcedure
    • PythonUDF
    • ReplicationGroup
    • ResourceMonitor
    • Role
    • RoleGrant
    • S3StorageIntegration
    • Schema
    • Sequence
    • Service
    • SessionPolicy
    • Share
    • SnowflakePartnerOAuthSecurityIntegration
    • SnowservicesOAuthSecurityIntegration
    • StageStream
    • Table
    • TableStream
    • Tag
    • Task
    • User
    • View
    • ViewStream
    • Warehouse
Powered by GitBook
On this page
  • Examples
  • Python
  • YAML
  • Fields
  1. Resources

Service

PreviousSequenceNextSessionPolicy

Last updated 11 months ago

Service is a managed resource in Snowflake that allows users to run instances of their applications as a collection of containers on a compute pool. Each service instance can handle incoming traffic with the help of a load balancer if multiple instances are run.

Examples

Python

service = Service(
    name="some_service",
    compute_pool="some_compute_pool",
    stage="@tutorial_stage",
    yaml_file_stage_path="echo_spec.yaml",
    specification="FROM SPECIFICATION $$some_specification$$",
    external_access_integrations=["some_integration"],
    auto_resume=True,
    min_instances=1,
    max_instances=2,
    query_warehouse="some_warehouse",
    tags={"key": "value"},
    comment="This is a sample service."
)

YAML

services:
  - name: some_service
    compute_pool: some_compute_pool
    stage: @tutorial_stage
    yaml_file_stage_path: echo_spec.yaml
    specification: FROM SPECIFICATION $$some_specification$$
    external_access_integrations:
      - some_integration
    auto_resume: true
    min_instances: 1
    max_instances: 2
    query_warehouse: some_warehouse
    tags:
      key: value
    comment: This is a sample service.

Fields

  • name (string, required) - The unique identifier for the service within the schema.

  • stage (string) - The Snowflake internal stage where the specification file is stored.

  • yaml_file_stage_path (string) - The path to the service specification file on the stage.

  • specification (string) - The service specification as a string.

  • external_access_integrations (list) - The names of external access integrations for the service.

  • auto_resume (bool) - Specifies whether to automatically resume the service when a function or ingress is called. Defaults to True.

  • min_instances (int) - The minimum number of service instances to run.

  • max_instances (int) - The maximum number of service instances to run.

  • tags (dict) - Tags associated with the service.

  • comment (string) - A comment for the service.

compute_pool (string or , required) - The compute pool on which the service runs.

query_warehouse (string or ) - The warehouse to use if a service container connects to Snowflake to execute a query.

Snowflake Documentation
ComputePool
Warehouse