MCPcopy Create free account
hub / github.com/Qovery/engine / parse

Method parse

lib-engine/src/environment/resource_extraction/parser.rs:94–101  ·  view source on GitHub ↗

Parse terraform show -json output and extract resources (terraform 1.3+)

(&self, json_output: &str)

Source from the content-addressed store, hash-verified

92
93 /// Parse terraform show -json output and extract resources (terraform 1.3+)
94 pub fn parse(&self, json_output: &str) -> Result<Vec<TerraformResource>, String> {
95 // Deserialize to infrastructure DTO
96 let output: TerraformShowOutput =
97 serde_json::from_str(json_output).map_err(|e| format!("Failed to parse JSON: {}", e))?;
98
99 // Extract resources from root module (and recursively from child modules)
100 Ok(self.extract_from_module(&output.values.root_module))
101 }
102
103 /// Extract resources from a module and its child modules (recursive)
104 fn extract_from_module(&self, module: &TerraformModule) -> Vec<TerraformResource> {

Callers 9

get_header_with_bearerFunction · 0.45
test_size_estimateFunction · 0.45
get_qovery_app_versionFunction · 0.45
contextFunction · 0.45
get_kube_resourcesFunction · 0.45
get_qovery_app_versionFunction · 0.45
launch_http_serverFunction · 0.45

Calls 1

extract_from_moduleMethod · 0.80

Tested by 6

test_size_estimateFunction · 0.36
get_qovery_app_versionFunction · 0.36
contextFunction · 0.36
get_kube_resourcesFunction · 0.36