Terraform Generator#
- class besser.generators.terraform.terraform_generator.TerraformGenerator(deployment_model: DeploymentModel, output_dir: str = None)[source]#
Bases:
GeneratorInterface
TerraformGenerator is a class that implements the GeneratorInterface and is responsible for generating the Terraform models code based on the input B-UML model. :param deployement_model: The deployment model containing multiple public clusters. :type deployement_model: DeployementModel :param output_dir: The output directory where the generated code will be saved. Defaults to None. :type output_dir: str, optional
- _abc_impl = <_abc._abc_data object>#
- static convert_type(value)[source]#
Converts the input value to its underlying value if it is an instance of an enum class, otherwise converts it to a string. :param value: The value to convert, which can be of any type including enum instances.
- Returns:
The underlying value if an enum instance, or the string representation of the value.
- generate()[source]#
Generates Terraform code based on the provided B-UML model and saves it to the specified output directory. If the output directory is not specified, the generated code will be stored in the <current directory>/output folder.
- Returns:
None, but stores the generated code as files with specified names.