Skip to content

Commit

Permalink
Update for first working program
Browse files Browse the repository at this point in the history
  • Loading branch information
iph committed Oct 4, 2021
1 parent 484e940 commit 38fe434
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,22 @@ fn main() {

let cfn_tree = CloudformationParseTree::build(&value).unwrap();
let reference_table = ReferenceTable::new(&cfn_tree);

let import = Importer::new(&cfn_tree);

println!("{}", import.synthesize().join("\n"));
println!("import * as cdk from 'aws-cdk';");
println!("export interface NoctStackProps extends cdk.StackProps {{");
for (name, parameter) in cfn_tree.parameters.params {
println!(
"\treadonly {}: {}",
name,
camel_case(&parameter.parameter_type)
)
}
println!("}}");
println!("export class NoctStack extends cdk.Stack {{");
println!("\tconstructor(scope: cdk.App, id: string, props: NoctStackProps){{");
println!("\t\tsuper(scope, id, props);");
println!("{}", cfn_tree.mappings.synthesize());

for (_, cond) in cfn_tree.conditions.conditions.iter() {
Expand All @@ -55,5 +67,4 @@ fn main() {
}
println!("}});");
}
println!("====================================");
}

0 comments on commit 38fe434

Please sign in to comment.