npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

aws-automation-utils

v1.4.1

Published

Some Helpers to automate certain AWS tasks such as restoring an RDS instance or updating ElasticBeanstalk environment settings

Downloads

13

Readme

aws-automation-utils

Build Status

Some Helpers to automate certain AWS tasks such as restoring an RDS instance or updating ElasticBeanstalk environment settings

Usage

npm i aws-automation-utils --save

Create fresh backup of a database

Spawns a new instance with the desired parameters. It waits for the instance to be available. The new instance has a unique name based on the current date and time of the day.

const rdsService = require('aws-automation-utils').rds;
const newDatabaseName = await rdsService.restore({
    enabled: true,
    region: 'us-east-1',
    timeout: 600,
    prod: {
        dbIdentifier: 'production-database'
    },
    dev: {
        databasePrefix: "dev-database",
        securityGroups: ["sg-123abc"],
        tags: [ {
            "Key": "db_type",
            "Value": "dev"
        }],
        availabilityZone: 'us-east-1c',
        instanceClass: 'db.t2.small',
        publiclyAccessible: true,
        multiAZ: false
    }
});
console.log(`Created database: ${newDatabaseName}`);

Change the Master Password of a database

Changes the master password of a database. It waits for the instance to be available.

const rdsService = require('aws-automation-utils').rds;
await rdsService.updatePassword({
  enabled: true,
  region: 'us-east-1',
  timeout: 600,
  dbIdentifier: 'dev-database-2019-02-24',
  password: 'SUPER_SECRET'
});

Delete old Development databases

Deletes old database instances based on their name. As long as they start with the specified prefix.

const rdsService = require('aws-automation-utils').rds;
await rdsService.deleteOlder({
  enabled: true,
  region: 'us-east-1',
  databasePrefix: 'dev-database'
});

Update an Elastic Beanstalk environment variable

Sets an environment value in the specified Elastic Beanstalk environment. It waits for the environment to be ready.

const elasticBeanstalkHelper = require('aws-automation-utils').elasticBeanstalk;
await elasticBeanstalkHelper.updateEnvironment({
  enabled: true,
  region: 'us-east-1',
  environmentName: 'dev-environment',
  key: 'API_URL',
  value: 'https://myapi.com/api/v1/',
  timeout: 600
});

Set a Lambda Environment Variable

Sets an environment value in the specified lambda function. It creates a new setting if the setting does not exist.

const lambda = require('aws-automation-utils').lambda;
await lambda.updateEnvironment({
    region: 'us-east-2',
    functionName: 'function1',
    key: 'TEST',
    value: 'MAYBE'
});

Disable a lambda

Disables all the event source mappings of the specified lambda function.

const lambda = require('aws-automation-utils').lambda;
const statusUpdateResult = await lambda.updateStatus({
    region: 'us-east-2',
    functionName: 'function1',
    enabled: false
});

Enable a lambda

Enables all the event source mappings of the specified lambda function.

const lambda = require('aws-automation-utils').lambda;
const statusUpdateResult = await lambda.updateStatus({
    region: 'us-east-2',
    functionName: 'function1',
    enabled: true
});

Change the concurrency limit of a lambda

Sets the concurrency limit of a lambda to the specified value. Disables the limit when 0 is specified.

const lambda = require('aws-automation-utils').lambda;
const statusUpdateResult = await lambda.updateConcurrency({
    region: 'us-east-2',
    functionName: 'function1',
    concurrency: 10
});

Disable the concurrency limit of a lambda

const lambda = require('aws-automation-utils').lambda;
const statusUpdateResult = await lambda.updateConcurrency({
    region: 'us-east-2',
    functionName: 'function1'
});