Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@
<ul>
<li><a href="#section-outputs-cloudformation"><span class="lbl">CloudFormation</span></a></li>
<li><a href="#section-outputs-tf"><span class="lbl">Terraform</span></a></li>
<li><a href="#section-outputs-tf-imports"><span class="lbl">Terraform Imports</span></a></li>
<li><a href="#section-outputs-troposphere"><span class="lbl">Troposphere</span></a></li>
<li><a href="#section-outputs-cdk"><span class="lbl">CDK (V1)</span></a></li>
<li><a href="#section-outputs-cdkv2"><span class="lbl">CDK (V2)</span></a></li>
Expand Down Expand Up @@ -657,6 +658,7 @@ <h3 id="header-title"></h3>
<button id="header-button-copy-cfn" type="button" class="f2-header-button btn btn-default-outline" style="display: none;"><i class="fa fa-files-o"></i>&nbsp;&nbsp;Copy</button>
<button id="header-button-copy-tf" type="button" class="f2-header-button btn btn-default-outline" style="display: none;"><i class="fa fa-files-o"></i>&nbsp;&nbsp;Copy</button>
<button id="header-button-copy-troposphere" type="button" class="f2-header-button btn btn-default-outline" style="display: none;"><i class="fa fa-files-o"></i>&nbsp;&nbsp;Copy</button>
<button id="header-button-copy-tf-imports" type="button" class="f2-header-button btn btn-default-outline" style="display: none;"><i class="fa fa-files-o"></i>&nbsp;&nbsp;Copy</button>
<button id="header-button-copy-cdk" type="button" class="f2-header-button btn btn-default-outline" style="display: none;"><i class="fa fa-files-o"></i>&nbsp;&nbsp;Copy</button>
<button id="header-button-copy-cdkv2" type="button" class="f2-header-button btn btn-default-outline" style="display: none;"><i class="fa fa-files-o"></i>&nbsp;&nbsp;Copy</button>
<button id="header-button-copy-cdktf" type="button" class="f2-header-button btn btn-default-outline" style="display: none;"><i class="fa fa-files-o"></i>&nbsp;&nbsp;Copy</button>
Expand Down Expand Up @@ -1546,6 +1548,12 @@ <h5>Default Resources</h5>
</div>
</section>

<section id="section-outputs-tf-imports" data-section-breadcrumb1-title="Outputs" data-section-breadcrumb1-link="#section-outputs-cloudformation" data-section-title="Terraform Imports" class="former2-section" style="display: none;">
<div id='tf_imports_container'>
<textarea id='tf_imports'></textarea>
</div>
</section>

<section id="section-outputs-troposphere" data-section-breadcrumb1-title="Outputs" data-section-breadcrumb1-link="#section-outputs-cloudformation" data-section-title="Troposphere" class="former2-section box-typical steps-numeric-block" style="display: none;">
<div id='troposphere_container'>
<textarea id='troposphere'></textarea>
Expand Down Expand Up @@ -1626,6 +1634,7 @@ <h5>Default Resources</h5>
<script src="js/RelationshipTypeMap.js"></script>

<script src="js/deferred-datatable.js"></script>
<script src="js/terraformImportMappings.js"></script>
<script src="js/mappings.js"></script>
<script src="js/datatables.js"></script>

Expand Down
21 changes: 21 additions & 0 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,7 @@ $(document).ready(function(){
$('#header-button-import-cfn').attr('style', 'margin-left: 16px; display: none;');
$('#header-button-download-diagram').attr('style', 'display: none;');
$('#header-button-copy-tf').attr('style', 'display: none;');
$('#header-button-copy-tf-imports').attr('style', 'display: none;');
$('#header-button-copy-troposphere').attr('style', 'display: none;');
$('#header-button-copy-cdk').attr('style', 'display: none;');
$('#header-button-copy-cdkv2').attr('style', 'display: none;');
Expand Down Expand Up @@ -828,6 +829,13 @@ $(document).ready(function(){
theme: "material"
});
}, 1);
} else if (location.hash == "#section-outputs-tf-imports") {
$('#header-button-copy-tf-imports').attr('style', '');
$('#header-button-clear-outputs').attr('style', 'margin-left: 16px;');

setTimeout(function(){
tf_imports_editor.refresh();
}, 1);
} else if (location.hash == "#section-outputs-diagram") {
$('#header-button-download-diagram').attr('style', '');
$('#header-button-clear-outputs').attr('style', 'margin-left: 16px;');
Expand Down Expand Up @@ -906,6 +914,7 @@ $(document).ready(function(){

cfn_editor.getDoc().setValue(mapped_outputs['cfn']);
tf_editor.getDoc().setValue(mapped_outputs['tf']);
tf_imports_editor.getDoc().setValue(mapped_outputs['tf_imports']);
troposphere_editor.getDoc().setValue(mapped_outputs['troposphere']);
cdk_editor.getDoc().setValue(mapped_outputs['cdk']);
cdkv2_editor.getDoc().setValue(mapped_outputs['cdkv2']);
Expand Down Expand Up @@ -1158,6 +1167,18 @@ $(document).ready(function(){
});
setCopyEvent('#header-button-copy-raw', raw_editor);

tf_imports_editor = CodeMirror.fromTextArea(document.getElementById('tf_imports'), {
lineNumbers: true,
gutters: ["f2gutter", "CodeMirror-linenumbers"],
lineWrapping: true,
mode: "shell",
theme: "material",
indentUnit: 4,
height: "auto",
viewportMargin: Infinity,
scrollbarStyle: "null"
});
setCopyEvent('#header-button-copy-tf-imports', tf_imports_editor);
$('#header-button-clear-outputs').click(function() {
output_objects = [];
regenerateOutputs();
Expand Down
4 changes: 3 additions & 1 deletion js/mappings.js
Original file line number Diff line number Diff line change
Expand Up @@ -4422,7 +4422,9 @@ template = Template()

template.add_version("2010-09-09")

`}`
`}`,

'tf_imports': generateTerraformImports(tracked_resources)
}

if (has_cfn) {
Expand Down
Loading