@collaborne/custom-cloudformation-resources
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -1,4 +0,7 @@ | ||
import { ACM, Route53 } from 'aws-sdk'; | ||
import { CustomResource } from '../custom-resource'; | ||
import { isDefined } from '../utils'; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ACMCloudfrontCertificate = void 0; | ||
const aws_sdk_1 = require("aws-sdk"); | ||
const custom_resource_1 = require("../custom-resource"); | ||
const utils_1 = require("../utils"); | ||
const EMAIL_DOMAIN_VALIDATION_OPTION_SCHEMA = { | ||
@@ -77,7 +80,7 @@ type: 'object', | ||
// XXX: The AWS::CertificateManager::Certificate uses the ARN as Ref, not an id (and then also doesn't have a .Arn attribute) | ||
export class ACMCloudfrontCertificate extends CustomResource { | ||
class ACMCloudfrontCertificate extends custom_resource_1.CustomResource { | ||
constructor(logicalResourceId, logger) { | ||
super(SCHEMA, logicalResourceId, logger); | ||
this.acm = new ACM({ region: 'us-east-1' }); | ||
this.route53 = new Route53(); | ||
this.acm = new aws_sdk_1.ACM({ region: 'us-east-1' }); | ||
this.route53 = new aws_sdk_1.Route53(); | ||
} | ||
@@ -274,3 +277,3 @@ async createResource(physicalResourceId, params) { | ||
.map(option => option.ResourceRecord) | ||
.filter(isDefined); | ||
.filter(utils_1.isDefined); | ||
const missingResourceRecords = dnsDomainValidationOptions.length - resourceRecords.length; | ||
@@ -380,2 +383,3 @@ if (missingResourceRecords > 0) { | ||
} | ||
exports.ACMCloudfrontCertificate = ACMCloudfrontCertificate; | ||
//# sourceMappingURL=index.js.map |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
// Based on the cfn-response sources published by AWS at | ||
@@ -5,6 +6,11 @@ // https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-lambda-function-code-cfnresponsemodule.html | ||
// SPDX-License-Identifier: MIT-0 | ||
import https from 'https'; | ||
export const SUCCESS = 'SUCCESS'; | ||
export const FAILED = 'FAILED'; | ||
export function send(request, responseStatus, responseReason, physicalResourceId, responseData = {}, noEcho = false) { | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.send = exports.FAILED = exports.SUCCESS = void 0; | ||
const https_1 = __importDefault(require("https")); | ||
exports.SUCCESS = 'SUCCESS'; | ||
exports.FAILED = 'FAILED'; | ||
function send(request, responseStatus, responseReason, physicalResourceId, responseData = {}, noEcho = false) { | ||
const responseBody = JSON.stringify({ | ||
@@ -33,3 +39,3 @@ Status: responseStatus, | ||
} | ||
const req = https.request(request.ResponseURL, options, res => { | ||
const req = https_1.default.request(request.ResponseURL, options, res => { | ||
if (!res.statusCode || res.statusCode >= 400) { | ||
@@ -51,2 +57,3 @@ const message = `Unexpected status code ${res.statusCode}`; | ||
} | ||
exports.send = send; | ||
//# sourceMappingURL=cfn-response.js.map |
@@ -1,3 +0,6 @@ | ||
import { send as sendResponse, } from './cfn-response'; | ||
export class CustomResource { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CustomResource = void 0; | ||
const cfn_response_1 = require("./cfn-response"); | ||
class CustomResource { | ||
constructor(schema, logicalResourceId, logger) { | ||
@@ -72,3 +75,3 @@ this.schema = schema; | ||
const responsePhysicalResourceId = (response === null || response === void 0 ? void 0 : response.physicalResourceId) || physicalResourceId; | ||
await sendResponse(request, status, statusReason, responsePhysicalResourceId, response === null || response === void 0 ? void 0 : response.attributes); | ||
await cfn_response_1.send(request, status, statusReason, responsePhysicalResourceId, response === null || response === void 0 ? void 0 : response.attributes); | ||
return { | ||
@@ -84,2 +87,3 @@ status, | ||
} | ||
exports.CustomResource = CustomResource; | ||
//# sourceMappingURL=custom-resource.js.map |
@@ -0,6 +1,14 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ACMCloudfrontCertificate = exports.CustomResource = exports.send = exports.FAILED = exports.SUCCESS = void 0; | ||
// Export all general utilities for building custom resources | ||
export { SUCCESS, FAILED, send, } from './cfn-response'; | ||
export { CustomResource } from './custom-resource'; | ||
var cfn_response_1 = require("./cfn-response"); | ||
Object.defineProperty(exports, "SUCCESS", { enumerable: true, get: function () { return cfn_response_1.SUCCESS; } }); | ||
Object.defineProperty(exports, "FAILED", { enumerable: true, get: function () { return cfn_response_1.FAILED; } }); | ||
Object.defineProperty(exports, "send", { enumerable: true, get: function () { return cfn_response_1.send; } }); | ||
var custom_resource_1 = require("./custom-resource"); | ||
Object.defineProperty(exports, "CustomResource", { enumerable: true, get: function () { return custom_resource_1.CustomResource; } }); | ||
// Export actual resources | ||
export { ACMCloudfrontCertificate } from './acm-certificate'; | ||
var acm_certificate_1 = require("./acm-certificate"); | ||
Object.defineProperty(exports, "ACMCloudfrontCertificate", { enumerable: true, get: function () { return acm_certificate_1.ACMCloudfrontCertificate; } }); | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,3 @@ | ||
export {}; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=logger.js.map |
@@ -1,4 +0,8 @@ | ||
export function isDefined(o) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isDefined = void 0; | ||
function isDefined(o) { | ||
return typeof o !== 'undefined'; | ||
} | ||
exports.isDefined = isDefined; | ||
//# sourceMappingURL=utils.js.map |
{ | ||
"name": "@collaborne/custom-cloudformation-resources", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Custom CloudFormation resources", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -5,3 +5,3 @@ { | ||
"outDir": "dist", | ||
"module": "es6", | ||
"module": "commonjs", | ||
"declaration": true | ||
@@ -8,0 +8,0 @@ }, |
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
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
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
134409
1434