Skip to content
Merged
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
28 changes: 27 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ var/
# Serverless directories
.serverless


.requirements-cache
node_modules
output/*
Expand All @@ -30,3 +29,30 @@ graph.png

/.venv
/.idea

# Terraform
.terraform
.terragrunt-cache
*.tfstate*
.terraform.lock.hcl
crash.log

# OS X
.history
.DS_Store

# IntelliJ
.idea_modules
*.iml
*.iws
*.ipr
.idea/
build/
*/build/
out/

# Lambda builds by Terraform AWS Lambda module
builds/

# Vim
*.sw[op]
22 changes: 15 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
repos:
- repo: git://github.com/doublify/pre-commit-isort
- repo: https://github.com/doublify/pre-commit-isort
rev: v4.3.0
hooks:
- id: isort
- repo: git://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: check-ast
- id: check-merge-conflict
- id: requirements-txt-fixer
- id: end-of-file-fixer
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
#- repo: git://github.com/codespell-project/codespell
# rev: v1.16.0
# hooks:
# - id: codespell
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.50.0
hooks:
- id: terraform_fmt
- id: terraform_docs
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: check-merge-conflict
19 changes: 19 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"configurations": [
{
"name": "Python: src/handler.py",
"type": "python",
"request": "launch",
"program": "src/handler.py",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}"
},
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}
]
}
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"python.pythonPath": "/Users/Bob/.local/share/virtualenvs/modules.tf-diagrams/bin/python",
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.formatting.provider": "autopep8"
}
50 changes: 0 additions & 50 deletions DEVELOPMENT.md

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2018 Anton Babenko
Copyright (c) 2018-2021 Anton Babenko

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:

Expand Down
30 changes: 20 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
# modules.tf - Infrastructure as code generator - from visual diagrams to Terraform
# Diagrams to code (d2c) - Infrastructure as code generator - from visual diagrams to Terraform

[![Financial Contributors on Open Collective](https://opencollective.com/modulestf/all/badge.svg?label=financial+contributors)](https://opencollective.com/modulestf) [![MIT license](https://img.shields.io/github/license/antonbabenko/modules.tf-lambda.svg)]() [![@antonbabenko](https://img.shields.io/twitter/follow/antonbabenko.svg?style=flat&label=Follow%20@antonbabenko%20on%20Twitter)](https://twitter.com/antonbabenko)


<a href="https://github.com/antonbabenko/modules.tf-lambda"><img src="https://raw.githubusercontent.com/antonbabenko/modules.tf-lambda/master/misc/modulestf-logo.png" alt="modules.tf - Infrastructure as code generator - from visual diagrams to Terraform" width="210" height="70" align="right" /></a>

Code in this repository is used for generating infrastructure as Terraform configurations from visual diagrams created using [Cloudcraft](https://www.cloudcraft.co).

[modules.tf](https://github.com/antonbabenko/modules.tf-lambda) is an open-source project by [Anton Babenko](https://github.com/antonbabenko).


## How can I try this?

Expand Down Expand Up @@ -37,8 +34,6 @@ In [modules.tf-demo](https://github.com/antonbabenko/modules.tf-demo) repository

This project was partially sponsored by [Cloudcraft - the best way to draw AWS diagrams](https://www.cloudcraft.co).<br clear="all">

Monitoring of serverless applications provided by [Thundra](https://www.thundra.io/).

[Become a sponsor to @antonbabenko on GitHub](https://github.com/sponsors/antonbabenko/).

[![@antonbabenko](https://img.shields.io/twitter/follow/antonbabenko.svg?style=flat&label=Follow%20@antonbabenko%20on%20Twitter)](https://twitter.com/antonbabenko)
Expand All @@ -48,11 +43,26 @@ Monitoring of serverless applications provided by [Thundra](https://www.thundra.

## Developer's guide

This project is Python 3.7 application written using [Serverless framework](https://serverless.com) which runs on [AWS Lambda](https://aws.amazon.com/lambda/).
This project is Python 3.8 serverless application written using [serverless.tf](https://serverless.tf) framework and open-source components ([Terraform AWS modules](https://github.com/terraform-aws-modules)).

### Notes for developers

Terraform is used to provision infrastructure resources as well as packaging artifacts and to do the deployments (check out [serverless.tf](https://serverless.tf) for more details).

Source code is located in `src/handler.py`.

Go to directory `terraform`, verify/update file `terraform.tfvars` and run:

```
$ terraform init # Download required Terraform providers and modules
$ terraform apply # Create or update infrastructure resources or do a new deployment of Lambda function (if source code has changed)
```

Read [official quick start guide](https://serverless.com/framework/docs/providers/aws/guide/quick-start/) and [installation instructions](https://serverless.com/framework/docs/providers/aws/guide/installation/) to familiarise yourself with it.
When infrastructure is created, you should be able to `POST` using [httpie](https://github.com/jakubroztocil/httpie/) or `curl` like this:

Read [DEVELOPMENT.md](https://github.com/antonbabenko/modules.tf-lambda/blob/master/DEVELOPMENT.md) for more insights if you want to contribute to this project.
```
$ http --print Hhb --all --follow https://dev-d2c.modules.tf @test_fixtures/input/blueprint_my.json
```


## Contributors
Expand Down Expand Up @@ -89,4 +99,4 @@ Support this project with your organization. Your logo will show up here with a

This work is licensed under MIT License. See LICENSE for full details.

Copyright (c) 2019 Anton Babenko
Copyright (c) 2018-2021 Anton Babenko
3 changes: 0 additions & 3 deletions bin/test_lambda_local.sh

This file was deleted.

Loading