Skip to content
/ GAwS Public

A script for calling the AWS API from Google Apps Script.

Notifications You must be signed in to change notification settings

abetomo/GAwS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GAwS

A fork of aws-apps-scripts. A script for calling the AWS API from Google Apps Script.

How to use:

  1. Create a new project in google scripts.
  2. Copy paste aws.js into it's own file in your project and save it.
  3. Open up a new a file and setup the AWS variable with AWS.init.
  4. Use method for each service.

Example:

EC2

function myFunction() {
  AWS.init('MY_ACCESS_KEY', 'MY_SECRET_KEY');
  console.log(AWS.ec2(
    'us-east-1', // region
    'DescribeInstances', // action
    {"Version":"2015-10-01"} // params
  ));
}

S3

put object

function myFunction() {
  AWS.init('MY_ACCESS_KEY', 'MY_SECRET_KEY');
  console.log(AWS.s3(
    'us-west-2', // region
    'bucket', // bucket
    'key', // key
    'PUT', // method
    '{"key":"value"}' // payload
  ));
}

get object

function myFunction() {
  AWS.init('MY_ACCESS_KEY', 'MY_SECRET_KEY');
  res = AWS.s3(
    'us-west-2', // region
    'bucket', // bucket
    'key', // key
    'GET' // method
  );
  console.log(res.getContentText());
}

Lambda

Sync

function myFunction() {
  AWS.init('MY_ACCESS_KEY', 'MY_SECRET_KEY');
  console.log(AWS.lambdaInvoke(
    'us-west-2', // region
    'functionName', // functionName
    '{"key":"value"}' // payload
  ));
}

Async

function myFunction() {
  AWS.init('MY_ACCESS_KEY', 'MY_SECRET_KEY');
  console.log(AWS.lambdaInvokeAsync(
    'us-west-2', // region
    'functionName', // functionName
    '{"key":"value"}' // payload
  ));
}

About

A script for calling the AWS API from Google Apps Script.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published