aws

module:aws

Description:
  • AWS API interface, uses API directly for each service, JSON is returned as is but XML repsonses are converted using fast-xml-parser into objects.

Source:

Methods

(static) aws.cwGetMetricData()

Description:
  • Return collected metric statistics

    Options:

    • start_time - starting timestamp
    • end_time - ending timestamp
    • period - aggregation period in seconds, default is 60, if < 0 then dunamically set it for the time range
    • age - number of ms to go back in case start_time is not specified, fraction can be used, default is 30 secs if no timestamp are given
    • namespace - namespace for all metrics, default is AWS/EC2
    • desc - return data in descending order
    • metrics - a list with metrics to retrieve: { name: "..", stat: "..", dimensions: { key: val, ...}, [namespace: ".."], [label: "..""], [hidden: 1], [expression: ".."] }

    Returns an object: { data: [{ id, label, timestamps: [], data: [] }], errors: [] }

    Example:

    aws.cwGetMetricData({ age: 300000, metrics: [{ name: "NetworkOut", label: "Traffic", stat: "Average", dimensions: { InstanceId: "i-1234567" } } ] }, lib.log)
    
Source:

(static) aws.cwListMetrics()

Description:
  • Return metrics for the given query, the options can be specified:

    • name - a metric name
    • namespace - limit by namespace: AWS/AutoScaling, AWS Billing, AWS/CloudFront, AWS/DynamoDB, AWS/ElastiCache, AWS/EBS, AWS/EC2, AWS/ELB, AWS/ElasticMapReduce, AWS/Kinesis, AWS/OpsWorks, AWS/Redshift, AWS/RDS, AWS/Route53, AWS/SNS, AWS/SQS, AWS/SWF, AWS/StorageGateway
Source:

(static) aws.cwPutLogEvents()

Description:
  • Store events in the Cloudwatch Logs. Options:

    • name - log group name, required
    • stream - log stream name, required
    • events - a list of strings, or objects { timestamp, message }, required
    • tm_pos - position in the message where the timestamp starts, default is 0
    • tm_sep - separator after the timestamp, default is space
Source:

(static) aws.cwPutMetricAlarm()

Description:
  • Creates or updates an alarm and associates it with the specified Amazon CloudWatch metric. The options specify the following:

    • name - alarm name, if not specified metric name and dimensions will be used to generate alarm name
    • metric - metric name, default is CPUUtilization
    • namespace - AWS namespace, default is AWS/EC2
    • op - comparison operator, one of => | <= | > | < | GreaterThanOrEqualToThreshold | GreaterThanThreshold | LessThanThreshold | LessThanOrEqualToThreshold. Default is >=.
    • statistic - one of SampleCount | Average | Sum | Minimum | Maximum, default is Average
    • period - collection period in seconds, default is 60
    • evaluationPeriods - the number of periods over which data is compared to the specified threshold, default is 15
    • threshold - the value against which the specified statistic is compared, default is 90
    • ok - ARN(s) to be notified on OK state
    • alarm - ARN(s) to be notified on ALARM state
    • insufficient_data - ARN(s) to be notified on INSUFFICIENT_DATA state
    • dimensions - the dimensions for the alarm's associated metric.
Source:

(static) aws.cwPutMetricData()

Description:
  • Publishes metric data points to Amazon CloudWatch. The argumernts specify the following:

    • namespace - custome namespace, cannot start with AWS
    • data - an object with metric data: { metricName: value }, ... { metricName: { value: Number, dimension1: name1, .. }, }, ... { metricName: { value: [min, max, sum, sample], dimension1: ... }, }, ...

    The options can specify the following:

    • storageResolution - 1 to use 1 second resolution
    • timestamp - ms to be used as the timestamp instead of the current time
Source:

(static) aws.cwlFilterLogEvents()

Description:
  • Lists log events from the specified log group. You can list all the log events or filter the results using a filter pattern, a time range, and the name of the log stream. Options:

    • name - a group name, required
    • count - how many events to retrieve in one batch, 10000
    • limit - total number of events to return
    • filter - filter pattern
    • stime - start time in ms
    • etime - end time in ms
    • prefix - log stream prefix pattern
    • names - list of log streams to filter
    • token - a previous token to start with
    • timeout - how long to keep reading or waiting, ms
Source:

(static) aws.ddbBatchGetItem()

Description:
  • Retrieve all items for given list of keys

    • items is an object with table name as property name and list of options for GetItem request
    • options may contain any valid native property if it starts with capital letter.
Source:
Example
{ users: { keys: [{ id: 1, name: "john" },{ id: .., name: .. }], select: ['name','id'], consistent: true }, ... }

(static) aws.ddbBatchWriteItem()

Description:
  • Update items from the list at the same time

    • items is a list of objects with table name as property and list of operations, an operation can be PutRequest or DeleteRequest
    • options may contain any valid native property if it starts with capital letter.
Source:
Example
{ table: [ { put: { id: 1, name: "tt" } }, { del: { id: 2 } }] }

(static) aws.ddbCreateTable()

Description:
  • Create a table

    • attrs can be an array in native DDB JSON format or an object with name:type properties, type is one of S, N, NN, NS, BS
    • options may contain any valid native property if it starts with capital letter and the following:
      • waitTimeout - number of milliseconds to wait for ACTIVE status
      • waitDelay - how often to pool for table status, default is 250ms
      • keys is an array of column ids used for the primary key or a string with the hash key. if omitted, the first attribute will be used for the primary key
      • local - an object with each property for a local secondary index name defining key format the same way as for primary keys, all Uppercase properties are added to the top index object
      • global - an object for global secondary indexes, same format as for local indexes
      • projections - an object with index name and list of projected properties to be included in the index or "ALL" for all properties, if omitted then default KEYS_ONLY is assumed
      • readCapacity - read capacity units for provisioned throughput
      • writeCapacity - write capacity units
      • onDemand - billing mode, auto provision capacity and pay per request, if no read/write capacity is configured on-demand is the default
      • stream - enable stream support
Source:
Example
ddbCreateTable('users', { id: 'S', mtime: 'N', name: 'S'},
                                 { keys: ["id", "name"],
                                   local: { mtime: { mtime: "HASH" } },
                                   global: { name: { name: 'HASH', ProvisionedThroughput: { ReadCapacityUnits: 50 } } },
                                   projections: { mtime: ['gender','age'],
                                                  name: ['name','gender'] },
                                   stream: "NEW_IMAGE",
                                   readCapacity: 10,
                                   writeCapacity: 10 });

(static) aws.ddbDeleteItem()

Description:
  • Delete an item from a table

    • keys is an object with name: value for hash/range attributes
    • options may contain any valid native property if it starts with capital letter and the following special options:
      • expr - condition expression
      • values - an object with values map to be used for in the update and/or condition expressions, to be used for ExpressionAttributeValues parameters
      • names - an object with a map to be used for attribute names in condition and update expressions, to be used for ExpressionAttributeNames parameter
      • returning - values to be returned on success, any value means ALL_OLD
Source:
Example
ddbDeleteItem("users", { id: 1, name: "john" }, {})

(static) aws.ddbDeleteTable()

Description:
  • Remove a table from the database. By default the callback will ba callled only after the table is deleted, specifying options.nowait will return immediately

Source:

(static) aws.ddbDescribeTable()

Description:
  • Return table definition and parameters in the result structure with property of the given table name

Source:
Example
{ name: { AttributeDefinitions: [], KeySchema: [] ...} }

(static) aws.ddbDescribeTimeToLive()

Description:
  • Returns status of Time to live attribute for a table

Source:

(static) aws.ddbGetItem()

Description:
  • Retrieve one item by primary key

    • keys - an object with primary key attributes name and value.
    • select - list of columns to return, otherwise all columns will be returned
    • options may contain any native property allowed in the request or special properties:
      • consistent - set consistency level for the request
      • names - an object with a map to be used for attribute names in condition and update expressions, to be used for ExpressionAttributeNames parameter
Source:
Example
ddbGetItem("users", { id: 1, name: "john" }, { select: 'id,name' })

(static) aws.ddbListTables()

Description:
  • Return list of tables in .TableNames property of the result

Source:

(static) aws.ddbPutItem()

Description:
  • Put or add an item

    • item is an object, type will be inferred from the native js type.
    • options may contain any valid native property if it starts with capital letter or special properties:
      • query - an object with column names to be used in ConditionExpression clause and value as null to set condition to { Exists: false } or any other exact value to be checked against which corresponds to { Exists: true, Value: value }
      • expr - condition expression
      • values - an object with values map to be used for in the update and/or condition expressions, to be used for ExpressionAttributeValues parameters
      • names - an object with a map to be used for attribute names in condition and update expressions, to be used for ExpressionAttributeNames parameter
      • returning - values to be returned on success, any value means ALL_OLD
Source:
Example
ddbPutItem("users", { id: 1, name: "john", mtime: 11233434 }, { query: { name: null } })

(static) aws.ddbQueryTable()

Description:
  • Query on a table, return all matching items

    • condition is an object with name: value pairs, by default EQ opeartor is used for comparison
    • options may contain any valid native property if it starts with capital letter or special property:
      • start - defines starting primary key when paginating, can be a string/number for hash or an object with hash/range properties
      • consistent - set consistency level for the request
      • select - list of attributes to get only
      • total - return number of matching records
      • count - limit number of record in result
      • desc - descending order
      • sort - index name to use, indexes are named the same as the corresponding column, with index primary keys for Keycondition will be used
      • ops - an object with operators to be used for properties if other than EQ.
      • keys - list of primary key columns, if there are other properties in the condition then they will be put into QueryFilter instead of KeyConditions. If keys are absent, all properties in the condition are treated as primary keys.
      • projection - projection expression
      • values - an object with values map to be used for in the update and/or condition expressions, to be used for ExpressionAttributeValues parameters
      • names - an object with a map to be used for attribute names in condition and update expressions, to be used for ExpressionAttributeNames parameter
      • expr - filtering expression
Source:
Example
aws.ddbQueryTable("users", { id: 1, name: "john" }, { select: 'id,name', ops: { name: 'gt' } })
aws.ddbQueryTable("users", { id: 1, name: "john", status: "ok" }, { keys: ["id"], select: 'id,name', ops: { name: 'gt' } })
aws.ddbQueryTable("users", { id: 1 }, { expr: "status=:s", values: { s: "status" } })

(static) aws.ddbScanTable()

Description:
  • Scan a table for all matching items

    • condition is an object with name: value pairs or a string with FilterExpression
    • options may contain any valid native property if it starts with capital letter or special property:
      • start - defines starting primary key
      • ops - an object with operators to be used for properties if other than EQ.
      • projection - projection expression
      • values - an object with values map to be used for in the update and/or condition expressions, to be used for ExpressionAttributeValues parameters
      • names - an object with a map to be used for attribute names in condition and update expressions, to be used for ExpressionAttributeNames parameter
Source:
Example
aws.ddbScanTable("users", { id: 1, name: 'a' }, { ops: { name: 'gt' }})
         aws.ddbScanTable("users", "id=:id AND name=:name", { values: { id: 1, name: 'a' } });

(static) aws.ddbTransactWriteItems()

Description:
  • Update items from the list at the same time in one transaction, on any failure everything is rolled back

    • items is a list of operations to be performed in the same format as for aws.ddbPutItem, aws.ddbUpdateItem, aws.ddbDeleteItem and aws.ddbQueryItem
    • options may contain any valid native property if it starts with capital letter.
Source:
Example
{ op: "put": table: "table-name", query: { id: 1, name: "tt" } },
         { op: "del": table: "table-name", query: { id: 2 } },
         { op: "update": table: "table-name", query: { id: 1, name: "test" }, options: { query: { status: "ok" } } },
         { op: "check": table: "table-name", query: { id: 1 }, options: { query: { status: "ok" } } }

(static) aws.ddbUpdateItem()

Description:
  • Update an item

    • keys is an object with primary key attributes name and value.
    • item is an object with properties where value can be:
      • number/string/array - action PUT, replace or add new value
      • null/empty string - action DELETE
    • item can be a string with Update expression
    • options may contain any valid native property if it starts with capital letter or special properties:
      • expr - condition expression
      • values - an object with values map to be used for in the update and/or condition expressions, to be used for ExpressionAttributeValues parameters
      • names - an object with a map to be used for attribute names in condition and update expressions, to be used for ExpressionAttributeNames parameter
      • ops - an object with operators to be used for properties, one of the: set, remove, unset, delete, incr, add, append, prepend, not_exists
      • query - an object with columns to be used in ConditionExpression, value null means the attribute does not exists, any other value to be checked against using regular compare rules. The conditional comparison operator is taken from options.ops the same way as for queries.
      • returning - values to be returned on success, * or new means ALL_NEW, old means ALL_OLD, updated means UPDATED_NEW, old_updated means UPDATED_OLD
Source:
Example
ddbUpdateItem("users", { id: 1, name: "john" }, { gender: 'male', icons: '1.png' }, { action: { icons: 'add' }, query: { id: 1 }, returning: "*" })
ddbUpdateItem("users", { id: 1, name: "john" }, { gender: 'male', icons: '1.png' }, { action: { icons: 'incr' }, query: { id: null } })
ddbUpdateItem("users", { id: 1, name: "john" }, { gender: 'male', icons: '1.png', num: 1 }, { action: { num: 'add', icons: 'add' }, query: { id: null, num: 0 }, ops: { num: "gt" } })

(static) aws.ddbUpdateTable()

Description:
  • Update tables provisioned throughput settings, options is used instead of table name so this call can be used directly in the cron jobs to adjust provisionined throughput on demand. Options must provide the following properties:

    • name - table name
    • readCapacity and writeCapacity - new povisioned throughtput settings, both must be specified
    • stream - null to disable or one of the NEW_IMAGE | OLD_IMAGE | NEW_AND_OLD_IMAGES | KEYS_ONLY
    • add - an object with indexes to create
    • del - delete a global secondary index by name, a string or a list with multiple indexes
    • update - an object with indexes to update
    • waitTimeout - how long to wait in ms until the table is active again
    • onDemand - true to switch to pat per request mode, false to switch to provisioning mode
Source:
Examples
aws.ddbUpdateTable({ name: "users", add: { name_id: { name: "S", id: 'N', readCapacity: 20, writeCapacity: 20, projections: ["mtime","email"] } })
aws.ddbUpdateTable({ name: "users", add: { name: { name: "S", readCapacity: 20, writeCapacity: 20, projections: ["mtime","email"] } })
aws.ddbUpdateTable({ name: "users", del: "name" })
aws.ddbUpdateTable({ name: "users", update: { name: { readCapacity: 10, writeCapacity: 10 } })
of crontab job in etc/crontab:

[
  { "cron": "0 0 1 * * *", "job": { "aws.ddbUpdateTable": { "name": "bk_user", "readCapacity": 1000, "writeCapacity": 1000 } } },
  { "cron": "0 0 6 * * *", "job": { "aws.ddbUpdateTable": { "name": "bk_user", "readCapacity": 2000, "writeCapacity": 2000 } } }
]

(static) aws.ddbUpdateTimeToLive()

Description:
  • Update TTL attribute. The options properties:

    • name - table name
    • attribute - the attribute name
    • enabled - true or false
Source:

(static) aws.ddbWaitForTable()

Description:
  • Call the callback after specified period of time or when table status become different from the given waiting status. if options.waitTimeout is not specified calls the callback immediately. options.waitStatus is checked if given and keeps waiting while the status is equal to it. options.waitDelay can be specified how often to request new status, default is 250ms.

Source:

(static) aws.ec2AssociateAddress()

Description:
  • Associate an Elastic IP with an instance. Default behaviour is to reassociate if the EIP is taken. The options can specify the following:

    • subnetId - required for instances in VPC, allocation id will be retrieved for the given ip address automatically
Source:

(static) aws.ec2AttachNetworkInterface()

Description:
  • Attach given ENIs in eniId to the instance, each ENI can be specified as 'eni:idx' where idx is interface index

Source:

(static) aws.ec2CreateImage()

Description:
  • Create an EBS image from the instance given or the current instance running

Source:

(static) aws.ec2CreateTags()

Description:
  • Create tags for a resource. The name is a string, an array or an object with tags. The options also may contain tags property which is an object with tag key and value

    Example

     aws.ec2CreateTags("i-1234","My Instance", { tags: { tag2 : "val2", tag3: "val3" } } )
     aws.ec2CreateTags("i-1234", { tag2: "val2", tag3: "val3" })
     aws.ec2CreateTags("i-1234", [ "tag2", "val2", "tag3", "val3" ])
    
Source:

(static) aws.ec2DeregisterImage()

Description:
  • Deregister an AMI by id. If options.snapshots is set, then delete all snapshots for this image as well

Source:

(static) aws.ec2DescribeInstances()

Description:
  • Describe instances according to the query filters, returns a list with instances, the following properties can be used:

    • vpcId - VPC to get instances from
    • instanceId - list of instances to show only
    • tagName - filter by tag name(s)
    • tagKey - filter by tag key(s)
    • groupName - filter by group name(s)
    • stateName - instances state(s)
    • filters - an object with filters to send as is
Source:

(static) aws.ec2DescribeSubnets()

Description:
  • Describe VPC subnets, optionally if options.filter regexp is provided then limit the result to the matched subnets only, return list of subnets to the callback

Source:

(static) aws.ec2RunInstances()

Description:
  • Run AWS instances, supports all native EC2 parameters with first capital letter but also accepts simple parameters in the options:

    • min - min number of instances to run, default 1
    • max - max number of instances to run, default 1
    • imageId - AMI id, use aws.imageId if not given or options.ImageId attribute
    • instanceType - instance type, use aws.instanceType if not given or options.InstanceType attribute
    • keyName - Keypair, use aws.keyName if not given or options.KeyName attribute
    • data - user data, in clear text
    • terminate - set instance initiated shutdown behaviour to terminate
    • stop - set instance initiated shutdown behaviour to stop
    • groupId - one group id or an array with security group ids
    • ip - a static private IP adress to assign
    • publicIp - associate with a public IP address
    • file - pass contents of a file as user data, contents are read using sync method
    • noPrepare - even with additional tasks specified do not wai but return the context for aws.ec2PrepareInstance
    • waitTimeout - how long to wait in ms for instance to be runnable
    • waitDelay - now often in ms to poll for status while waiting
    • waitRunning - if 1 then wait for instance to be in running state, this is implied also by targetGroup, name, elasticIp properties in the options
    • name - assign a tag to the instance as Name:, any occurences of %i will be replaced with the instance index
    • tags - additional tags to be assigned, an object with key:value
    • targetGroup - join ELB target groups after the startup
    • elasticIp - asociate with the given Elastic IP address after the start
    • iamProfile - IAM profile to assign for instance credentials, if not given use aws.iamProfile or options['IamInstanceProfile.Name'] attribute
    • availabilityZone - availability zone, if not given use aws.zone or options['Placement.AvailabilityZone'] attribute
    • subnetId - subnet id, if not given use aws.subnetId or options.SubnetId attribute
    • alarms - a list with CloudWatch alarms to create for the instance, each value of the object represent an object with options to be passed to the cwPutMetricAlarm method.
    • device - an object for BlockDeviceMapping specification: { name, size, type, iosp, keep, virtual }
    • metadata - list of metadata options: disabled, hops, tokens, tags
    • launchTemplate - launch template name to use, latest version, all other options are ignored

    The callback will take 3 arguments: callback(err, rc, info) where info will contain properties that can be used by `aws.ec2PrepareInstance

Source:

(static) aws.ec2WaitForInstance()

Description:
  • Check an instance status and keep waiting until it is equal what we expect or timeout occurred. The status can be one of: pending | running | shutting-down | terminated | stopping | stopped The options can specify the following:

    • waitTimeout - how long to wait in ms until give up, default is 30 secs
    • waitDelay - how long in ms between polls
Source:

(static) aws.elb2DeregisterInstances()

Description:
  • Deregister an instance(s) from ELB, instance can be one id or a list of ids

Source:

(static) aws.elb2RegisterInstances()

Description:
  • Register an instance(s) with ELB, instance can be one id or a list of ids or IP addresses

Source:

(static) aws.fromDynamoDB()

Description:
  • Convert a DynamoDB object into Javascript object

Source:

(static) aws.getTagValue()

Description:
  • Returns a tag value by key, default key is Name

Source:

(static) aws.queryACM()

Description:
  • AWS ACM API request

Source:

(static) aws.queryAS()

Description:
  • AWS Autoscaling API request

Source:

(static) aws.queryCFN()

Description:
  • AWS CFN API request

Source:

(static) aws.queryCW()

Description:
  • AWS CloudWatch API request

Source:

(static) aws.queryCWL()

Description:
  • AWS CloudWatch Log API request

Source:

(static) aws.queryComprehend()

Description:
  • AWS Comprehend API request

Source:

(static) aws.queryDDB()

Description:
  • DynamoDB requests

Source:

(static) aws.queryEC2()

Description:
  • AWS EC2 API request

Source:

(static) aws.queryECR()

Description:
  • AWS ECR API request

Source:

(static) aws.queryELB2()

Source:

(static) aws.queryElastiCache()

Description:
  • AWS Elastic Cache API request

Source:

(static) aws.queryEvents()

Description:
  • AWS EventBridge API request

Source:

(static) aws.queryIAM()

Description:
  • AWS AIM API request

Source:

(static) aws.queryRekognition()

Description:
  • Make a request to the Rekognition service

Source:

(static) aws.queryS3()

Description:
  • S3 requests Options may contain the following properties:

    • method - HTTP method
    • query - query parameters for the url as an object
    • postdata - any data to be sent with POST
    • postfile - file to be uploaded to S3 bucket
    • expires - absolute time when this request is expires
    • headers - HTTP headers to be sent with request
    • file - file name where to save downloaded contents
Source:

(static) aws.querySNS()

Description:
  • AWS SNS API request

Source:

(static) aws.querySSM()

Description:
  • AWS SSM API request

Source:

(static) aws.querySTS()

Description:
  • AWS STS API request

Source:

(static) aws.queryTranscribe()

Description:
  • AWS Transcribe API request

Source:

(static) aws.s3CopyFile()

Description:
  • Copy existing S3 file, source must be in the format bucket/path

Source:

(static) aws.s3GetFile()

Description:
  • Retrieve a file from S3 bucket, root of the path is a bucket, path can have a protocol prepended like s3://, it will be ignored

Source:

(static) aws.s3List()

Description:
  • Retrieve a list of files from S3 bucket, only files inside the path will be returned

Source:

(static) aws.s3ParseUrl()

Description:
  • Parse an S3 URL and return an object with bucket and path

Source:

(static) aws.s3Proxy()

Description:
  • Proxy a file from S3 bucket into the existing HTTP response res

Source:

(static) aws.s3PutFile()

Description:
  • Upload a file to S3 bucket, file can be a Buffer or a file name

Source:

(static) aws.signS3()

Description:
  • Sign S3 AWS request, returns url to be send to S3 server, options will have all updated headers to be sent as well

Source:

(static) aws.snsConfirmSubscription()

Description:
  • Verifies an endpoint owner's intent to receive messages by validating the token sent to the endpoint by an earlier Subscribe action. If the token is valid, the action creates a new subscription and returns its Amazon Resource Name (ARN) in the callback.

Source:

(static) aws.snsCreatePlatformEndpoint()

Description:
  • Creates an endpoint for a device and mobile app on one of the supported push notification services, such as GCM and APNS.

    The following properties can be specified in the options:

    • appArn - an application ARN to be used for push notifications, if not passed, global -sns-app-arn will be used.
    • data - a user data to be associated with the endpoint arn

    All capitalized properties in the options will be pased as is. The callback will be called with an error if any and the endpoint ARN

Source:

(static) aws.snsCreateTopic()

Description:
  • Creates a topic to which notifications can be published. The callback returns topic ARN on success.

Source:

(static) aws.snsDeleteEndpoint()

Description:
  • Deletes the endpoint from Amazon SNS.

Source:

(static) aws.snsDeleteTopic()

Description:
  • Deletes the topic from Amazon SNS.

Source:

(static) aws.snsListTopics()

Description:
  • Creates a topic to which notifications can be published. The callback returns topic ARN on success.

Source:

(static) aws.snsPublish()

Description:
  • Sends a message to all of a topic's subscribed endpoints or to a mobile endpoint. If msg is an object, then it will be pushed as JSON. The options may take the following properties:

    • subject - optional subject to be included in the message if the target supports it
Source:

(static) aws.snsSetEndpointAttributes()

Description:
  • Sets the attributes for an endpoint for a device on one of the supported push notification services, such as GCM and APNS.

    The following properties can be specified in the options:

    • token - a device token for the notification service
    • data - a user data to be associated with the endpoint arn
    • enabled - true or false to enable/disable the deliver of notifications to this endpoint
Source:

(static) aws.snsSetSubscriptionAttributes()

Description:
  • Updates the subscription attributes. The following options can be used:

    • name - new topic name
    • deliveryPolicy - an object with delivery attributes, can specify all or only the ones that needed to be updated
    • minDelayTarget - update delivery policy by attribute name
    • maxDelayTarget
    • numRetries
    • numMaxDelayRetries
    • backoffFunction - one of linear|arithmetic|geometric|exponential
    • maxReceivesPerSecond
Source:

(static) aws.snsSetTopicAttributes()

Description:
  • Updates the topic attributes. The following options can be used:

    • name - new topic name
    • policy - an object with access policy
    • deliveryPolicy - an object with delivery attributes, can specify all or only the ones that needed to be updated
Source:

(static) aws.snsSubscribe()

Description:
  • Creates a topic to which notifications can be published. The callback returns topic ARN on success, if the topic requires confirmation the arn returned will be null and a token will be sent to the endpoint for confirmation.

Source:

(static) aws.snsUnsubscribe()

Description:
  • Creates a topic to which notifications can be published. The callback returns topic ARN on success.

Source:

(static) aws.ssmSendCommand()

Description:
  • Run a shell command

Source:

(static) aws.ssmWaitForCommand()

Description:
  • Return a command details

Source:

(static) aws.toDynamoDB()

Description:
  • Convert a Javascript object into DynamoDB object

Source:

(static) detectLabels()

Description:
  • Detect image features using AWS Rekognition service, the name can be a Buffer, a local file or an url to the S3 bucket. In the latter case the url can be just apath to the file inside a bucket if options.bucket is specified, otherwise it must be a public S3 url with the bucket name to be the first part of the host name. For CDN/CloudFront cases use the option.bucket option.

Source:

(static) ecsDescribeTasks()

Source:

(static) ecsPrepareTask()

Source:

(static) ecsRunTask()

Source:

(static) ecsTaskProtection()

Source:

(static) getInstanceCredentials()

Description:
  • Retrieve instance credentials using EC2 instance profile and setup for AWS access

Source:

(static) getInstanceDetails()

Description:
  • Get the current instance details if not retrieved already in aws.instance

Source:

(static) getInstanceInfo()

Description:
  • Retrieve instance launch index from the meta data if running on AWS instance

Source:

(static) getInstanceMeta()

Description:
  • Retrieve instance meta data

Source:

(static) getInstanceMetaToken()

Source:

(static) getTaskDetails()

Description:
  • If running inside ECS pulls the task details

Source:

(static) listCertificates()

Description:
  • Return a list of certificates,

    • status can limit which certs to return, PENDING_VALIDATION | ISSUED | INACTIVE | EXPIRED | VALIDATION_TIMED_OUT | REVOKED | FAILED
Source:

(static) parseXMLResponse()

Description:
  • Parse AWS response and try to extract error code and message, convert XML into an object.

Source:

(static) queryAWS()

Description:
  • Make AWS request, return parsed response as Javascript object or null in case of error

Source:

(static) queryECS()

Description:
  • AWS ECS API request

Source:

(static) queryEndpoint()

Description:
  • AWS generic query interface

Source:

(static) queryRoute53()

Description:
  • Make a request to Route53 service

Source:

(static) queryRoute53Domains()

Source:

(static) querySES()

Description:
  • AWS SES API request

Source:

(static) querySQS()

Description:
  • AWS SQS API request

Source:

(static) queryService()

Source:

(static) querySign()

Description:
  • Build version 4 signature headers

Source:

(static) readConfig()

Description:
  • Read and apply config from S3 bucket

Source:

(static) readCredentials()

Description:
  • Read key and secret from the AWS SDK credentials file, if no profile is given in the config or command line only the default peofile will be loaded.

Source:

(static) route53Change()

Description:
  • Create or update a host in the Route53 database.

    • names is a host name to be set with the current IP address or a list with objects in the format [ { name: "..", value: "1.1.1.1", type: "A", ttl: 300, zoneId: "Id", alias: "dnsname", hostedzone: "/hostedzone/id" } ...]

    The options may contain the following:

    • type - default record type, A
    • ttl - default TTL, 300 seconds
    • op - an operation, default is UPSERT
Source:

(static) route53Create()

Source:

(static) route53Get()

Description:
  • Return a zone by domain or id

Source:

(static) route53List()

Description:
  • List all zones

Source:

(static) sesSendEmail()

Description:
  • Send an email via SES The following options supported:

    • from - an email to use in the From: header
    • cc - list of email to use in CC: header
    • bcc - list of emails to use in Bcc: header
    • replyTo - list of emails to ue in ReplyTo: header
    • returnPath - email where to send bounces
    • charset - charset to use, default is UTF-8
    • html - if set the body is sent as MIME HTML
    • config - configuration set name
Source:

(static) sesSendRawEmail()

Description:
  • Send raw email The following options accepted:

    • to - list of email addresses to use in RCPT TO
    • from - an email to use in from header
    • config - configuration set name
Source:

(static) sesSendRawEmail2()

Description:
  • SES V2 version

Source:

(static) sqsReceiveMessage()

Description:
  • Receive message(s) from the SQS queue, the callback will receive a list with messages if no error. The following options can be specified:

    • count - how many messages to receive
    • timeout - how long to wait, in milliseconds, this is for Long Poll
    • visibilityTimeout - the duration (in milliseconds) that the received messages are hidden from subsequent retrieve requests
    • attempt - request attempt id for FIFO queues after being retrieved by a ReceiveMessage request.
Source:

(static) sqsSendMessage()

Description:
  • Send a message to the SQS queue. The options can specify the following:

    • delay - how long to delay this message in milliseconds
    • group - a group id for FIFO queues
    • unique - deduplication id for FIFO queues
    • attrs - an object with additional message attributes to send, use only string, numbers or binary values, all other types will be converted into strings
Source:

(static) stsAssumeRole()

Description:
  • Assume a role and return new credentials that can be used in other API calls

Source: