

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# AWS Secrets Manager 輪換函數範本
<a name="reference_available-rotation-templates"></a>

AWS Secrets Manager 提供一組輪換函數範本，可協助自動化各種資料庫系統和服務的登入資料安全管理。範本是ready-to-use Lambda 函數，可實作登入資料輪換的最佳實務，協助您維持安全狀態，無需手動介入。

範本支援兩種主要輪換策略：
+ *單一使用者輪換*，更新單一使用者的登入資料。
+ *交替使用者輪*換，可維護兩個不同的使用者，以協助消除登入資料變更期間的停機時間。

Secrets Manager 也提供一般範本，做為任何類型的秘密的起點。

若要使用範本，請參閱：
+ [資料庫秘密的自動輪換 (主控台)](rotate-secrets_turn-on-for-db.md)
+ [非資料庫秘密的自動輪換 （主控台）](rotate-secrets_turn-on-for-other.md)

若要寫入您自己的輪換函數，請參閱[寫入輪換函數](rotate-secrets_lambda-functions.md)。

**Contents**
+ [Amazon RDS 和 Amazon Aurora](#RDS_rotation_templates)
  + [Amazon RDS Db2 單用戶](#sar-template-db2-singleuser)
  + [Amazon RDS Db2 交替用戶](#sar-template-db2-multiuser)
  + [Amazon RDS MariaDB 單一使用者](#sar-template-mariadb-singleuser)
  + [Amazon RDS MariaDB 交替使用者](#sar-template-mariadb-multiuser)
  + [Amazon RDS 和 Amazon Aurora MySQL 單一使用者](#sar-template-mysql-singleuser)
  + [Amazon RDS 和 Amazon Aurora MySQL 交替使用者](#sar-template-mysql-multiuser)
  + [Amazon RDS Oracle 單一使用者](#sar-template-oracle-singleuser)
  + [Amazon RDS Oracle 交替使用者](#sar-template-oracle-multiuser)
  + [Amazon RDS 和 Amazon Aurora PostgreSQL 單一使用者](#sar-template-postgre-singleuser)
  + [Amazon RDS 和 Amazon Aurora PostgreSQL 交替使用者](#sar-template-postgre-multiuser)
  + [Amazon RDS Microsoft SQLServer 單一使用者](#sar-template-sqlserver-singleuser)
  + [Amazon RDS Microsoft SQLServer 交替使用者](#sar-template-sqlserver-multiuser)
+ [Amazon DocumentDB (with MongoDB compatibility)](#NON-RDS_rotation_templates)
  + [Amazon DocumentDB 單一使用者](#sar-template-mongodb-singleuser)
  + [Amazon DocumentDB 交替使用者](#sar-template-mongodb-multiuser)
+ [Amazon Redshift](#template-redshift)
  + [Amazon Redshift 單一使用者](#sar-template-redshift-singleuser)
  + [Amazon Redshift 交替使用者](#sar-template-redshift-multiuser)
+ [InfluxDB 的 Amazon Timestream](#template-TimeStream)
  + [InfluxDB 單一使用者的 Amazon Timestream](#template-TimeStream-singleuser)
  + [InfluxDB 交替使用者的 Amazon Timestream](#template-TimeStream-multiuser)
+ [Amazon ElastiCache](#template-ELC)
+ [Active Directory](#template-AD)
  + [Active Directory 登入資料](#template-AD-password)
  + [Active Directory keytab](#template-AD-keytab)
+ [其他類型的秘密](#OTHER_rotation_templates)

## Amazon RDS 和 Amazon Aurora
<a name="RDS_rotation_templates"></a>

### Amazon RDS Db2 單用戶
<a name="sar-template-db2-singleuser"></a>
+ **範本名稱：**SecretsManagerRDSDb2RotationSingleUser
+ **輪換策略：**[輪換策略：單一使用者](rotation-strategy.md#rotating-secrets-one-user-one-password)。
+ **`SecretString` 結構：**[Amazon RDS 和 Aurora 登入資料](reference_secret_json_structure.md#reference_secret_json_structure_rds)。
+ **原始碼：**https：//[https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerRDSDb2RotationSingleUser/lambda\_function.py](https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerRDSDb2RotationSingleUser/lambda_function.py)
+ **相依性：**[python-ibmdb 3.2.8](https://github.com/ibmdb/python-ibmdb)

### Amazon RDS Db2 交替用戶
<a name="sar-template-db2-multiuser"></a>
+ **範本名稱：**SecretsManagerRDSDb2RotationMultiUser
+ **輪換策略：**[輪換策略：交替使用者](rotation-strategy.md#rotating-secrets-two-users)。
+ **`SecretString` 結構：**[Amazon RDS 和 Aurora 登入資料](reference_secret_json_structure.md#reference_secret_json_structure_rds)。
+ **原始碼：**https：//[https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerRDSDb2RotationMultiUser/lambda\_function.py](https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerRDSDb2RotationMultiUser/lambda_function.py)
+ **相依性：**[python-ibmdb 3.2.8](https://github.com/ibmdb/python-ibmdb)

### Amazon RDS MariaDB 單一使用者
<a name="sar-template-mariadb-singleuser"></a>
+ **範本名稱：**SecretsManagerRDSMariaDBRotationSingleUser
+ **輪換策略：**[輪換策略：單一使用者](rotation-strategy.md#rotating-secrets-one-user-one-password)。
+ **`SecretString` 結構：**[Amazon RDS 和 Aurora 登入資料](reference_secret_json_structure.md#reference_secret_json_structure_rds)。
+ **原始碼：**[https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerRDSMariaDBRotationSingleUser/lambda\_function.py](https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerRDSMariaDBRotationSingleUser/lambda_function.py)
+ **相依性：**[PyMySQL 1.1.1](https://github.com/PyMySQL/PyMySQL)。如果您使用 sha256 密碼進行身分驗證，PyMySQL【rsa】。如需在 Lambda 執行時間中搭配編譯程式碼使用套件的詳細資訊，請參閱[如何將具有編譯二進位檔的 Python 套件新增至部署套件，並讓套件與 Lambda 相容？](https://repost.aws/knowledge-center/lambda-python-package-compatible) *AWS 知識中心的* 。

### Amazon RDS MariaDB 交替使用者
<a name="sar-template-mariadb-multiuser"></a>
+ **範本名稱：**SecretsManagerRDSMariaDBRotationMultiUser
+ **輪換策略：**[輪換策略：交替使用者](rotation-strategy.md#rotating-secrets-two-users)。
+ **`SecretString` 結構：**[Amazon RDS 和 Aurora 登入資料](reference_secret_json_structure.md#reference_secret_json_structure_rds)。
+ **原始碼：**[https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerRDSMariaDBRotationMultiUser/lambda\_function.py](https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerRDSMariaDBRotationMultiUser/lambda_function.py)
+ **相依性：**[PyMySQL 1.1.1](https://github.com/PyMySQL/PyMySQL)。如果您使用 sha256 密碼進行身分驗證，PyMySQL【rsa】。如需在 Lambda 執行時間中搭配編譯程式碼使用套件的詳細資訊，請參閱[如何將具有編譯二進位檔的 Python 套件新增至部署套件，並讓套件與 Lambda 相容？](https://repost.aws/knowledge-center/lambda-python-package-compatible) *AWS 知識中心的* 。

### Amazon RDS 和 Amazon Aurora MySQL 單一使用者
<a name="sar-template-mysql-singleuser"></a>
+ **範本名稱：**SecretsManagerRDSMySQLRotationSingleUser
+ **輪換策略：**[輪換策略：單一使用者](rotation-strategy.md#rotating-secrets-one-user-one-password)。
+ **預期的 `SecretString` 結構：**[Amazon RDS 和 Aurora 登入資料](reference_secret_json_structure.md#reference_secret_json_structure_rds)。
+ **原始碼：**[https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerRDSMySQLRotationSingleUser/lambda\_function.py](https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerRDSMySQLRotationSingleUser/lambda_function.py)
+ **相依性：**[PyMySQL 1.1.1](https://github.com/PyMySQL/PyMySQL)。如果您使用 sha256 密碼進行身分驗證，PyMySQL【rsa】。如需在 Lambda 執行時間中搭配編譯程式碼使用套件的詳細資訊，請參閱[如何將具有編譯二進位檔的 Python 套件新增至部署套件，並讓套件與 Lambda 相容？](https://repost.aws/knowledge-center/lambda-python-package-compatible) *AWS 知識中心的* 。

### Amazon RDS 和 Amazon Aurora MySQL 交替使用者
<a name="sar-template-mysql-multiuser"></a>
+ **範本名稱：**SecretsManagerRDSMySQLRotationMultiUser
+ **輪換策略：**[輪換策略：交替使用者](rotation-strategy.md#rotating-secrets-two-users)。
+ **預期的 `SecretString` 結構：**[Amazon RDS 和 Aurora 登入資料](reference_secret_json_structure.md#reference_secret_json_structure_rds)。
+ **原始碼：**[https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerRDSMySQLRotationMultiUser/lambda\_function.py](https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerRDSMySQLRotationMultiUser/lambda_function.py)
+ **相依性：**[PyMySQL 1.1.1](https://github.com/PyMySQL/PyMySQL)。如果您使用 sha256 密碼進行身分驗證，PyMySQL【rsa】。如需在 Lambda 執行時間中搭配編譯程式碼使用套件的詳細資訊，請參閱[如何將具有編譯二進位檔的 Python 套件新增至部署套件，並讓套件與 Lambda 相容？](https://repost.aws/knowledge-center/lambda-python-package-compatible) *AWS 知識中心的* 。

### Amazon RDS Oracle 單一使用者
<a name="sar-template-oracle-singleuser"></a>
+ **範本名稱：**SecretsManagerRDSOracleRotationSingleUser
+ **輪換策略：**[輪換策略：單一使用者](rotation-strategy.md#rotating-secrets-one-user-one-password)。
+ **預期的 `SecretString` 結構：**[Amazon RDS 和 Aurora 登入資料](reference_secret_json_structure.md#reference_secret_json_structure_rds)。
+ **原始碼：**[https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerRDSOracleRotationSingleUser/lambda\_function.py](https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerRDSOracleRotationSingleUser/lambda_function.py)
+ **相依性：**[python-oracledb 2.4.1](https://github.com/oracle/python-oracledb)

### Amazon RDS Oracle 交替使用者
<a name="sar-template-oracle-multiuser"></a>
+ **範本名稱：**SecretsManagerRDSOracleRotationMultiUser
+ **輪換策略：**[輪換策略：交替使用者](rotation-strategy.md#rotating-secrets-two-users)。
+ **預期的 `SecretString` 結構：**[Amazon RDS 和 Aurora 登入資料](reference_secret_json_structure.md#reference_secret_json_structure_rds)。
+ **原始碼：**[https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerRDSOracleRotationMultiUser/lambda\_function.py](https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerRDSOracleRotationMultiUser/lambda_function.py)
+ **相依性：**[python-oracledb 2.4.1](https://github.com/oracle/python-oracledb)

### Amazon RDS 和 Amazon Aurora PostgreSQL 單一使用者
<a name="sar-template-postgre-singleuser"></a>
+ **範本名稱：**SecretsManagerRDSPostgreSQLRotationSingleUser
+ **輪換策略：**[輪換策略：單一使用者](rotation-strategy.md#rotating-secrets-one-user-one-password)。
+ **預期的 `SecretString` 結構：**[Amazon RDS 和 Aurora 登入資料](reference_secret_json_structure.md#reference_secret_json_structure_rds)。
+ **原始碼：**[https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerRDSPostgreSQLRotationSingleUser/lambda\_function.py](https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerRDSPostgreSQLRotationSingleUser/lambda_function.py)
+ **相依性：**[PyGreSQL 6.1.0](https://github.com/PyGreSQL/PyGreSQL)

### Amazon RDS 和 Amazon Aurora PostgreSQL 交替使用者
<a name="sar-template-postgre-multiuser"></a>
+ **範本名稱：**SecretsManagerRDSPostgreSQLRotationMultiUser
+ **輪換策略：**[輪換策略：交替使用者](rotation-strategy.md#rotating-secrets-two-users)。
+ **預期的 `SecretString` 結構：**[Amazon RDS 和 Aurora 登入資料](reference_secret_json_structure.md#reference_secret_json_structure_rds)。
+ **原始碼：**[https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerRDSPostgreSQLRotationMultiUser/lambda\_function.py](https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerRDSPostgreSQLRotationMultiUser/lambda_function.py)
+ **相依性：**[PyGreSQL 6.1.0](https://github.com/PyGreSQL/PyGreSQL)

### Amazon RDS Microsoft SQLServer 單一使用者
<a name="sar-template-sqlserver-singleuser"></a>
+ **範本名稱：**SecretsManagerRDSSQLServerRotationSingleUser
+ **輪換策略：**[輪換策略：單一使用者](rotation-strategy.md#rotating-secrets-one-user-one-password)。
+ **預期的 `SecretString` 結構：**[Amazon RDS 和 Aurora 登入資料](reference_secret_json_structure.md#reference_secret_json_structure_rds)。
+ **原始碼：**[https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerRDSSQLServerRotationSingleUser/lambda\_function.py](https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerRDSSQLServerRotationSingleUser/lambda_function.py)
+ **相依性：**[Pymssql 2.3.11](https://github.com/Pymssql/Pymssql)

### Amazon RDS Microsoft SQLServer 交替使用者
<a name="sar-template-sqlserver-multiuser"></a>
+ **範本名稱：**SecretsManagerRDSSQLServerRotationMultiUser
+ **輪換策略：**[輪換策略：交替使用者](rotation-strategy.md#rotating-secrets-two-users)。
+ **預期的 `SecretString` 結構：**[Amazon RDS 和 Aurora 登入資料](reference_secret_json_structure.md#reference_secret_json_structure_rds)。
+ **原始碼：**[https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerRDSSQLServerRotationMultiUser/lambda\_function.py](https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerRDSSQLServerRotationMultiUser/lambda_function.py)
+ **相依性：**[Pymssql 2.3.11](https://github.com/Pymssql/Pymssql)

## Amazon DocumentDB (with MongoDB compatibility)
<a name="NON-RDS_rotation_templates"></a>

### Amazon DocumentDB 單一使用者
<a name="sar-template-mongodb-singleuser"></a>
+ **範本名稱：**SecretsManagerMongoDBRotationSingleUser
+ **輪換策略：**[輪換策略：單一使用者](rotation-strategy.md#rotating-secrets-one-user-one-password)。
+ **預期的 `SecretString` 結構：**[Amazon DocumentDB 登入資料](reference_secret_json_structure.md#reference_secret_json_structure_docdb)。
+ **原始碼：**[https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerMongoDBRotationSingleUser/lambda\_function.py](https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerMongoDBRotationSingleUser/lambda_function.py)
+ **相依性：**[PyMongo 4.7.3](https://github.com/mongodb/mongo-python-driver)

### Amazon DocumentDB 交替使用者
<a name="sar-template-mongodb-multiuser"></a>
+ **範本名稱：**SecretsManagerMongoDBRotationMultiUser
+ **輪換策略：**[輪換策略：交替使用者](rotation-strategy.md#rotating-secrets-two-users)。
+ **預期的 `SecretString` 結構：**[Amazon DocumentDB 登入資料](reference_secret_json_structure.md#reference_secret_json_structure_docdb)。
+ **原始碼：**[https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerMongoDBRotationMultiUser/lambda\_function.py](https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerMongoDBRotationMultiUser/lambda_function.py)
+ **相依性：**[PyMongo 4.7.3](https://github.com/mongodb/mongo-python-driver)

## Amazon Redshift
<a name="template-redshift"></a>

### Amazon Redshift 單一使用者
<a name="sar-template-redshift-singleuser"></a>
+ **範本名稱：**SecretsManagerRedshiftRotationSingleUser
+ **輪換策略：**[輪換策略：單一使用者](rotation-strategy.md#rotating-secrets-one-user-one-password)。
+ **預期的 `SecretString` 結構：**[Amazon Redshift 登入資料](reference_secret_json_structure.md#reference_secret_json_structure_RS)。
+ **原始碼：**[https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerRedshiftRotationSingleUser/lambda\_function.py](https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerRedshiftRotationSingleUser/lambda_function.py)
+ **相依性：**[redshift-connector 2.1.13](https://github.com/aws/amazon-redshift-python-driver)

### Amazon Redshift 交替使用者
<a name="sar-template-redshift-multiuser"></a>
+ **範本名稱：**SecretsManagerRedshiftRotationMultiUser
+ **輪換策略：**[輪換策略：交替使用者](rotation-strategy.md#rotating-secrets-two-users)。
+ **預期的 `SecretString` 結構：**[Amazon Redshift 登入資料](reference_secret_json_structure.md#reference_secret_json_structure_RS)。
+ **原始碼：**[https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerRedshiftRotationMultiUser/lambda\_function.py](https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerRedshiftRotationMultiUser/lambda_function.py)
+ **相依性：**[redshift-connector 2.1.13](https://github.com/aws/amazon-redshift-python-driver)

## InfluxDB 的 Amazon Timestream
<a name="template-TimeStream"></a>

若要使用這些範本，請參閱[《Amazon Timestream 開發人員指南》中的 Amazon Timestream for InfluxDB 如何使用秘密](https://docs.aws.amazon.com/timestream/latest/developerguide/timestream-for-influx-security-db-secrets.html)。 **

### InfluxDB 單一使用者的 Amazon Timestream
<a name="template-TimeStream-singleuser"></a>
+ **範本名稱：**SecretsManagerInfluxDBRotationSingleUserInfluxDBRotationSingleUser
+ **預期的 `SecretString` 結構：**[InfluxDB 秘密結構的 Amazon Timestream](reference_secret_json_structure.md#reference_secret_json_structure_TIME)。
+ **原始碼：**https：//[https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerInfluxDBRotationSingleUser/lambda\_function.py](https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerInfluxDBRotationSingleUser/lambda_function.py)
+ **相依性：**InfluxDB 2.0 python 用戶端

### InfluxDB 交替使用者的 Amazon Timestream
<a name="template-TimeStream-multiuser"></a>
+ **範本名稱：**SecretsManagerInfluxDBRotationMultiUser
+ **預期的 `SecretString` 結構：**[InfluxDB 秘密結構的 Amazon Timestream](reference_secret_json_structure.md#reference_secret_json_structure_TIME)。
+ **原始碼：**https：//[https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerInfluxDBRotationMultiUser/lambda\_function.py](https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerInfluxDBRotationMultiUser/lambda_function.py)
+ **相依性：**InfluxDB 2.0 python 用戶端

## Amazon ElastiCache
<a name="template-ELC"></a>

若要使用此範本，請參閱《Amazon ElastiCache 使用者指南》**中的[自動輪換使用者的密碼](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/User-Secrets-Manager.html)。
+ **範本名稱：**SecretsManagerElasticacheUserRotation
+ **預期的 `SecretString` 結構：**[Amazon ElastiCache 登入資料](reference_secret_json_structure.md#reference_secret_json_structure_ELC)。
+ **原始碼：**https：//[https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerElasticacheUserRotation/lambda\_function.py](https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerElasticacheUserRotation/lambda_function.py)

## Active Directory
<a name="template-AD"></a>

### Active Directory 登入資料
<a name="template-AD-password"></a>
+ **範本名稱：**SecretsManagerActiveDirectoryRotationSingleUser
+ **預期的 `SecretString` 結構：**[Active Directory 登入資料](reference_secret_json_structure.md#reference_secret_json_structure_AD)。
+ **原始碼：**https：//[https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerActiveDirectoryRotationSingleUser/lambda\_function.py](https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerActiveDirectoryRotationSingleUser/lambda_function.py)

### Active Directory keytab
<a name="template-AD-keytab"></a>
+ **範本名稱：**SecretsManagerActiveDirectoryAndKeytabRotationSingleUser
+ **預期的 `SecretString` 結構：**[Active Directory 登入資料](reference_secret_json_structure.md#reference_secret_json_structure_AD)。
+ **原始碼：**https：//[https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerActiveDirectoryAndKeytabRotationSingleUser/lambda\_function.py](https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerActiveDirectoryAndKeytabRotationSingleUser/lambda_function.py)
+ **相依性：**msktutil

## 其他類型的秘密
<a name="OTHER_rotation_templates"></a>

Secrets Manager 提供此範本做為起點，供您為任何類型的秘密建立輪換函數。
+ **範本名稱：**SecretsManagerRotationTemplate
+ **原始碼：**[https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerRotationTemplate/lambda\_function.py](https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/tree/master/SecretsManagerRotationTemplate/lambda_function.py)