@@ -100,6 +100,52 @@ def get_lambdalabs_summary() -> tuple[bool, str]:
100100 return False , "Lambda Labs: Error querying API - using defaults"
101101
102102
103+ def generate_aws_kconfig () -> bool :
104+ """
105+ Generate AWS Kconfig files.
106+ Returns True on success, False on failure.
107+ """
108+ script_dir = os .path .dirname (os .path .abspath (__file__ ))
109+ project_root = os .path .dirname (script_dir )
110+ aws_scripts_dir = os .path .join (project_root , "terraform" , "aws" , "scripts" )
111+ aws_kconfigs_dir = os .path .join (project_root , "terraform" , "aws" , "kconfigs" )
112+
113+ # Define the script-to-output mapping
114+ scripts_to_run = [
115+ ("gen_kconfig_ami" , "Kconfig.ami" ),
116+ ("gen_kconfig_instance" , "Kconfig.instance" ),
117+ ("gen_kconfig_location" , "Kconfig.location" ),
118+ ]
119+
120+ all_success = True
121+
122+ for script_name , kconfig_file in scripts_to_run :
123+ script_path = os .path .join (aws_scripts_dir , script_name )
124+ output_path = os .path .join (aws_kconfigs_dir , kconfig_file )
125+
126+ # Run the script and capture its output
127+ result = subprocess .run (
128+ [script_path ],
129+ capture_output = True ,
130+ text = True ,
131+ check = False ,
132+ )
133+
134+ if result .returncode == 0 :
135+ # Write the output to the corresponding Kconfig file
136+ try :
137+ with open (output_path , 'w' ) as f :
138+ f .write (result .stdout )
139+ except IOError as e :
140+ print (f"Error writing { kconfig_file } : { e } " , file = sys .stderr )
141+ all_success = False
142+ else :
143+ print (f"Error running { script_name } : { result .stderr } " , file = sys .stderr )
144+ all_success = False
145+
146+ return all_success
147+
148+
103149def main ():
104150 """Main function to generate cloud configurations."""
105151 print ("Cloud Provider Configuration Summary" )
@@ -121,8 +167,13 @@ def main():
121167 print (f"⚠ { summary } " )
122168 print ()
123169
124- # AWS (placeholder - not implemented)
125- print ("⚠ AWS: Dynamic configuration not yet implemented" )
170+ # AWS - Generate Kconfig files
171+ kconfig_generated = generate_aws_kconfig ()
172+ if kconfig_generated :
173+ print ("✓ AWS: Kconfig files generated successfully" )
174+ else :
175+ print ("⚠ AWS: Failed to generate Kconfig files - using defaults" )
176+ print ()
126177
127178 # Azure (placeholder - not implemented)
128179 print ("⚠ Azure: Dynamic configuration not yet implemented" )
0 commit comments