@silvermine/cloudformation-custom-resources
Advanced tools
Comparing version 1.0.0-rc3 to 1.1.0
{ | ||
"name": "@silvermine/cloudformation-custom-resources", | ||
"version": "1.0.0-rc3", | ||
"version": "1.1.0", | ||
"description": "Collection of custom resources for CloudFormation that anyone can use.", | ||
"main": "src/index.js", | ||
"scripts": { | ||
"test": "./node_modules/.bin/istanbul cover --root src --include-all-sources ./node_modules/.bin/_mocha -- -r ./tests/setup/before.js -R spec 'tests/**/*.test.js'" | ||
"commitlint": "commitlint --from 66cbf40", | ||
"test": "check-node-version --npm 6.14.12 && nyc mocha -- -r ./tests/setup/before.js -R spec 'tests/**/*.test.js'" | ||
}, | ||
"engines": { | ||
"node": ">=8.10.0", | ||
"npm": "6.4.1" | ||
}, | ||
"repository": { | ||
@@ -21,3 +18,2 @@ "type": "git", | ||
"AWS", | ||
"OriginAccessIdentity", | ||
"DynamoDB global table", | ||
@@ -42,21 +38,19 @@ "SimpleEmailService", | ||
"silvermine-lambda-utils": "git+https://github.com/silvermine/lambda-utils.git#8929f5531db49f7364de7a5e3f9bb8dabee8896e", | ||
"underscore": "1.9.1" | ||
"underscore": "1.13.1" | ||
}, | ||
"peerDependencies": { | ||
"aws-sdk": ">=2.373.0" | ||
"aws-sdk": ">=2.646.0" | ||
}, | ||
"devDependencies": { | ||
"@silvermine/chai-strictly-equal": "1.0.0", | ||
"@silvermine/eslint-config": "2.0.0-rc2", | ||
"@silvermine/eslint-config": "3.0.1", | ||
"@silvermine/standardization": "1.0.3", | ||
"chai": "4.2.0", | ||
"check-node-version": "3.2.0", | ||
"coveralls": "3.0.2", | ||
"eslint": "5.10.0", | ||
"grunt": "1.0.3", | ||
"eslint": "6.8.0", | ||
"grunt": "1.4.0", | ||
"grunt-cli": "1.3.2", | ||
"grunt-eslint": "21.0.0", | ||
"istanbul": "0.4.5", | ||
"mocha": "5.2.0", | ||
"mocha-lcov-reporter": "1.3.0", | ||
"npm": "6.4.1", | ||
"grunt-eslint": "22.0.0", | ||
"mocha": "8.4.0", | ||
"nyc": "15.1.0", | ||
"rewire": "4.0.1", | ||
@@ -63,0 +57,0 @@ "silvermine-serverless-utils": "git+https://github.com/silvermine/serverless-utils.git#910f1149af824fc8d0fa840878079c7d3df0f414", |
@@ -31,6 +31,51 @@ 'use strict'; | ||
doUpdate: function(resourceID) { | ||
throw new Error(`Updates for custom domains are not supported (${resourceID})`); | ||
doUpdate: function(resourceID, props, oldProps) { | ||
const cloneOfNewProps = JSON.parse(JSON.stringify(props)), | ||
cloneOfOldProps = JSON.parse(JSON.stringify(oldProps)); | ||
// Remove the properties that *can* be updated (there's probably more) | ||
delete cloneOfNewProps.regionalCertificateArn; | ||
delete cloneOfOldProps.regionalCertificateArn; | ||
// Then check to see if any of the properties that remain (i.e. those that cannot be | ||
// updated) were changed | ||
if (!_.isEqual(cloneOfNewProps, cloneOfOldProps)) { | ||
// Log the old vs new props rather than putting the data in the error message as | ||
// the response can only be 4,096 bytes long. See: | ||
// https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html | ||
console.log( | ||
`ERROR Not updating ${resourceID} as one or more of the changed fields does not support updates` | ||
+ ` Old: ${JSON.stringify(oldProps)} New: ${JSON.stringify(props)}` | ||
); | ||
throw new Error(`One or more of the changed fields does not support updates (${resourceID})`); | ||
} | ||
const patchOperations = []; | ||
// eslint-disable-next-line max-len | ||
if (props.regionalCertificateArn && oldProps.regionalCertificateArn && props.regionalCertificateArn !== oldProps.regionalCertificateArn) { | ||
patchOperations.push({ | ||
op: 'replace', | ||
path: '/regionalCertificateArn', | ||
value: props.regionalCertificateArn, | ||
}); | ||
} | ||
if (_.isEmpty(patchOperations)) { | ||
// Log the old vs new props rather than putting the data in the error message as | ||
// the response can only be 4,096 bytes long. See: | ||
// https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html | ||
console.log( | ||
`ERROR Not performing any patch operations on ${resourceID} as one or more of the changed fields does not support updates` | ||
+ ` Old: ${JSON.stringify(oldProps)} New: ${JSON.stringify(props)}` | ||
); | ||
throw new Error(`One or more of the changed fields does not support updates (${resourceID})`); | ||
} | ||
return Q.ninvoke(apigw, 'updateDomainName', { domainName: resourceID, patchOperations }) | ||
.then(function(resp) { | ||
return { PhysicalResourceId: resp.domainName, regionalDomainName: resp.regionalDomainName }; | ||
}); | ||
}, | ||
}); |
@@ -12,3 +12,2 @@ 'use strict'; | ||
SNSSQSSubscription: require('./SNSSQSSubscription'), // eslint-disable-line global-require | ||
CloudFrontOriginAccessIdentity: require('./CloudFrontOriginAccessIdentity'), // eslint-disable-line global-require | ||
// This resource will be named "SimpleDynamoDBGlobalTable" only in 1.0.0-rc3 for the | ||
@@ -29,2 +28,6 @@ // transition from the old DynamoDBGlobalTable resource to the newer, simpler one. See | ||
ELBTargetGroupLambdaTarget: require('./ELBTargetGroupLambdaTarget'), // eslint-disable-line global-require | ||
ElasticSearchClusterSettings: require('./ElasticSearchClusterSettings'), // eslint-disable-line global-require | ||
ElasticSearchIndex: require('./ElasticSearchIndex'), // eslint-disable-line global-require | ||
ElasticSearchIndexAlias: require('./ElasticSearchIndexAlias'), // eslint-disable-line global-require | ||
ElasticSearchPackage: require('./ElasticSearchPackage'), // eslint-disable-line global-require | ||
}; | ||
@@ -31,0 +34,0 @@ |
@@ -356,3 +356,3 @@ 'use strict'; | ||
if (srcBillingMode) { | ||
if (srcBillingMode && srcBillingMode !== destBillingMode) { | ||
params.BillingMode = srcBillingMode; | ||
@@ -391,3 +391,3 @@ } | ||
gsiUpdate = { Create: _.pick(masterGSI, 'IndexName', 'KeySchema', 'Projection') }; | ||
if (srcBillingMode === 'PROVISIONED') { | ||
if (srcBillingMode !== 'PAY_PER_REQUEST') { | ||
gsiUpdate.Create.ProvisionedThroughput = _.pick(masterGSI.ProvisionedThroughput, 'ReadCapacityUnits', 'WriteCapacityUnits'); | ||
@@ -394,0 +394,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
86600
14
21
1329
0
4
+ Addedunderscore@1.13.1(transitive)
- Removedunderscore@1.9.1(transitive)
Updatedunderscore@1.13.1