This PR refactors the build_state_from_terraform_output method to make use of the custom classes within the matcha_state.py module.
Previously, the build_state_from_terraform_output method made use of the _parse_terraform_output utility function to build a dictionary representation of state. This dictionary was then converted into a MatchaState object using the from_dict method in the MatchaState class.
In this new implementation, the MatchaState object is built using the relevant classes representing underlying resources, properties and components.
This PR also updates the get_component method of the MatchaStateService by moving it to the MatchaState object and adding an ability for the method to return None. Changes have been made to the broader matcha codebase to account for this change.
This PR refactors the
build_state_from_terraform_output
method to make use of the custom classes within thematcha_state.py
module.Previously, the
build_state_from_terraform_output
method made use of the_parse_terraform_output
utility function to build a dictionary representation of state. This dictionary was then converted into aMatchaState
object using thefrom_dict
method in the MatchaState class.In this new implementation, the
MatchaState
object is built using the relevant classes representing underlying resources, properties and components.This PR also updates the
get_component
method of the MatchaStateService by moving it to theMatchaState
object and adding an ability for the method to returnNone
. Changes have been made to the broader matcha codebase to account for this change.Checklist
Please ensure you have done the following:
Type of change
Tick all those that apply: