├── .gitignore ├── History.md ├── LICENSE ├── NodeJs ├── .env ├── Dockerfile ├── Dockerfile-data ├── install-docker.sh ├── lambda-creator │ ├── app │ │ ├── home │ │ │ └── index.js │ │ ├── index.js │ │ └── lambda │ │ │ ├── criador.js │ │ │ ├── dados.js │ │ │ ├── deletar.js │ │ │ ├── index.js │ │ │ └── lista.js │ ├── assets │ │ ├── css │ │ │ └── style.css │ │ ├── imgs │ │ │ ├── error.jpg │ │ │ └── success.png │ │ └── js │ │ │ └── app.min.js │ ├── creator.js │ ├── gulpfile.js │ ├── library │ │ ├── Creator │ │ │ └── Creator.js │ │ └── Database │ │ │ ├── Database.js │ │ │ └── config.js │ ├── models │ │ └── listServices.js │ ├── package.json │ ├── resources │ │ ├── assets │ │ │ ├── img │ │ │ │ ├── error.jpg │ │ │ │ └── success.png │ │ │ ├── js │ │ │ │ └── listaLambda.js │ │ │ └── sass │ │ │ │ └── style.scss │ │ ├── tasks │ │ │ ├── img │ │ │ │ └── gulpImg.js │ │ │ ├── js │ │ │ │ └── gulpJs.js │ │ │ ├── sass │ │ │ │ └── gulpSass.js │ │ │ └── tasks.js │ │ └── views │ │ │ ├── criador_lambda.ejs │ │ │ ├── index.ejs │ │ │ ├── lambda │ │ │ ├── error.ejs │ │ │ ├── lista.ejs │ │ │ └── success.ejs │ │ │ └── layout.ejs │ └── routes.js └── readme.md └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | NodeJs/lambda-creator/node_modules 3 | NodeJs/lambda-creator/yarn.lock -------------------------------------------------------------------------------- /History.md: -------------------------------------------------------------------------------- 1 | 0.0.1 / 2016-12-13 2 | ================== 3 | 4 | * Initial release -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2011 TJ Holowaychuk 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /NodeJs/.env: -------------------------------------------------------------------------------- 1 | # Configurações do lambda-creator 2 | APP_NAME=APP_LAMBDAS 3 | APP_PORT=3000 -------------------------------------------------------------------------------- /NodeJs/Dockerfile: -------------------------------------------------------------------------------- 1 | #Dockerfile Jenkins 2 | FROM jenkinsci/jenkins:2.0-beta-1 3 | 4 | # Configurações do Jenkins 5 | USER root 6 | RUN mkdir /var/log/jenkins 7 | RUN mkdir /var/cache/jenkins 8 | RUN chown -R jenkins:jenkins /var/log/jenkins 9 | RUN chown -R jenkins:jenkins /var/cache/jenkins 10 | USER jenkins 11 | ENV JAVA_OPTS="-Xmx8192m" -------------------------------------------------------------------------------- /NodeJs/Dockerfile-data: -------------------------------------------------------------------------------- 1 | #Dockerfile Jenkins Data 2 | FROM debian:jessie 3 | 4 | # Create the jenkins user 5 | RUN useradd -d "/var/jenkins_home" -u 1000 -m -s /bin/bash jenkins 6 | 7 | # Create the folders and volume mount points 8 | RUN mkdir -p /var/log/jenkins 9 | RUN chown -R jenkins:jenkins /var/log/jenkins 10 | VOLUME ["/var/log/jenkins", "/var/jenkins_home"] 11 | USER jenkins 12 | CMD ["echo", "Data container for Jenkins"] 13 | -------------------------------------------------------------------------------- /NodeJs/install-docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Output colors shell 4 | red=`tput setaf 1` 5 | green=`tput setaf 2` 6 | 7 | function installMachine(){ 8 | docker-machine create -d virtualbox --virtualbox-memory "2048" developer-microservices 9 | } 10 | 11 | function envMachine(){ 12 | docker-machine env developer-microservices 13 | eval $(docker-machine env developer-microservices) 14 | } 15 | 16 | function upJenkins(){ 17 | docker build -t jenkins-data -f Dockerfile-data . 18 | docker build -t jenkins2 . 19 | docker run --name=jenkins-data jenkins-data 20 | docker run -p 8080:8080 -p 50000:50000 --name=jenkins-master --volumes-from=jenkins-data -d jenkins2 21 | } 22 | 23 | echo -n "Você deseja instalar a docker machine (s/n)?" 24 | read answer 25 | if echo "$answer" | grep -iq "^s" ;then 26 | installMachine 27 | else 28 | continue; 29 | fi 30 | 31 | echo -n "Você deseja setar a machine ENV da máquina (s/n)?" 32 | read answer 33 | if echo "$answer" | grep -iq "^s" ;then 34 | envMachine 35 | else 36 | continue; 37 | fi 38 | 39 | echo -n "Você deseja subir o ambiente de deploy (s/n)?" 40 | read answer 41 | if echo "$answer" | grep -iq "^s" ;then 42 | upJenkins 43 | else 44 | exit; 45 | fi -------------------------------------------------------------------------------- /NodeJs/lambda-creator/app/home/index.js: -------------------------------------------------------------------------------- 1 | const Service = (req, res) => { 2 | res.locals = { 3 | title: 'Criador de Lambda' 4 | }; 5 | 6 | res.render('index'); 7 | }; 8 | 9 | module.exports = Service; 10 | -------------------------------------------------------------------------------- /NodeJs/lambda-creator/app/index.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | 4 | //GET 5 | router.get('/', require('./home/index')); 6 | router.get('/criar-lambda', require('./lambda/index')); 7 | router.get('/lista-lambdas', require('./lambda/lista')); 8 | router.get('/dados-lambdas', require('./lambda/dados')); 9 | 10 | //POST 11 | router.post('/criar-aws-lambda', require('./lambda/criador')); 12 | 13 | //DELETE 14 | router.delete('/deletar-lambda', require('./lambda/deletar')); 15 | 16 | module.exports = router; 17 | -------------------------------------------------------------------------------- /NodeJs/lambda-creator/app/lambda/criador.js: -------------------------------------------------------------------------------- 1 | const Creator = require('../../library/Creator/Creator'); 2 | 3 | const Service = (req, res) => { 4 | res.locals = { 5 | error: 'você tentou criar um lambda que já existe. Por favor, altere o nome e rode o criador novamente.', 6 | success: 'O seu Lambda foi criado com sucesso. Para verificar a estrutura, por favor, navegue até o caminho: ' 7 | }; 8 | let creatorObject = new Creator(req.body); 9 | let Services = require('./../../models/listServices'); 10 | let verifyCreator = creatorObject.createAWSLambda(Services); 11 | 12 | if(verifyCreator) { 13 | res.render('lambda/success'); 14 | } else { 15 | res.render('lambda/error'); 16 | } 17 | }; 18 | 19 | module.exports = Service; 20 | -------------------------------------------------------------------------------- /NodeJs/lambda-creator/app/lambda/dados.js: -------------------------------------------------------------------------------- 1 | const Service = function(req, res) { 2 | const Services = require('./../../models/listServices'); 3 | 4 | Services.findAll().then(services => { 5 | res.json(services); 6 | }); 7 | }; 8 | 9 | module.exports = Service; 10 | -------------------------------------------------------------------------------- /NodeJs/lambda-creator/app/lambda/deletar.js: -------------------------------------------------------------------------------- 1 | const Service = (req, res) => { 2 | const Services = require('./../../models/listServices'); 3 | const execute = require('shelljs'); 4 | 5 | const id = req.get('id'); 6 | const name = req.get('name'); 7 | 8 | Services.destroy({ 9 | where: { 10 | id 11 | } 12 | }).then( (rowDeleted) => { 13 | if(rowDeleted === 1){ 14 | execute.rm('-rf', `/development/projects/developer/developer-microservices/NodeJs/${name}`); 15 | 16 | res.json({status: 1, message: id}); 17 | } 18 | }, (err) => res.json({status: 0, message: err}); 19 | ); 20 | }; 21 | 22 | module.exports = Service; 23 | -------------------------------------------------------------------------------- /NodeJs/lambda-creator/app/lambda/index.js: -------------------------------------------------------------------------------- 1 | const Service = (req, res) => { 2 | res.locals = { 3 | title: 'Criador de Lambda' 4 | }; 5 | res.render('criador_lambda'); 6 | }; 7 | 8 | module.exports = Service; 9 | -------------------------------------------------------------------------------- /NodeJs/lambda-creator/app/lambda/lista.js: -------------------------------------------------------------------------------- 1 | const Service = (req, res) => { 2 | res.locals = { 3 | title: 'Lista de Lambdas' 4 | }; 5 | 6 | res.render('lambda/lista'); 7 | }; 8 | 9 | module.exports = Service; 10 | -------------------------------------------------------------------------------- /NodeJs/lambda-creator/assets/css/style.css: -------------------------------------------------------------------------------- 1 | main{margin-top:50px} 2 | -------------------------------------------------------------------------------- /NodeJs/lambda-creator/assets/imgs/error.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaeldouglas/lambda-microservices-creator/cc27dd928e9e0906baf2ac5514caf40655c2d838/NodeJs/lambda-creator/assets/imgs/error.jpg -------------------------------------------------------------------------------- /NodeJs/lambda-creator/assets/imgs/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaeldouglas/lambda-microservices-creator/cc27dd928e9e0906baf2ac5514caf40655c2d838/NodeJs/lambda-creator/assets/imgs/success.png -------------------------------------------------------------------------------- /NodeJs/lambda-creator/assets/js/app.min.js: -------------------------------------------------------------------------------- 1 | function excluirService(a,o){$("#AWSRemoveLambdaModal").modal({backdrop:"static",keyboard:!1}).one("click","#delete",function(c){$.ajax({url:"/deletar-lambda",type:"DELETE",headers:{id:a,name:o},success:function(a){1==a.status?(alert("Lambda removido com sucesso"),location.reload()):(alert("Ops.. ocorreu um erro ao remover o lambda"),location.reload())}})})}function runLambda(a,o){"runLocal"==a?($("#name_function").html(o),$("#AWSLambdaRunLocal").modal({backdrop:"static",keyboard:!1})):"runDeploy"==a?($("#name_function_deploy").html(o),$("#AWSLambdaDeploy").modal({backdrop:"static",keyboard:!1})):alert("OPS")}$(function(){$.get("/dados-lambdas",function(a){$.each(a,function(){$("#table > tbody").append(""+this.id+""+this.nm_service+""+this.createdAt+' Excluir  Rodar Lambda local   Deploy Lambda NaN')})})}); -------------------------------------------------------------------------------- /NodeJs/lambda-creator/creator.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | const express = require('express'); 3 | const http = require('http'); 4 | const app = express(); 5 | const expressLayouts = require('express-ejs-layouts'); 6 | const bodyParser = require('body-parser'); 7 | 8 | // middlewares 9 | app.set('view engine', 'ejs'); 10 | app.set('layout extractScripts', true); 11 | app.set('layout extractStyles', true); 12 | app.use(expressLayouts); 13 | app.set('views', __dirname + '/resources/views'); 14 | app.use(express.static(__dirname + '/resources/views')); 15 | app.use('/assets', express.static(__dirname + '/assets')); 16 | app.use('/modules', express.static(__dirname + '/node_modules')); 17 | app.use( bodyParser.json() ); 18 | app.use(bodyParser.urlencoded({ 19 | extended: true 20 | })); 21 | 22 | // Application Routes 23 | const routes = require('./routes'); 24 | 25 | routes.set(app); 26 | 27 | const PORT = ( typeof process.env.PORT == 'undefined' ? '3000' : process.env.PORT ); 28 | 29 | app.listen(PORT, () => { 30 | console.log(`http://localhost:${PORT}`); 31 | }); 32 | -------------------------------------------------------------------------------- /NodeJs/lambda-creator/gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var gulp = require('gulp'); 3 | var tasks = require('./resources/tasks/tasks'); 4 | 5 | // Tarefas variadas do nosso projeto 6 | gulp.task('sass', tasks.getTask('sass', 'Sass')); 7 | gulp.task('js', tasks.getTask('js', 'Js')); 8 | gulp.task('img', tasks.getTask('img', 'Img')); 9 | 10 | 11 | // Tarefa Watch 12 | gulp.task('watch', ['sass', 'js', 'img'], function () { 13 | gulp.watch(tasks.basePaths.sass, ['sass']); 14 | gulp.watch(tasks.basePaths.js, ['js']); 15 | gulp.watch(tasks.basePaths.img, ['img']); 16 | }); 17 | 18 | // Tarefa default 19 | gulp.task('default', ['sass', 'js', 'img'], function () {}); -------------------------------------------------------------------------------- /NodeJs/lambda-creator/library/Creator/Creator.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Michael Douglas Barbosa Araujo 3 | * @copyright Michael 4 | * @description Essa classe é responsável por criar o Json e a estrutura do Lambda 5 | * @module Creator 6 | * @type {Structure} 7 | */ 8 | 9 | 10 | class Creator{ 11 | constructor(request) 12 | { 13 | this.execute = require('shelljs'); 14 | 15 | // Internal objects 16 | this.request = request; 17 | 18 | this.parseJsonLambda = () => { 19 | return `module.exports = { 20 | region: '${this.request.region}', 21 | handler: '${this.request.handler}', 22 | role: '${this.request.role}', 23 | functionName: '${this.request.name}', 24 | timeout: ${this.request.timeout}, 25 | runtime: 'nodejs6.10', 26 | memorySize: 128 27 | }`; 28 | }; 29 | } 30 | 31 | createAWSLambda(Services) 32 | { 33 | if (this.execute.test('-d', `/development/projects/developer/developer-microservices/NodeJs/${this.request.name}`)) { 34 | return false; 35 | } else { 36 | return this.execCreateLambda(Services); 37 | } 38 | } 39 | 40 | execCreateLambda(Services) 41 | { 42 | if (!this.execute.which('git')) { 43 | this.execute.echo('Sorry, AWS Lambda Creator requires git'); 44 | this.execute.exit(1); 45 | } else { 46 | let file = this.parseJsonLambda(); 47 | console.log(file); 48 | this.execute.echo(`Start of creator of Lambda: ${this.request.name}`); 49 | this.execute.mkdir('-p', `/development/projects/developer/developer-microservices/NodeJs/${this.request.name}`); 50 | this.execute.cd(`/development/projects/developer/developer-microservices/NodeJs/${this.request.name}`); 51 | if (this.execute.exec('git clone AJUSTAR @TODO . ').code !== 0) { 52 | this.execute.echo('Error: Git clone Skeleton failed'); 53 | this.execute.exit(1); 54 | } else { 55 | this.execute.rm('-rf', 'lambda-config.js'); 56 | this.execute.exec(`echo "${file}" >> lambda-config.js`); 57 | this.execute.exec(`yarn`); 58 | if (this.execute.test('-d', `/development/projects/developer/developer-microservices/NodeJs/${this.request.name}`)) { 59 | 60 | // Salva o Lambda no Banco de dados 61 | Services.create({ nm_service: this.request.name }).then(result => console.log('Insert realizado com sucesso')).catch(() => console.log('error')); 62 | 63 | return true; 64 | } 65 | } 66 | } 67 | } 68 | } 69 | 70 | module.exports = Creator; -------------------------------------------------------------------------------- /NodeJs/lambda-creator/library/Database/Database.js: -------------------------------------------------------------------------------- 1 | const config = require('./config'); 2 | const Sequelize = require('sequelize'); 3 | 4 | const Database = new Sequelize(config.database, config.username, config.password, { 5 | dialect: 'mssql' 6 | , host: config.host 7 | , port: config.port 8 | , timeout: 30 9 | , }, { 10 | pool: { 11 | max: 5 12 | , min: 0 13 | , idle: 30000 14 | , } 15 | , }); 16 | 17 | 18 | module.exports = Database; -------------------------------------------------------------------------------- /NodeJs/lambda-creator/library/Database/config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | database: '', 3 | username: '', 4 | password: '', 5 | host: process.env.NODE_ENV ? '' : '' 6 | }; 7 | -------------------------------------------------------------------------------- /NodeJs/lambda-creator/models/listServices.js: -------------------------------------------------------------------------------- 1 | const sequelize = require('../library/Database/Database'); 2 | 3 | 4 | const Services = sequelize.define('services', { 5 | id: { 6 | type: sequelize.Sequelize.STRING, 7 | primaryKey: true, 8 | autoIncrement: true, 9 | }, 10 | nm_service: { 11 | type: sequelize.Sequelize.STRING, 12 | allowNull: false 13 | } 14 | }, { 15 | timestamps: true, 16 | paranoid: true 17 | }); 18 | 19 | module.exports = Services; 20 | -------------------------------------------------------------------------------- /NodeJs/lambda-creator/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "docker-web", 3 | "version": "0.0.1", 4 | "scripts": { 5 | "start": "node web.js" 6 | }, 7 | "dependencies": { 8 | "body-parser": "^1.17.2", 9 | "bootstrap": "^3.3.7", 10 | "browser-terminal": "^0.0.2", 11 | "ejs": "^2.5.6", 12 | "express": "^4.14.0", 13 | "express-ejs-layouts": "^2.2.0", 14 | "jquery": "^3.2.1", 15 | "jquery-easy-loading": "^1.2.0", 16 | "sequelize": "^3.30.4", 17 | "shelljs": "^0.7.7", 18 | "tedious": "^2.0.0" 19 | }, 20 | "devDependencies": { 21 | "gulp": "^3.9.1", 22 | "gulp-concat": "https://registry.npmjs.org/gulp-concat/-/gulp-concat-2.6.0.tgz", 23 | "gulp-imagemin": "^3.0.3", 24 | "gulp-load-plugins": "^1.3.0", 25 | "gulp-pngquant": "^1.0.10", 26 | "gulp-sass": "^2.3.2", 27 | "gulp-sourcemaps": "https://registry.npmjs.org/gulp-sourcemaps/-/gulp-sourcemaps-1.6.0.tgz", 28 | "gulp-uglify": "https://registry.npmjs.org/gulp-uglify/-/gulp-uglify-1.5.4.tgz", 29 | "gulp-util": "^3.0.7", 30 | "gulp-watch": "^4.3.8" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /NodeJs/lambda-creator/resources/assets/img/error.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaeldouglas/lambda-microservices-creator/cc27dd928e9e0906baf2ac5514caf40655c2d838/NodeJs/lambda-creator/resources/assets/img/error.jpg -------------------------------------------------------------------------------- /NodeJs/lambda-creator/resources/assets/img/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaeldouglas/lambda-microservices-creator/cc27dd928e9e0906baf2ac5514caf40655c2d838/NodeJs/lambda-creator/resources/assets/img/success.png -------------------------------------------------------------------------------- /NodeJs/lambda-creator/resources/assets/js/listaLambda.js: -------------------------------------------------------------------------------- 1 | function excluirService(id, name) { 2 | $('#AWSRemoveLambdaModal').modal({ 3 | backdrop: 'static' 4 | , keyboard: false 5 | }).one('click', '#delete', function (e) { 6 | $.ajax({ 7 | url: '/deletar-lambda' 8 | , type: 'DELETE' 9 | , headers: { 10 | "id": id, "name": name 11 | } 12 | , success: function (result) { 13 | if (result.status == 1) { 14 | alert('Lambda removido com sucesso'); 15 | location.reload(); 16 | } 17 | else { 18 | alert('Ops.. ocorreu um erro ao remover o lambda'); 19 | location.reload(); 20 | } 21 | } 22 | }); 23 | }); 24 | } 25 | 26 | function runLambda(type, name_function) 27 | { 28 | if(type == 'runLocal') { 29 | $("#name_function").html(name_function) 30 | $('#AWSLambdaRunLocal').modal({ 31 | backdrop: 'static' 32 | , keyboard: false 33 | }); 34 | } else if(type == 'runDeploy') { 35 | $("#name_function_deploy").html(name_function) 36 | $('#AWSLambdaDeploy').modal({ 37 | backdrop: 'static' 38 | , keyboard: false 39 | }); 40 | } else { 41 | alert('OPS'); 42 | } 43 | } 44 | 45 | $(function () { 46 | $.get("/dados-lambdas", function (data) { 47 | $.each(data, function () { 48 | $('#table > tbody').append('' + '' + this.id + '' + '' + this.nm_service + '' + '' + this.createdAt + '' 49 | + ' Excluir  ' 50 | + 'Rodar Lambda local  ' 51 | + ' Deploy Lambda ' + 52 | + ''); 53 | }); 54 | }); 55 | }); -------------------------------------------------------------------------------- /NodeJs/lambda-creator/resources/assets/sass/style.scss: -------------------------------------------------------------------------------- 1 | main { 2 | margin-top: 50px; 3 | } -------------------------------------------------------------------------------- /NodeJs/lambda-creator/resources/tasks/img/gulpImg.js: -------------------------------------------------------------------------------- 1 | //Carrega as tarefas de imagem 2 | module.exports = function (gulp, plugins) { 3 | return function () { 4 | gulp.src('./resources/assets/img/*') 5 | .pipe(plugins.imagemin({ 6 | progressive: true, 7 | svgoPlugins: [{removeViewBonx: false}], 8 | use: [plugins.pngquant()] 9 | })) 10 | .pipe(gulp.dest('./assets/imgs')); 11 | }; 12 | }; -------------------------------------------------------------------------------- /NodeJs/lambda-creator/resources/tasks/js/gulpJs.js: -------------------------------------------------------------------------------- 1 | //Carrega as tarefas 2 | module.exports = function (gulp, plugins) { 3 | return function () { 4 | gulp.src('./resources/assets/js/**/*.js') 5 | .pipe(plugins.concat('app.min.js')) 6 | .pipe(plugins.uglify()) 7 | .pipe(plugins.sourcemaps.write()) 8 | .pipe(gulp.dest('./assets/js')); 9 | }; 10 | }; -------------------------------------------------------------------------------- /NodeJs/lambda-creator/resources/tasks/sass/gulpSass.js: -------------------------------------------------------------------------------- 1 | //Carrega as tarefas 2 | module.exports = function (gulp, plugins) { 3 | return function () { 4 | gulp.src('./resources/assets/sass/**/*.{sass,scss}') 5 | .pipe(plugins.sass({outputStyle: 'compressed'}).on('error', plugins.sass.logError)) 6 | .pipe(gulp.dest('./assets/css')); 7 | }; 8 | }; -------------------------------------------------------------------------------- /NodeJs/lambda-creator/resources/tasks/tasks.js: -------------------------------------------------------------------------------- 1 | var Tasks = { 2 | gulp: require('gulp'), 3 | plugins: require('gulp-load-plugins')(), 4 | basePaths: { 5 | sass: './resources/assets/**/*.{sass,scss}', 6 | js: './resources/assets/**/*.js', 7 | img: './resources/assets/*' 8 | }, 9 | getTask: function (path, task) 10 | { 11 | return require(`./${path}/gulp${task}.js`)(this.gulp, this.plugins); 12 | } 13 | }; 14 | 15 | module.exports = Tasks; -------------------------------------------------------------------------------- /NodeJs/lambda-creator/resources/views/criador_lambda.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |
5 |
6 |

