MCPcopy Create free account
hub / github.com/Houseofmvps/codesight / isComputeModule

Function isComputeModule

src/plugins/terraform/extractor.ts:139–152  ·  view source on GitHub ↗
(block: HclBlock)

Source from the content-addressed store, hash-verified

137}
138
139function isComputeModule(block: HclBlock): boolean {
140 const source = block.attributes["source"] ?? "";
141 // Positive: compute modules
142 if (source.includes("ecs-service") || source.includes("ecs-worker") || source.includes("lambda")) return true;
143 // Negative: known non-compute modules
144 if (source.includes("alarm") || source.includes("logging") || source.includes("s3") ||
145 source.includes("autoscaling") || source.includes("kms") || source.includes("secret") ||
146 source.includes("iam") || source.includes("deploy")) return false;
147 // Heuristic: modules with image attribute are likely compute
148 if (block.attributes["image"] || block.attributes["container_image"]) return true;
149 // Default: include if it has cpu/memory (likely compute)
150 if (block.attributes["cpu"] || block.attributes["memory"]) return true;
151 return false;
152}
153
154function inferDeploymentType(moduleSource: string | undefined, resourceType: string): string {
155 if (moduleSource) {

Callers 1

extractComponentsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected