Skip to main content

Repository configuration file

The repository configuration file allows you to define multiple resources that need to be imported into Infrahub.

The file should be formatted as a Yaml file, have the filename .infrahub.yml and should be stored at the root of the repository.

info

See this topic for more details on the available repository configuration options

note

To help with the development process of a repository configuration file, you can leverage the schemas we publish for validation within your editor

Check Definitions

Description: User defined checks
Key: check_definitions
Type: array
Item type: InfrahubCheckDefinitionConfig

PropertyTypeDescriptionMandatory
namestringThe name of the Check DefinitionTrue
file_pathstringThe file within the repository with the check code.True
parametersobjectThe input parameters required to run this checkFalse
targetsstringThe group to target when running this check, leave blank for global checksFalse
class_namestringThe name of the check class to run.False

Schemas

Description: Schema files
Key: schemas
Type: array
Item type: string
Item format: path

Jinja2 Transforms

Description: Jinja2 data transformations
Key: jinja2_transforms
Type: array
Item type: InfrahubJinja2TransformConfig

PropertyTypeDescriptionMandatory
namestringThe name of the transformTrue
querystringThe name of the GraphQL QueryTrue
template_pathstringThe path within the repository of the template fileTrue
descriptionstringDescription for this transformFalse

Artifact Definitions

Description: Artifact definitions
Key: artifact_definitions
Type: array
Item type: InfrahubRepositoryArtifactDefinitionConfig

PropertyTypeDescriptionMandatory
namestringThe name of the artifact definitionTrue
artifact_namestringName of the artifact created from this definitionFalse
parametersobjectThe input parameters required to render this artifactTrue
content_typestringThe content type of the rendered artifactTrue
targetsstringThe group to target when creating artifactsTrue
transformationstringThe transformation to use.True

Python Transforms

Description: Python data transformations
Key: python_transforms
Type: array
Item type: InfrahubPythonTransformConfig

PropertyTypeDescriptionMandatory
namestringThe name of the TransformTrue
file_pathstringThe file within the repository with the transform code.True
class_namestringThe name of the transform class to run.False
convert_query_responsebooleanDecide if the transform should convert the result of the GraphQL query to SDK InfrahubNode objects.False

Generator Definitions

Description: Generator definitions
Key: generator_definitions
Type: array
Item type: InfrahubGeneratorDefinitionConfig

PropertyTypeDescriptionMandatory
namestringThe name of the Generator DefinitionTrue
file_pathstringThe file within the repository with the generator code.True
querystringThe GraphQL query to use as input.True
parametersobjectMaps GraphQL query variable names to target object attribute paths using double-underscore notation.False
targetsstringName of the CoreStandardGroup whose members become individual Generator targets. One run is created per group member.True
class_namestringThe name of the Python class within file_path that extends InfrahubGenerator.False
convert_query_responsebooleanWhen true, converts the raw GraphQL dict into SDK InfrahubNode objects accessible via self.nodes and self.store.False
execute_in_proposed_changebooleanWhen true (default), the Generator runs as a CI check during proposed changes.False
execute_after_mergebooleanWhen true (default), the Generator runs after a branch merge. Set to false for Generators that only run via event triggers.False

Queries

Description: GraphQL Queries
Key: queries
Type: array
Item type: InfrahubRepositoryGraphQLConfig

PropertyTypeDescriptionMandatory
namestringThe name of the GraphQL QueryTrue
file_pathstringThe file within the repository with the query code.True

Objects

Description: Objects
Key: objects
Type: array
Item type: string
Item format: path

Description: Menus
Key: menus
Type: array
Item type: string
Item format: path