Skip to content

Commit

Permalink
Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
antonbabenko committed Nov 5, 2019
1 parent 1a691da commit 40b1c95
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 75 deletions.
44 changes: 44 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Notes for developers

As a short cheatsheet, you will need to use these commands:

* Invoke real endpoint in `dev` and `prod` environments using [httpie](https://github.com/jakubroztocil/httpie/):

```
# dev
$ http --print Hhb --all --follow https://dev-lambda.modules.tf/ @input/blueprint_my.json
# prod
$ http --print Hhb --all --follow https://lambda.modules.tf/ @input/blueprint_my.json
```

* Invoke function locally providing `input.json`:

```
$ serverless invoke local --function generate-cloudcraft --path test_fixtures/input_localfile.json
```

* Deploy all functions to `prod` environment:

```
$ serverless deploy --stage prod
```

* Deploy single function to `dev` environment:

```
$ serverless deploy function --function generate-cloudcraft --stage dev
```

* Deploy single function to `prod` environment:

```
$ serverless deploy function --function generate-cloudcraft --stage prod
```

## Spellchecker

```
$ brew install codespell
$ pre-commit try-repo git://github.com/codespell-project/codespell codespell --all-files
```
3 changes: 3 additions & 0 deletions KNOWN_ISSUES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Known issues in modules.tf-lambda

* Serverless framework version shouldn't be newer than 1.51.0 unless [this](https://github.com/serverless/serverless/issues/6752) and [this](https://github.com/UnitedIncome/serverless-python-requirements/issues/414) bugs are fixed
96 changes: 22 additions & 74 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,105 +1,53 @@
# modules.tf - 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)]() [![Gitter](https://img.shields.io/gitter/room/modulestf/Lobby.svg)](https://gitter.im/modulestf/Lobby)
[![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>

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

Code in this repository has been already deployed to [AWS Lambda](https://aws.amazon.com/lambda/) and available for all [Cloudcraft](https://cloudcraft.co/app) users for free (forever):
* Draw your AWS architecture on [Cloudcraft](https://cloudcraft.co/app)
* Click "Export" and "Export as code (modules.tf)" at the top right side
* Download archive and unzip it
* Follow the instructions in `README.md` file to get resources created on your AWS account.
[modules.tf](https://github.com/antonbabenko/modules.tf-lambda) is an open-source project by [Anton Babenko](https://github.com/antonbabenko).

## Supporters

<a href="https://cloudcraft.co/" target="_blank"><img src="https://raw.githubusercontent.com/antonbabenko/modules.tf-lambda/master/misc/cloudcraft-logo.png" alt="Cloudcraft - the best way to draw AWS diagrams" width="211" height="56" align="right" /></a>

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

Monitoring of serverless applications provided by [Dashbird.io](https://dashbird.io/). <a href="https://dashbird.io/" target="_blank"><img src="https://raw.githubusercontent.com/antonbabenko/modules.tf-lambda/master/misc/dashbird-logo.png" alt="Dashbird - Monitor serverless applications" width="200" height="68" align="right" /></a><br clear="all">

## I am developer - show me the code & let's ship it!

Ok, if you are a developer and want to contribute, this is really great because [I](https://github.com/antonbabenko) need your help:

- Report, triage and fix bugs
- Refactor code
- Improve documentation
- Implement new sources and workflows (now only [Cloudcraft](https://cloudcraft.co/app) is partially supported)
- Consider contributing to [Terraform AWS modules](https://github.com/terraform-aws-modules) if you familiar with Terraform already

### Developer's guide

[AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html) supports Python 3.6, so you should use it also. Run this to install all required packages:

```
$ pip install -r requirements.txt
```
## How can I try this?

[Serverless framework](https://serverless.com) is used to do heavy-lifting by packaging dependencies required for AWS Lambda function (`requirements-lambda.txt`) and updating the code there. Read through [Quick Start guide](https://serverless.com/framework/docs/providers/aws/guide/quick-start/), as well as [installation](https://serverless.com/framework/docs/providers/aws/guide/installation/), [various AWS functions](https://serverless.com/framework/docs/providers/aws/guide/functions/), [serverless.yml reference](https://serverless.com/framework/docs/providers/aws/guide/serverless.yml/) to familiarise yourself with the usage of the framework.
1. Sign up for free account to [Cloudcraft.co](https://cloudcraft.co/app).
1. Draw AWS architecture in web-browser (you can import live AWS resources, too).
1. Click "Export" and "Terraform code export" at the top right side.
1. Download archive and extract it locally.
1. Follow step-by-step instructions in `README.md` which you can find inside of it.

As a short cheatsheet, you will need to use these commands:

* Invoke real endpoint in `dev` and `prod` environments using [httpie](https://github.com/jakubroztocil/httpie/):

```
# dev
$ http --print Hhb --all --follow https://dev-lambda.modules.tf/ @input/blueprint_my.json
# prod
$ http --print Hhb --all --follow https://lambda.modules.tf/ @input/blueprint_my.json
```

* Invoke function locally providing `input.json`:

```
$ serverless invoke local --function generate-cloudcraft --path test_fixtures/input_localfile.json
```

* Deploy all functions to `prod` environment:

```
$ serverless deploy --stage prod
```

* Deploy single function to `dev` environment:
## Supporters

```
$ serverless deploy function --function generate-cloudcraft --stage dev
```
<a href="https://cloudcraft.co/" target="_blank"><img src="https://raw.githubusercontent.com/antonbabenko/modules.tf-lambda/master/misc/cloudcraft-logo.png" alt="Cloudcraft - the best way to draw AWS diagrams" width="211" height="56" align="right" /></a>

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

```
$ serverless deploy function --function generate-cloudcraft --stage prod
```
Monitoring of serverless applications provided by [Dashbird.io](https://dashbird.io/). <a href="https://dashbird.io/" target="_blank"><img src="https://raw.githubusercontent.com/antonbabenko/modules.tf-lambda/master/misc/dashbird-logo.png" alt="Dashbird - Monitor serverless applications" width="200" height="68" align="right" /></a><br clear="all">

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

* Serverless framework version shouldn't be newer than 1.51.0 unless [this](https://github.com/serverless/serverless/issues/6752) and [this](https://github.com/UnitedIncome/serverless-python-requirements/issues/414) bugs are fixed
[![@antonbabenko](https://img.shields.io/twitter/follow/antonbabenko.svg?style=flat&label=Follow%20@antonbabenko%20on%20Twitter)](https://twitter.com/antonbabenko)
[![@antonbabenko](https://img.shields.io/github/followers/antonbabenko?style=flat&label=Follow%20@antonbabenko%20on%20Github)](https://github.com/antonbabenko)
[![modules.tf-lambda](https://img.shields.io/github/stars/antonbabenko/modules.tf-lambda?style=flat&label=Star%20modules.tf-lambda%20on%20Github)](https://github.com/antonbabenko/modules.tf-lambda)

## Spellchecker

```
$ brew install codespell
$ pre-commit try-repo git://github.com/codespell-project/codespell codespell --all-files
```
## Developer's guide

## Authors
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 created and maintained by [Anton Babenko](https://github.com/antonbabenko) with the help from [different contributors](https://github.com/antonbabenko/modules.tf-lambda/graphs/contributors).
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.

[![@antonbabenko](https://img.shields.io/twitter/follow/antonbabenko.svg?style=social&label=Follow%20@antonbabenko%20on%20Twitter)](https://twitter.com/antonbabenko)
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.


## Contributors

### Code Contributors

This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
This project exists thanks to all the people who contribute.
<a href="https://github.com/antonbabenko/modules.tf-lambda/graphs/contributors"><img src="https://opencollective.com/modulestf/contributors.svg?width=890&button=false" /></a>

### Financial Contributors
Expand Down
2 changes: 1 addition & 1 deletion serverless.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
service: modules-tf

#frameworkVersion: ">=1.26.0 <2.0.0"
frameworkVersion: "1.51.0"
frameworkVersion: "1.51.0" # see KNOWN_ISSUES.md

provider:
name: aws
Expand Down

0 comments on commit 40b1c95

Please sign in to comment.