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

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
parametersobjectThe input parameters required to run this checkFalse
targetsstringThe group to target when running this generatorTrue
class_namestringThe name of the generator class to run.False
convert_query_responsebooleanDecide if the generator should convert the result of the GraphQL query to SDK InfrahubNode objects.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