Skip to content

Instantly share code, notes, and snippets.

View 0xhmn's full-sized avatar

Hooman Yar 0xhmn

View GitHub Profile
@helephant
helephant / !calling-lambda-cross-account.md
Last active October 24, 2023 03:52
Calling a lambda in another AWS account by assuming a cross-account IAM role

Set up a cross-account IAM role in the destination account

  • Add a new IAM role
  • For type of trusted entity select "another AWS account"
  • Specify the accountId of the account that will be using the resource in the destination account. You can find your AWS Account ID, which is available on the support homepage when you are logged in.
  • Create a policy that allows lambda:InvokeFunction for your function and attach it to this new role.

Create a lambda in the calling account.

  • Set up a role for your lambda that is allowed to assumeRole
  • Use the AWS SDK to assume the new role in the destination account.
  • Pass the credentials to the lambda object when you create it
@asimmittal
asimmittal / scrapeUsingJQuery.js
Created October 4, 2017 16:01
JqueryScraper
console.log("---> Running");
const curl = require("curl");
const jsdom = require("jsdom");
const url = "http://www.imdb.com/list/ls004489992/";
curl.get(url, null, (err,resp,body)=>{
if(resp.statusCode == 200){
parseData(body);
}
@joyrexus
joyrexus / README.md
Last active February 24, 2024 15:16
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")