1
0
mirror of synced 2026-01-28 19:01:58 -05:00
Files
airbyte/airbyte-cdk/python/airbyte_cdk/utils/is_cloud_environment.py
2023-10-02 19:11:40 +02:00

19 lines
566 B
Python

#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
import os
CLOUD_DEPLOYMENT_MODE = "cloud"
def is_cloud_environment():
"""
Returns True if the connector is running in a cloud environment, False otherwise.
The function checks the value of the DEPLOYMENT_MODE environment variable which is set by the platform.
This function can be used to determine whether stricter security measures should be applied.
"""
deployment_mode = os.environ.get("DEPLOYMENT_MODE", "")
return deployment_mode.casefold() == CLOUD_DEPLOYMENT_MODE