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

mindless-route53

v2.0.1

Published

low-mental-load API/CLI for AWS Route 53

Downloads

143

Readme

mindless-route53

CircleCI Coverage Status semantic-release Commitizen friendly npm version

low-mental-load API/CLI for AWS Route 53

For our purposes at least, looking up the hosted zone id when upserting a DNS record via script or CLI is a useless waste of time...it can be determined automatically from the DNS name for the record being upserted.

Node.js API

findHostedZones(options)

Finds the properties of the private and public hosted zones whose names are the deepest superdomain of a given DNSName.

options

awsConfig (AWS.ConfigurationOptions, optional)

The general configuration options for AWS services, like credentials and region

DNSName (string, required)

the DNSName to search for, which can be either the exact name of the hosted zone or a subdomain.

Route53 (AWS.Route53, optional)

a Route53 client with your desired settings.

Returns

PrivateHostedZone, ?Zone:

The properties of the private hosted zone whose name is the deepest superdomain of the given DNSName, or null if no matching private hosted zone was found.

PublicHostedZone, ?Zone:

The properties of the public hosted zone whose name is the deepest superdomain of the given DNSName, or null if no matching public hosted zone was found.

findHostedZone(options)

Finds the properties of the hosted zone whose name is the deepest superdomain of a given DNSName.

options

DNSName (string, required)

the DNSName to search for, which can be

either the exact name of the hosted zone or a subdomain.

PrivateZone (boolean, optional)

whether to find a private zone

Route53 (AWS.Route53, optional)

a Route53 client with your desired

settings.

Returns

The properties of the hosted zone whose name is the deepest superdomain of the given DNSName.

findHostedZoneId(options)

Like findHostedZoneId(options), but just returns the zone id.

upsertRecordSet(options)

Upserts a single DNS record set.

options

awsConfig (AWS.ConfigurationOptions, optional)

The general configuration options for AWS services, like credentials and region

ResourceRecordSet (ResourceRecordSet, optional)

a ResourceRecordSet as accepted by the AWS SDK for upsert (you may provide this or Name/Target/TTL)

Name (string, optional)

the name of the record (required if ResourceRecordSet isn't given)

Target (string | Array<string>, optional)

the IP address value(s) for an A record or DNS name value(s) for a CNAME record (required if ResourceRecordSet isn't given)

TTL (number, optional)

the time to live (required if ResourceRecordSet isn't given)

PrivateZone (boolean, optional)

whether to use the private hosted zone

HostedZone (Zone, optional)

information about the target hosted zone, as returned from findHostedZone or findHostedZones. You can speed up multiple calls to the same hosted zone by pre-fetching the zone info and providing it here.

Comment (string, optional)

a comment for the upsert

Route53 (AWS.Route53, optional)

a Route53 client with your desired

waitForChanges (boolean, optional)

defaults to true. If false, upsertRecordSet will return without waiting for confirmation that the Route53 record changes were successfully executed.

Returns

The result of the AWS.Route53.changeResourceRecordSets call.

upsertPublicAndPrivateRecords(options)

Upserts public and private DNS records for a single hostname.

options

awsConfig (AWS.ConfigurationOptions, optional)

The general configuration options for AWS services, like credentials and region

Name (string, required)

the name of the record

TTL (number, required)

the time to live

PrivateTarget (string | Array<string>, required)

the IP address value(s) for an A record or DNS name value(s) for a CNAME record in the private zone.

PublicTarget (string | Array<string>, required)

the IP address value(s) for an A record or DNS name value(s) for a CNAME record in the public zone.

PrivateHostedZone (Zone, optional)

information about the private hosted zone, as returned from findHostedZones. You can speed up multiple calls to the same hosted zones by pre-fetching the zone info and providing it here.

PublicHostedZone (Zone, optional)

information about the public hosted zone, as returned from findHostedZones. You can speed up multiple calls to the same hosted zones by pre-fetching the zone info and providing it here.

Route53 (AWS.Route53, optional)

a Route53 client with your desired

waitForChanges (boolean, optional)

defaults to true. If false, upsertPublicAndPrivateRecords will return without waiting for confirmation that the Route53 record changes were successfully executed.

Returns

The result of the AWS.Route53.changeResourceRecordSets call.

CLI

You can use the mindless-route53 or mroute53 CLI command.

mroute53 upsert

upsert a resource record set

Usage

mroute53 upsert --name <DNS name> --target <target IP(s) or DNS name(s)> --ttl
<time to live> [--private] [--comment <comment>] [--region <AWS region>]

Options

--version      Show version number                                   [boolean]
--help         Show help                                             [boolean]
-n, --name     the DNS name for the record set                        [string]
-t, --target   the target IP address(es) for an A record or DNS name(s) for a
               CNAME record                                            [array]
--ttl          the time-to-live for the record                        [number]
--private      whether to use the private hosted zone
                                                    [boolean] [default: false]
-c, --comment  a comment for the change                               [string]
--region       the AWS region                                         [string]
-q, --quiet    suppress output                                       [boolean]
-v, --verbose  enable verbose output                                 [boolean]