# Configuration Bootstrap



Overview [#overview]

The Socotra Insurance Suite configurations generally contain settings and definitions for various components, such as account and policy structures, data extensions, and other behaviors and structures that are defined within the platform.

While [resources](/configuration/resources/data-tables) such as [data tables](/configuration/resources/data-tables) and [documents](/configuration/resources/documents) are defined in the main <ApiLink name="ConfigurationRef">configuration</ApiLink>, the management of those resources—including deploying actual resource instances and creating resource groups—occurs at the tenant level, after deployment is complete.

To facilitate a more streamlined tenant creation experience, <ApiLink name="BootstrapRef">configuration bootstrap</ApiLink> — an optional component of the <ApiLink name="ConfigurationRef">config</ApiLink> structure — allows for the inclusion of both resource instance files and resource group definitions within a tenant configuration, as well as their automatic deployment as part of the tenant creation process.

Notes [#notes]

The bootstrap directory only applies on tenant **creation**. It is ignored for subsequent redeployments.

Bootstrap Directory [#bootstrap-directory]

To support this streamlined deployment approach, the <ApiLink name="BootstrapRef">bootstrap</ApiLink> directory enables the inclusion of necessary resource files and metadata. The directory structure within the configuration is as follows:

```text
└── bootstrap
    └── resources
        ├── config.json
        └── resourceFiles
            ├── tables                    // only .csv files
            ├── constraintTables          // only .csv files
            ├── documentTemplates         // only .liquid or .velocity/.vm files
            ├── documentTemplatesSnippets // only .liquid or .velocity/.vm files
            ├── staticDocuments           // only .pdf or .html files
            ├── customFonts               // only .ttf or .otf files
            └── secrets
                └── config.json
```

The `config.json` file defines the resource instances and groups used for deployment.

Validations [#validations]

The Bootstrap process is triggered only if the following conditions are met:

* The bootstrap directory is present in the config.

* There is at least one valid combination of a <ApiLink name="ResourceInstanceRef" /> defined in the `resources/config.json` file and a corresponding file in the `resourceFiles` directory.
  * i.e. There must be a file in one of the resource specific directories within the `resourceFiles` folder that matches the name of one of the entries in the `resourceInstances`.

* The file type (and its directory within `resourceFiles`) aligns with the type defined by the main <ApiLink name="ConfigurationRef" /> resource declaration, matched by the `staticName`.

* All names specified in the <ApiLink name="ResourceInstanceRef" /> must be unique.

* All names specified in the <ApiLink name="ResourceGroupRef" /> must be unique.

* Any `staticName` specified in the `ResourceInstanceRef` must correspond to a valid resource declaration in the main <ApiLink name="ConfigurationRef" />.

* All names in the <ApiLink name="ResourceGroupRef" /> must have been declared in the <ApiLink name="ResourceInstanceRef" />.

Example [#example]

Below is an example structure for the bootstrap directory:

```text
└── bootstrap
    └── resources
        ├── config.json
        └── resourceFiles
            ├── tables
            │   ├── VehicleDamageRates01.csv
            │   └── VehicleRegistrationStateRates01.csv
            └── documentTemplates
                └── Declarations01.velocity
```

Contents of the `config.json` file:

```json
{
	"resourceInstances": {
		"VehicleDamageRates01": {
			"staticName": "VehicleDamage"
		},
		"VehicleRegistrationStateRates01": {
			"staticName": "VehicleRegistrationState"
		},
		"Declarations01": {
			"staticName": "Declarations"
		}
	},
	"resourceGroups": {
		"initialGroup": {
			"selectionStartTime": "1970-01-01T00:00:00-05:00",
			"resourceNames": [
				"VehicleDamageRates01",
				"VehicleRegistrationStateRates01",
				"Declarations01"
			]
		}
	}
}
```
