├── .gitignore
├── CODE_OF_CONDUCT
├── Dockerfile
├── LICENSE
├── contrib
├── LICENSE
├── aws.json
└── core_providers.json
├── docs
├── CHANGELOG.md
├── LICENSE
├── README.md
├── _config.yml
├── _includes
│ └── head-custom.html
├── _layouts
│ └── default.html
├── design.md
├── editor.md
├── favicon.ico
├── hcl.md
├── images
│ ├── create_edge.png
│ ├── create_edge.xcf
│ ├── create_resource.png
│ ├── create_resource.xcf
│ ├── edit_resource.png
│ ├── edit_resource.xcf
│ ├── export_hcl.png
│ ├── export_hcl.xcf
│ ├── graph_example.png
│ ├── graph_example.xcf
│ ├── provider_selection.png
│ ├── provider_selection.xcf
│ ├── providers_modal.png
│ └── providers_modal.xcf
├── providers.md
└── roadmap.md
├── package-lock.json
├── package.json
├── public
├── LICENSE
├── fulllogo_transparent_nobuffer.png
├── icononly_transparent_nobuffer.ico
├── icononly_transparent_nobuffer.png
└── index.html
├── rollup.config.js
├── scripts
└── setupTypeScript.js
└── src
├── App.svelte
├── Editor.svelte
├── design.js
├── hcl.js
├── klay.js
├── main.js
├── main.scss
├── prevent_navigation.js
├── providers.js
├── store.js
├── tfSchema.js
└── utils.js
/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules/
2 | /public/build/
3 | local/
4 | .idea/
5 |
6 | .DS_Store
7 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT:
--------------------------------------------------------------------------------
1 |
2 | # Contributor Covenant Code of Conduct
3 |
4 | ## Our Pledge
5 |
6 | We as members, contributors, and leaders pledge to make participation in our
7 | community a harassment-free experience for everyone, regardless of age, body
8 | size, visible or invisible disability, ethnicity, sex characteristics, gender
9 | identity and expression, level of experience, education, socio-economic status,
10 | nationality, personal appearance, race, caste, color, religion, or sexual
11 | identity and orientation.
12 |
13 | We pledge to act and interact in ways that contribute to an open, welcoming,
14 | diverse, inclusive, and healthy community.
15 |
16 | ## Our Standards
17 |
18 | Examples of behavior that contributes to a positive environment for our
19 | community include:
20 |
21 | * Demonstrating empathy and kindness toward other people
22 | * Being respectful of differing opinions, viewpoints, and experiences
23 | * Giving and gracefully accepting constructive feedback
24 | * Accepting responsibility and apologizing to those affected by our mistakes,
25 | and learning from the experience
26 | * Focusing on what is best not just for us as individuals, but for the overall
27 | community
28 |
29 | Examples of unacceptable behavior include:
30 |
31 | * The use of sexualized language or imagery, and sexual attention or advances of
32 | any kind
33 | * Trolling, insulting or derogatory comments, and personal or political attacks
34 | * Public or private harassment
35 | * Publishing others' private information, such as a physical or email address,
36 | without their explicit permission
37 | * Other conduct which could reasonably be considered inappropriate in a
38 | professional setting
39 |
40 | ## Enforcement Responsibilities
41 |
42 | Community leaders are responsible for clarifying and enforcing our standards of
43 | acceptable behavior and will take appropriate and fair corrective action in
44 | response to any behavior that they deem inappropriate, threatening, offensive,
45 | or harmful.
46 |
47 | Community leaders have the right and responsibility to remove, edit, or reject
48 | comments, commits, code, wiki edits, issues, and other contributions that are
49 | not aligned to this Code of Conduct, and will communicate reasons for moderation
50 | decisions when appropriate.
51 |
52 | ## Scope
53 |
54 | This Code of Conduct applies within all community spaces, and also applies when
55 | an individual is officially representing the community in public spaces.
56 | Examples of representing our community include using an official e-mail address,
57 | posting via an official social media account, or acting as an appointed
58 | representative at an online or offline event.
59 |
60 | ## Enforcement
61 |
62 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
63 | reported to the community leaders responsible for enforcement at
64 | [tbd]().
65 | All complaints will be reviewed and investigated promptly and fairly.
66 |
67 | All community leaders are obligated to respect the privacy and security of the
68 | reporter of any incident.
69 |
70 | ## Enforcement Guidelines
71 |
72 | Community leaders will follow these Community Impact Guidelines in determining
73 | the consequences for any action they deem in violation of this Code of Conduct:
74 |
75 | ### 1. Correction
76 |
77 | **Community Impact**: Use of inappropriate language or other behavior deemed
78 | unprofessional or unwelcome in the community.
79 |
80 | **Consequence**: A private, written warning from community leaders, providing
81 | clarity around the nature of the violation and an explanation of why the
82 | behavior was inappropriate. A public apology may be requested.
83 |
84 | ### 2. Warning
85 |
86 | **Community Impact**: A violation through a single incident or series of
87 | actions.
88 |
89 | **Consequence**: A warning with consequences for continued behavior. No
90 | interaction with the people involved, including unsolicited interaction with
91 | those enforcing the Code of Conduct, for a specified period of time. This
92 | includes avoiding interactions in community spaces as well as external channels
93 | like social media. Violating these terms may lead to a temporary or permanent
94 | ban.
95 |
96 | ### 3. Temporary Ban
97 |
98 | **Community Impact**: A serious violation of community standards, including
99 | sustained inappropriate behavior.
100 |
101 | **Consequence**: A temporary ban from any sort of interaction or public
102 | communication with the community for a specified period of time. No public or
103 | private interaction with the people involved, including unsolicited interaction
104 | with those enforcing the Code of Conduct, is allowed during this period.
105 | Violating these terms may lead to a permanent ban.
106 |
107 | ### 4. Permanent Ban
108 |
109 | **Community Impact**: Demonstrating a pattern of violation of community
110 | standards, including sustained inappropriate behavior, harassment of an
111 | individual, or aggression toward or disparagement of classes of individuals.
112 |
113 | **Consequence**: A permanent ban from any sort of public interaction within the
114 | community.
115 |
116 | ## Attribution
117 |
118 | This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119 | version 2.1, available at
120 | [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
121 |
122 | Community Impact Guidelines were inspired by
123 | [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
124 |
125 | For answers to common questions about this code of conduct, see the FAQ at
126 | [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
127 | [https://www.contributor-covenant.org/translations][translations].
128 |
129 | [homepage]: https://www.contributor-covenant.org
130 | [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
131 | [Mozilla CoC]: https://github.com/mozilla/diversity
132 | [FAQ]: https://www.contributor-covenant.org/faq
133 | [translations]: https://www.contributor-covenant.org/translations
134 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM node:17
2 |
3 | WORKDIR /usr/src/app
4 |
5 | COPY package*.json ./
6 | RUN npm install
7 |
8 | COPY . .
9 |
10 | EXPOSE 5000/tcp
11 |
12 | CMD ["npm", "run", "dev"]
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Mozilla Public License Version 2.0
2 | ==================================
3 |
4 | 1. Definitions
5 | --------------
6 |
7 | 1.1. "Contributor"
8 | means each individual or legal entity that creates, contributes to
9 | the creation of, or owns Covered Software.
10 |
11 | 1.2. "Contributor Version"
12 | means the combination of the Contributions of others (if any) used
13 | by a Contributor and that particular Contributor's Contribution.
14 |
15 | 1.3. "Contribution"
16 | means Covered Software of a particular Contributor.
17 |
18 | 1.4. "Covered Software"
19 | means Source Code Form to which the initial Contributor has attached
20 | the notice in Exhibit A, the Executable Form of such Source Code
21 | Form, and Modifications of such Source Code Form, in each case
22 | including portions thereof.
23 |
24 | 1.5. "Incompatible With Secondary Licenses"
25 | means
26 |
27 | (a) that the initial Contributor has attached the notice described
28 | in Exhibit B to the Covered Software; or
29 |
30 | (b) that the Covered Software was made available under the terms of
31 | version 1.1 or earlier of the License, but not also under the
32 | terms of a Secondary License.
33 |
34 | 1.6. "Executable Form"
35 | means any form of the work other than Source Code Form.
36 |
37 | 1.7. "Larger Work"
38 | means a work that combines Covered Software with other material, in
39 | a separate file or files, that is not Covered Software.
40 |
41 | 1.8. "License"
42 | means this document.
43 |
44 | 1.9. "Licensable"
45 | means having the right to grant, to the maximum extent possible,
46 | whether at the time of the initial grant or subsequently, any and
47 | all of the rights conveyed by this License.
48 |
49 | 1.10. "Modifications"
50 | means any of the following:
51 |
52 | (a) any file in Source Code Form that results from an addition to,
53 | deletion from, or modification of the contents of Covered
54 | Software; or
55 |
56 | (b) any new file in Source Code Form that contains any Covered
57 | Software.
58 |
59 | 1.11. "Patent Claims" of a Contributor
60 | means any patent claim(s), including without limitation, method,
61 | process, and apparatus claims, in any patent Licensable by such
62 | Contributor that would be infringed, but for the grant of the
63 | License, by the making, using, selling, offering for sale, having
64 | made, import, or transfer of either its Contributions or its
65 | Contributor Version.
66 |
67 | 1.12. "Secondary License"
68 | means either the GNU General Public License, Version 2.0, the GNU
69 | Lesser General Public License, Version 2.1, the GNU Affero General
70 | Public License, Version 3.0, or any later versions of those
71 | licenses.
72 |
73 | 1.13. "Source Code Form"
74 | means the form of the work preferred for making modifications.
75 |
76 | 1.14. "You" (or "Your")
77 | means an individual or a legal entity exercising rights under this
78 | License. For legal entities, "You" includes any entity that
79 | controls, is controlled by, or is under common control with You. For
80 | purposes of this definition, "control" means (a) the power, direct
81 | or indirect, to cause the direction or management of such entity,
82 | whether by contract or otherwise, or (b) ownership of more than
83 | fifty percent (50%) of the outstanding shares or beneficial
84 | ownership of such entity.
85 |
86 | 2. License Grants and Conditions
87 | --------------------------------
88 |
89 | 2.1. Grants
90 |
91 | Each Contributor hereby grants You a world-wide, royalty-free,
92 | non-exclusive license:
93 |
94 | (a) under intellectual property rights (other than patent or trademark)
95 | Licensable by such Contributor to use, reproduce, make available,
96 | modify, display, perform, distribute, and otherwise exploit its
97 | Contributions, either on an unmodified basis, with Modifications, or
98 | as part of a Larger Work; and
99 |
100 | (b) under Patent Claims of such Contributor to make, use, sell, offer
101 | for sale, have made, import, and otherwise transfer either its
102 | Contributions or its Contributor Version.
103 |
104 | 2.2. Effective Date
105 |
106 | The licenses granted in Section 2.1 with respect to any Contribution
107 | become effective for each Contribution on the date the Contributor first
108 | distributes such Contribution.
109 |
110 | 2.3. Limitations on Grant Scope
111 |
112 | The licenses granted in this Section 2 are the only rights granted under
113 | this License. No additional rights or licenses will be implied from the
114 | distribution or licensing of Covered Software under this License.
115 | Notwithstanding Section 2.1(b) above, no patent license is granted by a
116 | Contributor:
117 |
118 | (a) for any code that a Contributor has removed from Covered Software;
119 | or
120 |
121 | (b) for infringements caused by: (i) Your and any other third party's
122 | modifications of Covered Software, or (ii) the combination of its
123 | Contributions with other software (except as part of its Contributor
124 | Version); or
125 |
126 | (c) under Patent Claims infringed by Covered Software in the absence of
127 | its Contributions.
128 |
129 | This License does not grant any rights in the trademarks, service marks,
130 | or logos of any Contributor (except as may be necessary to comply with
131 | the notice requirements in Section 3.4).
132 |
133 | 2.4. Subsequent Licenses
134 |
135 | No Contributor makes additional grants as a result of Your choice to
136 | distribute the Covered Software under a subsequent version of this
137 | License (see Section 10.2) or under the terms of a Secondary License (if
138 | permitted under the terms of Section 3.3).
139 |
140 | 2.5. Representation
141 |
142 | Each Contributor represents that the Contributor believes its
143 | Contributions are its original creation(s) or it has sufficient rights
144 | to grant the rights to its Contributions conveyed by this License.
145 |
146 | 2.6. Fair Use
147 |
148 | This License is not intended to limit any rights You have under
149 | applicable copyright doctrines of fair use, fair dealing, or other
150 | equivalents.
151 |
152 | 2.7. Conditions
153 |
154 | Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
155 | in Section 2.1.
156 |
157 | 3. Responsibilities
158 | -------------------
159 |
160 | 3.1. Distribution of Source Form
161 |
162 | All distribution of Covered Software in Source Code Form, including any
163 | Modifications that You create or to which You contribute, must be under
164 | the terms of this License. You must inform recipients that the Source
165 | Code Form of the Covered Software is governed by the terms of this
166 | License, and how they can obtain a copy of this License. You may not
167 | attempt to alter or restrict the recipients' rights in the Source Code
168 | Form.
169 |
170 | 3.2. Distribution of Executable Form
171 |
172 | If You distribute Covered Software in Executable Form then:
173 |
174 | (a) such Covered Software must also be made available in Source Code
175 | Form, as described in Section 3.1, and You must inform recipients of
176 | the Executable Form how they can obtain a copy of such Source Code
177 | Form by reasonable means in a timely manner, at a charge no more
178 | than the cost of distribution to the recipient; and
179 |
180 | (b) You may distribute such Executable Form under the terms of this
181 | License, or sublicense it under different terms, provided that the
182 | license for the Executable Form does not attempt to limit or alter
183 | the recipients' rights in the Source Code Form under this License.
184 |
185 | 3.3. Distribution of a Larger Work
186 |
187 | You may create and distribute a Larger Work under terms of Your choice,
188 | provided that You also comply with the requirements of this License for
189 | the Covered Software. If the Larger Work is a combination of Covered
190 | Software with a work governed by one or more Secondary Licenses, and the
191 | Covered Software is not Incompatible With Secondary Licenses, this
192 | License permits You to additionally distribute such Covered Software
193 | under the terms of such Secondary License(s), so that the recipient of
194 | the Larger Work may, at their option, further distribute the Covered
195 | Software under the terms of either this License or such Secondary
196 | License(s).
197 |
198 | 3.4. Notices
199 |
200 | You may not remove or alter the substance of any license notices
201 | (including copyright notices, patent notices, disclaimers of warranty,
202 | or limitations of liability) contained within the Source Code Form of
203 | the Covered Software, except that You may alter any license notices to
204 | the extent required to remedy known factual inaccuracies.
205 |
206 | 3.5. Application of Additional Terms
207 |
208 | You may choose to offer, and to charge a fee for, warranty, support,
209 | indemnity or liability obligations to one or more recipients of Covered
210 | Software. However, You may do so only on Your own behalf, and not on
211 | behalf of any Contributor. You must make it absolutely clear that any
212 | such warranty, support, indemnity, or liability obligation is offered by
213 | You alone, and You hereby agree to indemnify every Contributor for any
214 | liability incurred by such Contributor as a result of warranty, support,
215 | indemnity or liability terms You offer. You may include additional
216 | disclaimers of warranty and limitations of liability specific to any
217 | jurisdiction.
218 |
219 | 4. Inability to Comply Due to Statute or Regulation
220 | ---------------------------------------------------
221 |
222 | If it is impossible for You to comply with any of the terms of this
223 | License with respect to some or all of the Covered Software due to
224 | statute, judicial order, or regulation then You must: (a) comply with
225 | the terms of this License to the maximum extent possible; and (b)
226 | describe the limitations and the code they affect. Such description must
227 | be placed in a text file included with all distributions of the Covered
228 | Software under this License. Except to the extent prohibited by statute
229 | or regulation, such description must be sufficiently detailed for a
230 | recipient of ordinary skill to be able to understand it.
231 |
232 | 5. Termination
233 | --------------
234 |
235 | 5.1. The rights granted under this License will terminate automatically
236 | if You fail to comply with any of its terms. However, if You become
237 | compliant, then the rights granted under this License from a particular
238 | Contributor are reinstated (a) provisionally, unless and until such
239 | Contributor explicitly and finally terminates Your grants, and (b) on an
240 | ongoing basis, if such Contributor fails to notify You of the
241 | non-compliance by some reasonable means prior to 60 days after You have
242 | come back into compliance. Moreover, Your grants from a particular
243 | Contributor are reinstated on an ongoing basis if such Contributor
244 | notifies You of the non-compliance by some reasonable means, this is the
245 | first time You have received notice of non-compliance with this License
246 | from such Contributor, and You become compliant prior to 30 days after
247 | Your receipt of the notice.
248 |
249 | 5.2. If You initiate litigation against any entity by asserting a patent
250 | infringement claim (excluding declaratory judgment actions,
251 | counter-claims, and cross-claims) alleging that a Contributor Version
252 | directly or indirectly infringes any patent, then the rights granted to
253 | You by any and all Contributors for the Covered Software under Section
254 | 2.1 of this License shall terminate.
255 |
256 | 5.3. In the event of termination under Sections 5.1 or 5.2 above, all
257 | end user license agreements (excluding distributors and resellers) which
258 | have been validly granted by You or Your distributors under this License
259 | prior to termination shall survive termination.
260 |
261 | ************************************************************************
262 | * *
263 | * 6. Disclaimer of Warranty *
264 | * ------------------------- *
265 | * *
266 | * Covered Software is provided under this License on an "as is" *
267 | * basis, without warranty of any kind, either expressed, implied, or *
268 | * statutory, including, without limitation, warranties that the *
269 | * Covered Software is free of defects, merchantable, fit for a *
270 | * particular purpose or non-infringing. The entire risk as to the *
271 | * quality and performance of the Covered Software is with You. *
272 | * Should any Covered Software prove defective in any respect, You *
273 | * (not any Contributor) assume the cost of any necessary servicing, *
274 | * repair, or correction. This disclaimer of warranty constitutes an *
275 | * essential part of this License. No use of any Covered Software is *
276 | * authorized under this License except under this disclaimer. *
277 | * *
278 | ************************************************************************
279 |
280 | ************************************************************************
281 | * *
282 | * 7. Limitation of Liability *
283 | * -------------------------- *
284 | * *
285 | * Under no circumstances and under no legal theory, whether tort *
286 | * (including negligence), contract, or otherwise, shall any *
287 | * Contributor, or anyone who distributes Covered Software as *
288 | * permitted above, be liable to You for any direct, indirect, *
289 | * special, incidental, or consequential damages of any character *
290 | * including, without limitation, damages for lost profits, loss of *
291 | * goodwill, work stoppage, computer failure or malfunction, or any *
292 | * and all other commercial damages or losses, even if such party *
293 | * shall have been informed of the possibility of such damages. This *
294 | * limitation of liability shall not apply to liability for death or *
295 | * personal injury resulting from such party's negligence to the *
296 | * extent applicable law prohibits such limitation. Some *
297 | * jurisdictions do not allow the exclusion or limitation of *
298 | * incidental or consequential damages, so this exclusion and *
299 | * limitation may not apply to You. *
300 | * *
301 | ************************************************************************
302 |
303 | 8. Litigation
304 | -------------
305 |
306 | Any litigation relating to this License may be brought only in the
307 | courts of a jurisdiction where the defendant maintains its principal
308 | place of business and such litigation shall be governed by laws of that
309 | jurisdiction, without reference to its conflict-of-law provisions.
310 | Nothing in this Section shall prevent a party's ability to bring
311 | cross-claims or counter-claims.
312 |
313 | 9. Miscellaneous
314 | ----------------
315 |
316 | This License represents the complete agreement concerning the subject
317 | matter hereof. If any provision of this License is held to be
318 | unenforceable, such provision shall be reformed only to the extent
319 | necessary to make it enforceable. Any law or regulation which provides
320 | that the language of a contract shall be construed against the drafter
321 | shall not be used to construe this License against a Contributor.
322 |
323 | 10. Versions of the License
324 | ---------------------------
325 |
326 | 10.1. New Versions
327 |
328 | Mozilla Foundation is the license steward. Except as provided in Section
329 | 10.3, no one other than the license steward has the right to modify or
330 | publish new versions of this License. Each version will be given a
331 | distinguishing version number.
332 |
333 | 10.2. Effect of New Versions
334 |
335 | You may distribute the Covered Software under the terms of the version
336 | of the License under which You originally received the Covered Software,
337 | or under the terms of any subsequent version published by the license
338 | steward.
339 |
340 | 10.3. Modified Versions
341 |
342 | If you create software not governed by this License, and you want to
343 | create a new license for such software, you may create and use a
344 | modified version of this License if you rename the license and remove
345 | any references to the name of the license steward (except to note that
346 | such modified license differs from this License).
347 |
348 | 10.4. Distributing Source Code Form that is Incompatible With Secondary
349 | Licenses
350 |
351 | If You choose to distribute Source Code Form that is Incompatible With
352 | Secondary Licenses under the terms of this version of the License, the
353 | notice described in Exhibit B of this License must be attached.
354 |
355 | Exhibit A - Source Code Form License Notice
356 | -------------------------------------------
357 |
358 | This Source Code Form is subject to the terms of the Mozilla Public
359 | License, v. 2.0. If a copy of the MPL was not distributed with this
360 | file, You can obtain one at https://mozilla.org/MPL/2.0/.
361 |
362 | If it is not possible or desirable to put the notice in a particular
363 | file, then You may include the notice in a location (such as a LICENSE
364 | file in a relevant directory) where a recipient would be likely to look
365 | for such a notice.
366 |
367 | You may add additional accurate notices of copyright ownership.
368 |
369 | Exhibit B - "Incompatible With Secondary Licenses" Notice
370 | ---------------------------------------------------------
371 |
372 | This Source Code Form is "Incompatible With Secondary Licenses", as
373 | defined by the Mozilla Public License, v. 2.0.
--------------------------------------------------------------------------------
/contrib/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright 2021 Jason Rauen
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4 |
5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6 |
7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/docs/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 | All notable changes to this project will be documented in this file.
3 |
4 | ## Unreleased
5 |
6 | ## 20211204.1
7 | ### Added
8 | - Users can now add, set, remove, import, and export Terraform vairables, outputs, and locals
9 | ### Changed
10 | - Made some minor changes to improve accessibility
11 |
12 | ## 20211128.1
13 | Initialize changelog
14 | ### Added
15 | - Providers can be configured in the editor pane
16 | - The `terraform` block can also be configured this way
17 | - A Pan/Zoom control in the diagram area
18 | - Closes #1
19 | ### Changed
20 | - The HCL import will now handle `provider` and `terraform` blocks
21 | - The `terraform` block `required_providers` attribute is required for proper parsing
22 |
23 |
24 |
32 |
--------------------------------------------------------------------------------
/docs/LICENSE:
--------------------------------------------------------------------------------
1 | This Source Code Form is subject to the terms of the Mozilla Public
2 | License, v. 2.0. If a copy of the MPL was not distributed with this
3 | file, You can obtain one at https://mozilla.org/MPL/2.0/.
--------------------------------------------------------------------------------
/docs/README.md:
--------------------------------------------------------------------------------
1 | Terraforge is an application for generating Terraform code visually. Users select providers and then add resources as
2 | nodes to a graph that can be edited and arranged. Links between nodes appear automatically as the configuration of a
3 | node makes references to other nodes. When finished the design can be exported as Terraform HCL. The configuration will
4 | include all settings and configurations entered for the nodes.
5 |
6 | 
7 |
8 | ## Background
9 | Terraform is a tool for managing infrastructure and APIs in a codified manner utilizing a combination of a command-line
10 | application, a series of vendor specific plugins, and a declarative configuration language written in HCL. The
11 | configuration uses a flat file structure with layers of abstraction attained through local and remote modules. Writing
12 | Terraform configurations create many complex relationships between resources since each resource may rely on attributes
13 | of others.
14 |
15 | The Terraform application generates a Directed Acyclic Graph (DAG) based on the configuration which establishes the
16 | correct order of resource manipulation. There are several tools that allow users to input configuration files then
17 | output and visualize the DAG. However, there seems to be a lack of any tool that can reverse this process, starting
18 | with a visual representation of the desired infrastructure and exporting the Terraform code. This was the inspiration
19 | for Terraforge.
20 |
21 | ## Get started
22 | ### Running the App
23 | Install the dependencies...
24 |
25 | ```bash
26 | git clone https://github.com/badarsebard/terraforge.git
27 | cd terraforge
28 | npm install
29 | ```
30 |
31 | ...then start [Rollup](https://rollupjs.org):
32 |
33 | ```bash
34 | npm run dev
35 | ```
36 |
37 | Navigate to [localhost:5000](http://localhost:5000). You should see the app running.
38 |
39 | ### Using the App
40 | To get started right away use the Wizard under the Providers menu.
41 | - Select the Official and AWS checkboxes in the modal and click Submit.
42 | 
43 | - Select the `hashicorp/aws` provider from the dropdown on the right and choose either resource or data source radio buttons.
44 | 
45 | - Double-click an entry to add a node of that type to the graph in the center of the page.
46 | 
47 | - Click a node to open a pane on the left-hand side of the window where the name and attributes of the node can be
48 | modified.
49 | 
50 | - References between nodes can be made by entering `$type.name.attributes` in the attribute; e.g.`$aws_lb.front_end.arn`.
51 | 
52 | - After creating and editing some resources, export the Terraform configuration by using Export in the HCL menu.
53 | 
54 | - The browser will download a file called `terraforge.tf` which will contain the Terraform configuration represented by the diagram and based on the configurations entered.
55 | ```terraform
56 | resource "aws_lb" "front_end" {}
57 | resource "aws_lb_listener" "https" {
58 | load_balancer_arn = aws_lb.front_end.arn
59 | }
60 | ```
61 |
62 | Please note that the app is unable to, at this time, execute any Terraform commands so the output is unformatted and unvalidated.
63 |
64 | ## Documentation
65 | Learn about managing the available [providers](providers.md) and how resources and data sources are added.
66 |
67 | See all the details about the [editor](editor.md) and its components.
68 |
69 | Save and load work using [design](design.md) import and export.
70 |
71 | Turn your graph into a [Terraform config](hcl.md) by exporting HCL or pick up with an existing project using the import feature.
72 |
73 | See the [roadmap](roadmap.md) for a list of planned features.
74 |
75 | # License
76 | The majority of this project is licensed under the [Mozilla Public License, v. 2.0](https://mozilla.org/MPL/2.0/). The
77 | `contrib/` directory and its contents are licensed under the [MIT](https://www.mit.edu/~amini/LICENSE.md) license. Any
78 | file which does not contain the MPL license header is still covered by the MPL if it is located in a directory
79 | containing a `LICENSE` with the header.
80 |
--------------------------------------------------------------------------------
/docs/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-slate
2 | title: Terraforge
--------------------------------------------------------------------------------
/docs/_includes/head-custom.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/_layouts/default.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
59 |
60 |
61 |
69 |
70 |
--------------------------------------------------------------------------------
/docs/design.md:
--------------------------------------------------------------------------------
1 | # Graph Import/Export
2 | Terraforge utilizes the cytoscape js library for the rendering and manipulation of the configuration graph. This library
3 | can import and export a representation of the graph and its data in a JSON format. Terraforge utilizes this
4 | import/export capability to save and load various configurations that users develop and work on. This is key since the
5 | application (currently) does not save state between sessions or even page loads. Refreshing or navigating to another
6 | page will lose any unsaved progress. The browser _should_ present a warning to the user if it detects any changes prior
7 | to navigation or refresh but this mechanism should not be relied on exclusively. The recommended method is to export
8 | the JSON data and save it for future import.
9 |
10 | ## Import/Export Walkthrough
11 | The navbar at the top of the page has a dropdown menu labeled `Design`. Hovering over this menu item will present the
12 | option to Import or Export. Clicking export will cause the browser to immediately download a file called
13 | `terraforge.json`. Clicking the import button will open a file dialog to select the JSON file later on. Please note that
14 | the diagram may not display immediately if a providers schema has not yet been loaded.
--------------------------------------------------------------------------------
/docs/editor.md:
--------------------------------------------------------------------------------
1 | # Editor
2 | The editor has three main components: the resource selector, diagram, and node pane.
3 |
4 | ## Resource Selector
5 | The resource selector will appear on the right-hand side of the page once the providers schema is uploaded. Each
6 | provider will appear as an option in the dropdown and the radio buttons select between resource and data source types.
7 | Once both are selected a list of available resource for that provider and resource type. Double-clicking on a resource
8 | will add a new node to the diagram.
9 |
10 | ## Diagram
11 | The center portion of the page contains the current diagram of nodes and edges corresponding to the resources and their
12 | relationships. This area can be used to reposition the nodes and has the ability to pan and zoom. Clicking a node will
13 | open the node pane where the attributes of the node can be modified.
14 |
15 | ## Node Pane
16 | While a node on the diagram is selected (highlighted in blue) the node pane will open on the left-hand side of the page.
17 | This pane can be used to set each of the attributes and blocks associated with the resource or data source. The
18 | uppermost input is the name of the resource and will be reflected in the label of the node in the diagram. To the right
19 | of this input is a button with a times-circle icon that, when clicked, will delete the resource from the graph.
20 |
21 | The names of the attributes will appear as placeholders within text box inputs or labels to checkboxes for boolean
22 | values. If the resource accepts configuration blocks then the name of each block type will appear along with a button
23 | and green plus icon. Pushing the icon will add a textarea input for that block type. The user will need to enter the
24 | properly formatted HCL configuration for the block. Future versions of the app will provide independent inputs for the
25 | attributes of the block. Some resources accept multiple of the same kind of block. Pressing the button will add
26 | additional textarea inputs. If the schema specifies a maximum number of these configuration blocks, then no additional
27 | textarea will be added.
28 |
29 | As resources are configured throughout the diagram there will likely be need to make references between resources.
30 | These relationships are specified by referencing the type and name of a resource, prepended by a dollar-sign (`$`);
31 | e.g. `$aws_lb.front_end`. Like a Terraform configuration the user can specify attributes of the resource by adding
32 | additional segments separated by a period (`.`); e.g. `$aws_lb.front_end.arn`. However, only the type and name of the
33 | resource are required to create an edge between the two nodes.
--------------------------------------------------------------------------------
/docs/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/badarsebard/terraforge/560a6897c40df98182785359b011f58fb1e8ade8/docs/favicon.ico
--------------------------------------------------------------------------------
/docs/hcl.md:
--------------------------------------------------------------------------------
1 | # HCL
2 |
3 | ## Export
4 | The primary purpose of Terraforge is to provide a visual way to create Terraform configurations. This is accomplished
5 | through the `Export HCL` menu item in the navbar. This will take the existing diagram and all associated configuration
6 | data entered through the node pane will be converted to HCL and downloaded by the browser. Please note that currently
7 | the HCL spacing is not properly formatted. The user can run `terraform fmt` to reformat the spacing of the file. The
8 | exported configuration will also contain all variables, outputs, and locals defined through the app.
9 |
10 | ## Import
11 | Terraforge supports existing Terraform projects by importing a single `.tf` file and generating the graph representing
12 | those resources. This is still an experimental feature. There are several known limitations to the capability including:
13 | no meta-argument support, poor interpolation interpretation, no module support, lack of functions, or dynamic blocks.
14 | Many of these features are forthcoming and in development and described in detail in the [roadmap](roadmap.md).
--------------------------------------------------------------------------------
/docs/images/create_edge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/badarsebard/terraforge/560a6897c40df98182785359b011f58fb1e8ade8/docs/images/create_edge.png
--------------------------------------------------------------------------------
/docs/images/create_edge.xcf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/badarsebard/terraforge/560a6897c40df98182785359b011f58fb1e8ade8/docs/images/create_edge.xcf
--------------------------------------------------------------------------------
/docs/images/create_resource.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/badarsebard/terraforge/560a6897c40df98182785359b011f58fb1e8ade8/docs/images/create_resource.png
--------------------------------------------------------------------------------
/docs/images/create_resource.xcf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/badarsebard/terraforge/560a6897c40df98182785359b011f58fb1e8ade8/docs/images/create_resource.xcf
--------------------------------------------------------------------------------
/docs/images/edit_resource.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/badarsebard/terraforge/560a6897c40df98182785359b011f58fb1e8ade8/docs/images/edit_resource.png
--------------------------------------------------------------------------------
/docs/images/edit_resource.xcf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/badarsebard/terraforge/560a6897c40df98182785359b011f58fb1e8ade8/docs/images/edit_resource.xcf
--------------------------------------------------------------------------------
/docs/images/export_hcl.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/badarsebard/terraforge/560a6897c40df98182785359b011f58fb1e8ade8/docs/images/export_hcl.png
--------------------------------------------------------------------------------
/docs/images/export_hcl.xcf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/badarsebard/terraforge/560a6897c40df98182785359b011f58fb1e8ade8/docs/images/export_hcl.xcf
--------------------------------------------------------------------------------
/docs/images/graph_example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/badarsebard/terraforge/560a6897c40df98182785359b011f58fb1e8ade8/docs/images/graph_example.png
--------------------------------------------------------------------------------
/docs/images/graph_example.xcf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/badarsebard/terraforge/560a6897c40df98182785359b011f58fb1e8ade8/docs/images/graph_example.xcf
--------------------------------------------------------------------------------
/docs/images/provider_selection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/badarsebard/terraforge/560a6897c40df98182785359b011f58fb1e8ade8/docs/images/provider_selection.png
--------------------------------------------------------------------------------
/docs/images/provider_selection.xcf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/badarsebard/terraforge/560a6897c40df98182785359b011f58fb1e8ade8/docs/images/provider_selection.xcf
--------------------------------------------------------------------------------
/docs/images/providers_modal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/badarsebard/terraforge/560a6897c40df98182785359b011f58fb1e8ade8/docs/images/providers_modal.png
--------------------------------------------------------------------------------
/docs/images/providers_modal.xcf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/badarsebard/terraforge/560a6897c40df98182785359b011f58fb1e8ade8/docs/images/providers_modal.xcf
--------------------------------------------------------------------------------
/docs/providers.md:
--------------------------------------------------------------------------------
1 | # Providers
2 | Terraforge relies on the same schema used by Terraform when executing the provider plugins. In effect, this schema
3 | provides all the options for resources and data sources available for creation. Terraforge has two ways to provide the
4 | schema: the wizard and direct upload.
5 |
6 | ## Wizard
7 | The providers wizard is a modal that allows the user to select the providers they'd like to use and automatically
8 | generate the needed schema for the app. Providers come it in three tiers: official, partner, and community. The official
9 | providers are written and maintained by Hashicorp. Partner providers are owned and maintained by third-party
10 | technology partners. Providers in this tier indicate HashiCorp has verified the authenticity of the Provider’s
11 | publisher, and that the partner is a member of the
12 | [HashiCorp Technology Partner Program](https://www.hashicorp.com/ecosystem/become-a-partner/). Community providers are
13 | published to the Terraform Registry by individual maintainers, groups of maintainers, or other members of the Terraform
14 | community.
15 |
16 | The modal has controls at the top that allow the user to filter the available provider options by their tier and name.
17 | Select the desired providers by marking the checkboxes and clicking the submit button at the bottom of the modal.
18 |
19 | ## Direct Upload
20 | The wizard provides a quick user-friendly way to start working in Terraforge, but it lacks the ability to target
21 | specific versions of different providers. Additionally, it only has access to providers hosted on
22 | [registry.terraform.io](https://registry.terraform.io). In order to use custom providers or specific versions of a
23 | provider the user should generate the schema and upload it to Terraforge.
24 |
25 | ### Creating the Schema
26 | Create Terraform file `main.tf` file which contains the required providers. Ensure all providers
27 | that are needed in Terraforge are listed together.
28 | ```terraform
29 | terraform {
30 | required_providers {
31 | aws = {
32 | source = "hashicorp/aws"
33 | version = "3.63.0"
34 | }
35 | kubernetes = {
36 | source = "hashicorp/kubernetes"
37 | version = "2.6.1"
38 | }
39 | }
40 | }
41 | ```
42 |
43 | Once the Terraform configuration is in place the schema can be generated using the command:
44 | ```bash
45 | terraform providers schema -json > providers.json
46 | ```
47 |
48 | This schema is then uploaded to Terraforge using the `Upload manually` button in the `Providers` menu.
--------------------------------------------------------------------------------
/docs/roadmap.md:
--------------------------------------------------------------------------------
1 | # Roadmap
2 | Below is a list of features of Terraform that are currently unsupported and _may_ be implemented in the future.
3 |
4 | - ~~Configure providers~~
5 | - ~~Configure the `terraform` block~~
6 | - ~~Declare and set variables~~
7 | - ~~Declare and set outputs~~
8 | - ~~Declare and set locals~~
9 | - Support of dynamic blocks
10 | - Support interpolation in strings
11 | - Support comments
12 | - Update graph based on the results of evaluating expressions and functions
13 | - Support meta-arguments:
14 | - depends_on
15 | - count
16 | - for_each
17 | - lifecycle
18 | - provider
19 | - Support modules and module expansion
20 | - Support outputs from child modules
21 | - Support provisioners
22 | - Multi-file (archive) import
23 | - Executing terraform commands like fmt, validate, and plan
24 |
25 | ## Improvement Ideas
26 | - ~~HCL import sets provider configuration based on the provider blocks present~~
27 | - Support provider aliases
28 | - Support parsing expressions and functions during import
29 | - Improve type support of strings, lists, maps, etc
30 | - Handle quoted vs unquoted HCL strings (`resource` vs `"resource_name"`)
31 | - Create a `raw edit` mode that allows the user to directly modify the stanza
32 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "terraforge",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "build": "rollup -c",
7 | "dev": "rollup -c -w",
8 | "start": "sirv public --no-clear --host"
9 | },
10 | "devDependencies": {
11 | "@rollup/plugin-commonjs": "^17.0.0",
12 | "@rollup/plugin-node-resolve": "^11.0.0",
13 | "autoprefixer": "^10.4.0",
14 | "bulma": "^0.9.3",
15 | "bulmaswatch": "^0.8.1",
16 | "node-sass": "^6.0.1",
17 | "postcss": "^8.3.11",
18 | "rollup": "^2.3.4",
19 | "rollup-plugin-css-only": "^3.1.0",
20 | "rollup-plugin-livereload": "^2.0.0",
21 | "rollup-plugin-svelte": "^7.0.0",
22 | "rollup-plugin-terser": "^7.0.0",
23 | "svelte": "^3.0.0",
24 | "svelte-preprocess": "^4.9.8"
25 | },
26 | "dependencies": {
27 | "cytoscape": "^3.20.0",
28 | "cytoscape-klay": "^3.1.4",
29 | "cytoscape-panzoom": "^2.5.3",
30 | "sirv-cli": "^1.0.0"
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/public/LICENSE:
--------------------------------------------------------------------------------
1 | This Source Code Form is subject to the terms of the Mozilla Public
2 | License, v. 2.0. If a copy of the MPL was not distributed with this
3 | file, You can obtain one at https://mozilla.org/MPL/2.0/.
--------------------------------------------------------------------------------
/public/fulllogo_transparent_nobuffer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/badarsebard/terraforge/560a6897c40df98182785359b011f58fb1e8ade8/public/fulllogo_transparent_nobuffer.png
--------------------------------------------------------------------------------
/public/icononly_transparent_nobuffer.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/badarsebard/terraforge/560a6897c40df98182785359b011f58fb1e8ade8/public/icononly_transparent_nobuffer.ico
--------------------------------------------------------------------------------
/public/icononly_transparent_nobuffer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/badarsebard/terraforge/560a6897c40df98182785359b011f58fb1e8ade8/public/icononly_transparent_nobuffer.png
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Terraforge
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/rollup.config.js:
--------------------------------------------------------------------------------
1 | import svelte from 'rollup-plugin-svelte';
2 | import commonjs from '@rollup/plugin-commonjs';
3 | import resolve from '@rollup/plugin-node-resolve';
4 | import livereload from 'rollup-plugin-livereload';
5 | import { terser } from 'rollup-plugin-terser';
6 | import css from 'rollup-plugin-css-only';
7 | import sveltePreprocess from "svelte-preprocess";
8 |
9 | const production = !process.env.ROLLUP_WATCH;
10 |
11 | function serve() {
12 | let server;
13 |
14 | function toExit() {
15 | if (server) server.kill(0);
16 | }
17 |
18 | return {
19 | writeBundle() {
20 | if (server) return;
21 | server = require('child_process').spawn('npm', ['run', 'start', '--', '--dev'], {
22 | stdio: ['ignore', 'inherit', 'inherit'],
23 | shell: true
24 | });
25 |
26 | process.on('SIGTERM', toExit);
27 | process.on('exit', toExit);
28 | }
29 | };
30 | }
31 |
32 | export default {
33 | input: 'src/main.js',
34 | output: {
35 | sourcemap: true,
36 | format: 'iife',
37 | name: 'app',
38 | file: 'public/build/bundle.js'
39 | },
40 | plugins: [
41 | svelte({
42 | preprocess: sveltePreprocess({
43 | sourceMap: !production,
44 | scss: {
45 | includePaths: [
46 | 'node_modules',
47 | 'src'
48 | ]
49 | },
50 | postcss: {
51 | plugins: [require('autoprefixer')()]
52 | }
53 | }),
54 | compilerOptions: {
55 | // enable run-time checks when not in production
56 | dev: !production
57 | }
58 | }),
59 | // we'll extract any component CSS out into
60 | // a separate file - better for performance
61 | css({ output: 'bundle.css' }),
62 |
63 | // If you have external dependencies installed from
64 | // npm, you'll most likely need these plugins. In
65 | // some cases you'll need additional configuration -
66 | // consult the documentation for details:
67 | // https://github.com/rollup/plugins/tree/master/packages/commonjs
68 | resolve({
69 | browser: true,
70 | dedupe: ['svelte']
71 | }),
72 | commonjs(),
73 |
74 | // In dev mode, call `npm run start` once
75 | // the bundle has been generated
76 | !production && serve(),
77 |
78 | // Watch the `public` directory and refresh the
79 | // browser on changes when not in production
80 | !production && livereload('public'),
81 |
82 | // If we're building for production (npm run build
83 | // instead of npm run dev), minify
84 | production && terser()
85 | ],
86 | watch: {
87 | clearScreen: false
88 | }
89 | };
90 |
--------------------------------------------------------------------------------
/scripts/setupTypeScript.js:
--------------------------------------------------------------------------------
1 | const fs = require("fs")
2 | const path = require("path")
3 | const { argv } = require("process")
4 |
5 | const projectRoot = argv[2] || path.join(__dirname, "..")
6 |
7 | // Add deps to pkg.json
8 | const packageJSON = JSON.parse(fs.readFileSync(path.join(projectRoot, "package.json"), "utf8"))
9 | packageJSON.devDependencies = Object.assign(packageJSON.devDependencies, {
10 | "svelte-check": "^2.0.0",
11 | "svelte-preprocess": "^4.0.0",
12 | "@rollup/plugin-typescript": "^8.0.0",
13 | "typescript": "^4.0.0",
14 | "tslib": "^2.0.0",
15 | "@tsconfig/svelte": "^2.0.0"
16 | })
17 |
18 | // Add script for checking
19 | packageJSON.scripts = Object.assign(packageJSON.scripts, {
20 | "check": "svelte-check --tsconfig ./tsconfig.json"
21 | })
22 |
23 | // Write the package JSON
24 | fs.writeFileSync(path.join(projectRoot, "package.json"), JSON.stringify(packageJSON, null, " "))
25 |
26 | // mv src/main.js to main.ts - note, we need to edit rollup.config.js for this too
27 | const beforeMainJSPath = path.join(projectRoot, "src", "main.js")
28 | const afterMainTSPath = path.join(projectRoot, "src", "main.ts")
29 | fs.renameSync(beforeMainJSPath, afterMainTSPath)
30 |
31 | // Switch the app.svelte file to use TS
32 | const appSveltePath = path.join(projectRoot, "src", "App.svelte")
33 | let appFile = fs.readFileSync(appSveltePath, "utf8")
34 | appFile = appFile.replace("
211 |
317 |
318 |
395 |
396 |