Criação do Lambda

7 |
8 |
9 |
10 |
11 |
12 | 13 | 14 |

Para que exista um padrão de nomenclatura, por favor, mantenha o nome da sua função com a inicial: lambda-

15 |
16 |
17 | 18 | 32 |

Nossos serviços atualmente estão em: US East (N. Virginia). A não ser que seja extremamente necessário trocar, por favor, mantenha o padrão.

33 |
34 |
35 | 36 | 37 |
38 |
39 | 40 | 41 |
42 |
43 | 44 | 45 |
46 | 47 |
48 |
49 |
50 | 51 |
52 |
53 | 54 | 55 | -------------------------------------------------------------------------------- /NodeJs/lambda-creator/resources/views/index.ejs: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |

Documentação

5 |
6 |
7 |

Criação do Lambda

8 |
    9 |
  • 10 | Caso queira ver os lambdas criados, por favor, clique aqui. 11 |
  • 12 |
  • 13 | Caso queira saber como ficará o Lambda. Acesse o Skelleton: Clicando aqui. 14 |
  • 15 |
  • 16 | Para criar um novo Lambda você deverá preencher o formulário: Criar Lambda 17 |
  • 18 |
  • 19 | Após criar o Lambda lembre-se de: Instalar os pacotes que serão utilizados e criar o deploy no Container de deploy. 20 |
  • 21 |
  • 22 | Qualquer dúvida é só perguntar: michaeldouglas010790@gmail.com 23 |
  • 24 |
  • 25 | 31 |
  • 32 |
      33 |
