in source serverless.yaml file add. This account no is 111100001111
resources:
Resources:
LambdaResourcePolicy:
Type: AWS::Lambda::Permission
async getUrlInfo(url: string) { | |
const reg = new RegExp("https?://([a-z0-9]+[.])*.?ea[.]com"); | |
const reg2 = new RegExp("^(?:http(s)?:\\/\\/)?[\\w.-]+(?:\\.[\\w\\.-]+)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+$"); | |
async function reachability() { | |
const responseReachable: any = await fetch(url, {method: 'HEAD'}).catch(() => false); | |
return responseReachable.status === 200; | |
} | |
return { |
// The Async/Await section spreads some misinformation and bad practices. It explains that try/catch must be used whenever an await expression is used, but that is not the case. For example, this snippet: | |
function getGithubUser(username) { | |
return new Promise((resolve, reject) => { | |
fetch(`https://api.github.com/users/${username}`) | |
.then(response => { | |
const user = response.json(); | |
resolve(user); | |
}) | |
.catch(err => reject(err)); |
// if you see anywhere in js file that fetch is not defined. | |
// then use following to fix | |
global.fetch = require('node-fetch') |
/* eslint-env jest */ | |
'use strict' | |
const { read, keys } = require('../sreda') | |
const AWS = require('aws-sdk') | |
let ssm = new AWS.SSM() | |
var ssmPromise = { | |
promise: jest.fn().mockImplementation((request) => { | |
return new Promise((resolve, reject) => { |
map.forEach((k, v) -> System.out.println(k + "=" + v)); | |
for (Map.Entry<?, ?> entry : m.entrySet()) { | |
System.out.println(entry.getKey() + " = " + entry.getValue()); | |
} | |
Iterator it = m.entrySet().iterator(); | |
while (it.hasNext()) { | |
Map.Entry pairs = (Map.Entry)it.next(); | |
System.out.println(pairs.getKey() + " = " + pairs.getValue()); |
node: Platform built on V8 to build network applications | |
git: Distributed revision control system | |
wget: Internet file retriever | |
yarn: JavaScript package manager | |
python3: Interpreted, interactive, object-oriented programming language | |
coreutils: GNU File, Shell, and Text utilities | |
awscli: Official Amazon AWS command-line interface | |
automake: Tool for generating GNU Standards-compliant Makefiles | |
youtube-dl: Download YouTube videos from the command-line | |
readline: Library for command-line editing |