This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import AWS = require('aws-sdk'); | |
var axios = require('axios'); | |
import { readFileSync } from 'fs' | |
import * as request from 'request' | |
import { readFile } from 'fs' | |
import { promisify } from 'util'; | |
const S3_BUCKET = `your-s3-bucket`; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import boto3 | |
import json | |
import boto3 | |
def hello(event, context): | |
# TODO implement |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
verifySignature(slackSignature, slackTimestamp, body) { | |
const slackSigningSecret = process.env.SLACK_SIGNING_SECRET; | |
console.log('slackTimestamp: ', slackTimestamp); | |
console.log('slackSignature: ', slackSignature); | |
const timestamp = slackTimestamp; | |
const time = Math.floor(new Date().getTime()/1000); | |
if (Math.abs(time - timestamp) > 300) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import boto3 | |
import json | |
import decimal | |
from datetime import datetime | |
from boto3.dynamodb.conditions import Key, Attr | |
from botocore.exceptions import ClientError | |
ses = boto3.client( | |
'ses', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var aws4 = require('aws4'); | |
var signature = aws4.sign({ | |
host: '', | |
method: 'GET', | |
path: '/development/hello', | |
headers: { | |
'x-apigw-api-id': '' | |
}, | |
region: 'ap-southeast-2', | |
service: 'execute-api' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws s3api put-object --bucket first-stack-mys3bucket --key car.jpg --body ~/Downloads/car.jpg --tagging 'clientId=123' --profile test-cfn-user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const app = express(); | |
const request = require('request'); | |
app.get('/download-file', function (req, res) { | |
// sdk way | |
var s3 = new AWS.S3({}); | |
var options = { | |
Bucket: 'my-bucket-name', | |
Key: file, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AWSTemplateFormatVersion" : "2010-09-09", | |
"Description" : "Attach IAM Role to an EC2", | |
"Parameters" : { | |
"KeyName" : { | |
"Description" : "EC2 Instance SSH Key", | |
"Type" : "AWS::EC2::KeyPair::KeyName" | |
}, | |
"InstanceType" : { | |
"Description" : "EC2 instance specs configuration", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"e_id":6969,"base64":"/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAQDAwMDAgQDAwMEBAQFBgoGBgUFBgwICQcKDgwPDg4MDQ0PERYTDxAVEQ0NExoTFRcYGRkZDxIbHRsYHRYYGRj/2wBDAQQEBAYFBgsGBgsYEA0QGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBj/wAARCAXcB9ADASIAAhEBAxEB/8QAHQAAAQUBAQEBAAAAAAAAAAAAAgABAwQFBgcICf/EAGQQAAEDAwIDBQQGBggBCAUBGQIBAwQABRESIQYTMQciQVFhFDJCcRUjUoGRoQgzYnKxwRYkQ1OCkqLR4RclNGNzssLwRFSDk9LxGCY1RYSU4glVZHSzwzaVo9PyJ2V1xEaGlv/EABwBAAMBAQEBAQEAAAAAAAAAAAABAgMEBQYHCP/EAEURAAICAQMCAwUGBgECBgEBCQABAhEDEiExBEEFE1EUImFxkQYygaGx0RVCUsHh8CMz8RZDU2KSonKCJAc0wuIXg7LS/9oADAMBAAIRAxEAPwD2PFFin0+lEiV9zZ+Zg6fSlp9KPFLFIANPpT4qTFLFA6BxSxRYp9PpSsKAxSxR6fSlp9KLAbFLFPp9KNAoKSsjxSxUihSQKLE4sjxSx3qm0j5UOgaLGosjxSxUmgqWgaLDSyPR86HQVWNHzpYpahuBDilo7tTYpYosNKIML9miQKlxSxTsWhAcsaHR3qm0+lNiptj0kWCpsVNiliqsNJDilipcaqfSPlRYnEhwVLQpVNpGkiUWLT6kWCpaFqSnxS1D0IiVKbFTKlCofZp6glHuRolPgqNA+1RIlJsFFkWCpYKptPpQrnUI0JlONEdKpNCfDQ471OzNqgaVHoKhxSHQ1DR4p6AI6VFp9KWn0pgBimo8UsUxUBSp8UsUCA0+lKipsUANTL1o6EqYAYoV6UdNimAFKjxSxTAjVKHFSL0ocUyHFAU2K |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2021-01-22T18:38:32.761Z","extensionVersion":"v3.4.3"} |