Skip to content

Instantly share code, notes, and snippets.

View leny's full-sized avatar
🧐
Think less. Stupid more.

Pierre-Antoine Delnatte leny

🧐
Think less. Stupid more.
View GitHub Profile
@leny
leny / README.md
Created May 6, 2021 21:07 — forked from magnetikonline/README.md
CloudFormation API Gateway endpoint calling a Lambda function using proxy integration example.

CloudFormation API Gateway integration to Lambda function

Template that will create the following:

  • API Gateway:
    • Deployed as a REGIONAL endpoint.
    • Single root method, accepting POST requests only, with Lambda proxy integration to a target function.
  • In-line Python Lambda function echoing back requesting users IP address to API Gateway requests:
    • IAM role for Lambda allowing CloudWatch logs access.
    • Permissions for Lambda that allow API Gateway endpoint to successfully invoke function.
{
"Resources": {
"IAMLambdaServiceRole": {
"Type": "AWS::IAM::Role",
"Properties": {
"RoleName": "LambdaServiceRole",
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
@leny
leny / exo.js
Last active December 7, 2018 21:14
random exo
//console.log(TABLE_DATA)
function init(){
const tableau = document.getElementsByTagName('tbody')[0];
const sortBtn = document.getElementById('sort');
sortBtn.setAttribute('type', 'submit');
const stopRandomBtn = document.getElementById('stop');
stopRandomBtn.setAttribute('type', 'submit');
const startRandomBtn = document.getElementById('start');
startRandomBtn.setAttribute('type', 'submit');