New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

simple-route53-ddns

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-route53-ddns - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6-beta.0

2

dist/package.json
{
"name": "simple-route53-ddns",
"version": "0.0.5",
"version": "0.0.6-beta.0",
"description": "npm module containing a cron friendly script to get your machine's ip address and update it as a record set in the specified hosted zone in AWS Route53",

@@ -5,0 +5,0 @@ "main": "./dist/src/index",

@@ -13,3 +13,3 @@ #!/usr/bin/env node

.requiredOption(`-h, --hosted-zone-id [value]`, `The hosted zone in Route53 where the record set will be created/updated`)
.requiredOption(`-d, --domains [value...]`, `A space delimited list of domain names. Must be a FQDN or subdomain of the root FQDNA space delimited list of domain names. Must be a FQDN or subdomain of the root FQDN`)
.requiredOption(`-d, --domain [value]`, `The domain name. Must be a FQDN or subdomain of the root FQDN.`)
.option(`-t, --type [value]`, `The DNS record set type to create/update (optional, will use "A" if not set)`, 'A')

@@ -16,0 +16,0 @@ .option(`-l, --ttl [value]`, `The TTL (optional, will default to "60" seconds if not set)`, '60')

@@ -11,4 +11,5 @@ import { UpdateRecordSetOptions } from 'types';

private getIpAddress;
validateResourceRecordSet(domain: string): Promise<'COMPLETE' | 'UPSERT'>;
private pushRecordSet;
}
//# sourceMappingURL=update-record-set.d.ts.map

@@ -42,4 +42,5 @@ "use strict";

this.getIpAddress();
for (const domain of this.options.domains) {
yield this.pushRecordSet(domain);
const action = yield this.validateResourceRecordSet(this.options.domain);
if (action === 'UPSERT') {
yield this.pushRecordSet(this.options.domain);
}

@@ -66,2 +67,37 @@ });

}
validateResourceRecordSet(domain) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
try {
const list = yield this.route53Client
.listResourceRecordSets({
HostedZoneId: this.options.hostedZoneId,
StartRecordName: domain,
StartRecordType: this.options.type
})
.promise();
if (list.ResourceRecordSets.length > 0) {
const [resourceRecordSet] = list.ResourceRecordSets;
const [resourceRecord] = (_a = resourceRecordSet.ResourceRecords) !== null && _a !== void 0 ? _a : [];
const { Value: currentIp } = resourceRecord !== null && resourceRecord !== void 0 ? resourceRecord : {};
if (currentIp === this.ip) {
console.log(chalk_1.default.greenBright(`network public ip address is already the same as the one set in the target resource record for ${domain}, nothing further to do`));
return 'COMPLETE';
}
else {
console.log(chalk_1.default.yellowBright(`network public ip address is different from the one in the record set for ${domain}, will update the record set`));
return 'UPSERT';
}
}
else {
console.log(chalk_1.default.yellowBright(`no existing record set for ${domain} in specified hosted zone, will create a new record set`));
return 'UPSERT';
}
}
catch (e) {
console.log(chalk_1.default.redBright(`Failed to obtain resource record sets for the given hosted zone`), e);
throw e;
}
});
}
pushRecordSet(domain) {

@@ -68,0 +104,0 @@ return __awaiter(this, void 0, void 0, function* () {

{
"name": "simple-route53-ddns",
"version": "0.0.5",
"version": "0.0.6-beta.0",
"description": "npm module containing a cron friendly script to get your machine's ip address and update it as a record set in the specified hosted zone in AWS Route53",

@@ -5,0 +5,0 @@ "main": "./dist/src/index",

@@ -32,12 +32,10 @@ # Simple Route53 Dynamic DNS

| Option | Required | Description |
| ------------------- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| -h --hosted-zone-id | :x: | The hosted zone in Route53 where the record set will be created/updated |
| -d --domains | :x: | A space delimited list of domain names. Must be a FQDN or subdomain of the root FQDNA space delimited list of domain names. Must be a FQDN or subdomain of the root ~~FQDN~~~~~~ |
| -t --type | :heavy_check_mark: | The DNS record set type to create/update (optional, will use `A` if not set) |
| -l --ttl | :heavy_check_mark: | The TTL (optional, will default to `60` seconds if not set) |
| -p --profile | :heavy_check_mark: | The IAM profile that is configured for use to interact with the target AWS account (optional, will use `default` if not set) |
| -r --region | :heavy_check_mark: | The region that the AWS SDK should operate in when running commands (optional, will use `ap-southeast-1` if not set) |
| Option | Required | Description |
| ------------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
| -h --hosted-zone-id | :x: | The hosted zone in Route53 where the record set will be created/updated |
| -d --domain | :x: | The domain name. Must be a FQDN or subdomain of the root FQDN. |
| -t --type | :heavy_check_mark: | The DNS record set type to create/update (optional, will use `A` if not set) |
| -l --ttl | :heavy_check_mark: | The TTL (optional, will default to `60` seconds if not set) |
| -p --profile | :heavy_check_mark: | The IAM profile that is configured for use to interact with the target AWS account (optional, will use `default` if not set) |
| -r --region | :heavy_check_mark: | The region that the AWS SDK should operate in when running commands (optional, will use `ap-southeast-1` if not set) |
> The Route53 AWS SDK has a hard limit of 5 concurrent/bulk operations per second per account. Consider running this command in batches if you have more than 5 domains to be updated.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc