--- title: "system.config.create" description: "Creates a new resource of the specified type." --- # system.config.create > Creates a new resource of the specified type. This function is used in **Python Scripting**. ## Description ## Client Permission Restrictions This scripting function has no [Client Permission](ignition-modules\vision\vision-project-properties\vision-project-properties.md#vision-permissions-properties) restrictions. ## Syntax `system.config.create(*moduleId, typeId, [name], [collection], [config], [backupConfig], [files], [description], [enabled], [attributes], [actor])` :::tip An asterisk indicates that **all** parameters following it are expecting keywords when the function is being called in your script. This means that, when using an asterisk-marked parameter, **both** the parameter and argument **must** be specified. For example, `moduleId="ignition"`. ::: ### Parameters | Type | Parameter | Description | |---|---|---| | String | *moduleId | The module ID portion of the resource type identifier. | | String | *typeId | The type ID portion of the resource type identifier. | | String | *name | The name of the resource. Required for [named](platform\gateway\web-interface\platform\gateway-deployment-modes\gateway-deployment-modes.md#named-resources) resources, but must be omitted for [singleton](platform\gateway\web-interface\platform\gateway-deployment-modes\gateway-deployment-modes.md#singleton-resources) resources. [Optional] | | String | *collection | The [collection](platform\gateway\web-interface\platform\gateway-deployment-modes\gateway-deployment-modes.md#collections) containing the resource. If omitted, uses the active definition. [Optional] | | Dictionary | *config | A dictionary representing the resoure configuration, matching the resource type's JSON schema. If not provided, the `files` argument **must** be provided. [Optional] | | Dictionary | *backupConfig | A dictionary representing the backup configuration for resources that support backup data. [Optional] | | Dictionary | *files | A dictionary of additional files to include with the resource. Keys are filenames, values can be byte arrays, strings, lists, or dictionaries. If not provided, the `config` argument **must** be provided. [Optional] | | String | *description | A description for the resource. [Optional] | | Boolean | *enabled | Whether the resource should be enabled. If omitted, the resource will be enabled when created. [Optional] | | Dictionary | *attributes | A dictionary of resource attributes to set. [Optional] | | String | *actor | A string identifying the actor performing the operation. If not specified, an identifier will be automatically generated. [Optional] | ### Returns **PyResource** - A PyResource containing the specified parameter attributes of your newly created Gateway resource, which can also be read as plain Python properties. ### Scope Gateway ## Code Examples ```python title="Code Snippet" # This example creates a new database connection within the active collection. # Declare our create() variables moduleId = "ignition" typeId = "databasse-connection" name = "coolSQL" config = { "connectURL": "jdbc:mysql://localhost:3306/test", "connectionProps": "zeroDateTimeBehavior\u003dCONVERT_TO_NULL;connectTimeout\u003d120000;socketTimeout\u003d120000;useSSL\u003dfalse;allowPublicKeyRetrieval\u003dtrue;rewriteBatchedStatements\u003dtrue;disableMariaDbDriver", "connectionResetParams": "", "defaultTransactionLevel": "DEFAULT", "driver": "MySQL", "evictionRate": -1, "evictionTests": 3, "evictionTime": 1800000, "failoverMode": "STANDARD", "failoverProfile": "", "includeSchemaInTableName": false, "poolInitSize": 0, "poolMaxActive": 8, "poolMaxIdle": 8, "poolMaxWait": 5000, "poolMinIdle": 0, "slowQueryLogThreshold": 60000, "testOnBorrow": true, "testOnReturn": false, "testWhileIdle": false, "translator": "MYSQL", "username": "root", "validationQuery": "SELECT 1", "validationSleepTime": 10000 } # Call the create() function system.config.create(moduleId=moduleId, typeId=typeId, name=name, config=config) ```