34 |
35 |
36 | 37 | -------------------------------------------------------------------------------- /NodeJs/lambda-creator/resources/views/lambda/error.ejs: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 | 6 |
7 | Lambda Creator 8 |
9 |
-------------------------------------------------------------------------------- /NodeJs/lambda-creator/resources/views/lambda/lista.ejs: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
# Nome do lambda Data de criação Ações
15 |
16 | 17 | 34 | 35 | 53 | 54 | 72 |
73 | 74 | -------------------------------------------------------------------------------- /NodeJs/lambda-creator/resources/views/lambda/success.ejs: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 | 6 |
7 | developer 8 |
9 |
-------------------------------------------------------------------------------- /NodeJs/lambda-creator/resources/views/layout.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Lambda Creator Microservices - <%= _locals.title %> 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 25 | <%- style %> 26 | 27 | 28 | 29 |
30 | 57 |
58 | 59 |
60 |
61 |
62 | 63 |
64 |
65 |

Gerador AWS Lambda

66 |
67 | <%- body %> 68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |

Lembre-se de compartilhar o projeto. :)

76 |
77 | 78 |
79 | 80 | 81 | 82 | 83 | 84 | <%- script %> 85 | 86 | -------------------------------------------------------------------------------- /NodeJs/lambda-creator/routes.js: -------------------------------------------------------------------------------- 1 | module.exports.set = function(app) { 2 | app.use('/', require('./app')); 3 | }; -------------------------------------------------------------------------------- /NodeJs/readme.md: -------------------------------------------------------------------------------- 1 | ## Gerar novo Lambda 2 | 3 | `Atenção:` Esse comando só deverá ser executado caso você queira gerar um novo lambda. 4 | 5 | O gerador de Lambda roda a partir do Yarn. Sendo assim será necessário instalar o Yarn no seu computador. Sigua a documentação: [https://yarnpkg.com/pt-BR/docs/install!](https://yarnpkg.com/pt-BR/docs/install). 6 | 7 | ## License 8 | 9 | MIT -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Lambda Microservices Creator - 0.0.1 2 | 3 | [![Latest Unstable Version](https://poser.pugx.org/leaphly/cart-bundle/v/unstable.svg)](//github.com/michaeldouglas/lambda-microservices-creator) 4 | [![License](https://poser.pugx.org/leaphly/cart-bundle/license.svg)](https://github.com/michaeldouglas/lambda-microservices-creator/blob/master/LICENSE) 5 | 6 | `Atenção:` O projeto ainda encontra-se na versão `beta` caso seja encontrado 7 | erros, por favor, deixe uma `issue` explicando detalhadamente o erro encontrado. 8 | 9 | O Lambda Microservices Creator é reponsável por cuidar da estrutura de Microservices dos seus lambdas AWS e além disso é capaz de 10 | reaalizar testes locais dos seu Lambdas e deploy do Lambda para a AWS. 11 | 12 | ![Lambda Microservices Creator](https://s3-sa-east-1.amazonaws.com/lambda-microservices-creator/LogoTransparente.png) 13 | 14 | ## Máquina para utilização do Lambda Creator 15 | 16 | Para utilizar o Lambda Creator você deve possuir a máquina responsável pela 17 | infraestrutura do projeto. Realize então o clone do Lambda Microservices Infraestrutura: 18 | 19 | - [https://github.com/michaeldouglas/lambda-microservices-infrastructure](https://github.com/michaeldouglas/lambda-microservices-infrastructure) 20 | 21 | E deve possuir o modelo de lambda: 22 | 23 | - [https://github.com/michaeldouglas/lambda-microservices-skeleton](https://github.com/michaeldouglas/lambda-microservices-skeleton) 24 | 25 | 26 | ## Compatibilidade 27 | 28 | Nodejs >= 6.x 29 | yarn 0.24.x 30 | 31 | 32 | ## Instalação 33 | 34 | Entre na pasta `Nodejs/lambda-creator` e então execute: 35 | 36 | ``` 37 | yarn 38 | ``` 39 | 40 | Esse comando instala as dependência do Lambda Microservices Creator. 41 | 42 | Agora você deve instalar os seguintes pacotes de forma global: 43 | 44 | ``` 45 | yarn global add lambda-local 46 | yarn global add gulp 47 | ``` --------------------------------------------------------------------------------