IF Commons GitHub

logical/cloudformation

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0003-estate-iac-importers FR-003

CloudFormation: a template, as JSON or as YAML without the short-form tags (!Ref and the others are tags, which the YAML reader refuses; aws cloudformation get-template and cfn-flip --json give the JSON). Every resource becomes an asset (a cloud resource of the provider aws; the partition is told from the region where the template says one in a parameter's default), and the links are DependsOn, Ref and Fn::GetAtt. Only the type and the logical name are copied: the properties are not.

import { importCloudFormation } from "./cloudformation.ts";
importCloudFormation("t.json", JSON.stringify({ Resources: { Web: { Type: "AWS::EC2::Instance" } } })).assets.length; // 1

Source: commons/estate-iac/src/logical/cloudformation.ts

1 of 2 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

logical.importCloudFormationfunctionno test imports it
function importCloudFormation(source: string, text: string): Imports

The resources of a template as assets and links.

importCloudFormationfunction
function importCloudFormation(source: string, text: string): Imports

The resources of a template as assets and links.

Imported by 7 tests of the run (7 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.