@aws-solutions-constructs/aws-lambda-elasticachememcached 2.59.0 → 2.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +45 -8
- package/lib/index.js +1 -1
- package/package.json +6 -6
- package/test/integ.lammem-existingResources.js +3 -2
- package/test/integ.lammem-existingResources.js.snapshot/{asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e → asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a}/__entrypoint__.js +1 -1
- package/test/integ.lammem-existingResources.js.snapshot/lammem-existingResources.assets.json +5 -5
- package/test/integ.lammem-existingResources.js.snapshot/lammem-existingResources.template.json +120 -3
- package/test/integ.lammem-existingResources.js.snapshot/manifest.json +7 -1
- package/test/integ.lammem-existingResources.js.snapshot/tree.json +63 -55
- package/test/integ.lammem-newResources.js +3 -2
- package/test/{integ.lammem-withClientProps.js.snapshot/asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e → integ.lammem-newResources.js.snapshot/asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a}/__entrypoint__.js +1 -1
- package/test/integ.lammem-newResources.js.snapshot/lammem-newResources.assets.json +5 -5
- package/test/integ.lammem-newResources.js.snapshot/lammem-newResources.template.json +120 -3
- package/test/integ.lammem-newResources.js.snapshot/manifest.json +7 -1
- package/test/integ.lammem-newResources.js.snapshot/tree.json +63 -55
- package/test/integ.lammem-withClientProps.js +3 -2
- package/test/{integ.lammem-newResources.js.snapshot/asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e → integ.lammem-withClientProps.js.snapshot/asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a}/__entrypoint__.js +1 -1
- package/test/integ.lammem-withClientProps.js.snapshot/lammem-withClientProps.assets.json +5 -5
- package/test/integ.lammem-withClientProps.js.snapshot/lammem-withClientProps.template.json +120 -3
- package/test/integ.lammem-withClientProps.js.snapshot/manifest.json +7 -1
- package/test/integ.lammem-withClientProps.js.snapshot/tree.json +63 -55
- package/test/lambda-elasticachememcached.test.js +18 -18
- /package/test/integ.lammem-existingResources.js.snapshot/{asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e → asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a}/index.js +0 -0
- /package/test/integ.lammem-newResources.js.snapshot/{asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e → asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a}/index.js +0 -0
- /package/test/integ.lammem-withClientProps.js.snapshot/{asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e → asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a}/index.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.withRetries=exports.handler=exports.external=void 0;const https=require("https"),url=require("url");exports.external={sendHttpRequest:defaultSendHttpRequest,log:defaultLog,includeStackTraces:!0,userHandlerIndex:"./index"};const CREATE_FAILED_PHYSICAL_ID_MARKER="AWSCDK::CustomResourceProviderFramework::CREATE_FAILED",MISSING_PHYSICAL_ID_MARKER="AWSCDK::CustomResourceProviderFramework::MISSING_PHYSICAL_ID";async function handler(event,context){const sanitizedEvent={...event,ResponseURL:"..."};if(exports.external.log(JSON.stringify(sanitizedEvent,void 0,2)),event.RequestType==="Delete"&&event.PhysicalResourceId===CREATE_FAILED_PHYSICAL_ID_MARKER){exports.external.log("ignoring DELETE event caused by a failed CREATE event"),await submitResponse("SUCCESS",event);return}try{const userHandler=require(exports.external.userHandlerIndex).handler,result=await userHandler(sanitizedEvent,context),responseEvent=renderResponse(event,result);await submitResponse("SUCCESS",responseEvent)}catch(e){const resp={...event,Reason:exports.external.includeStackTraces?e.stack:e.message};resp.PhysicalResourceId||(event.RequestType==="Create"?(exports.external.log("CREATE failed, responding with a marker physical resource id so that the subsequent DELETE will be ignored"),resp.PhysicalResourceId=CREATE_FAILED_PHYSICAL_ID_MARKER):exports.external.log(`ERROR: Malformed event. "PhysicalResourceId" is required: ${JSON.stringify(event)}`)),await submitResponse("FAILED",resp)}}exports.handler=handler;function renderResponse(cfnRequest,handlerResponse={}){const physicalResourceId=handlerResponse.PhysicalResourceId??cfnRequest.PhysicalResourceId??cfnRequest.RequestId;if(cfnRequest.RequestType==="Delete"&&physicalResourceId!==cfnRequest.PhysicalResourceId)throw new Error(`DELETE: cannot change the physical resource ID from "${cfnRequest.PhysicalResourceId}" to "${handlerResponse.PhysicalResourceId}" during deletion`);return{...cfnRequest,...handlerResponse,PhysicalResourceId:physicalResourceId}}async function submitResponse(status,event){const json={Status:status,Reason:event.Reason??status,StackId:event.StackId,RequestId:event.RequestId,PhysicalResourceId:event.PhysicalResourceId||MISSING_PHYSICAL_ID_MARKER,LogicalResourceId:event.LogicalResourceId,NoEcho:event.NoEcho,Data:event.Data}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.withRetries=exports.handler=exports.external=void 0;const https=require("https"),url=require("url");exports.external={sendHttpRequest:defaultSendHttpRequest,log:defaultLog,includeStackTraces:!0,userHandlerIndex:"./index"};const CREATE_FAILED_PHYSICAL_ID_MARKER="AWSCDK::CustomResourceProviderFramework::CREATE_FAILED",MISSING_PHYSICAL_ID_MARKER="AWSCDK::CustomResourceProviderFramework::MISSING_PHYSICAL_ID";async function handler(event,context){const sanitizedEvent={...event,ResponseURL:"..."};if(exports.external.log(JSON.stringify(sanitizedEvent,void 0,2)),event.RequestType==="Delete"&&event.PhysicalResourceId===CREATE_FAILED_PHYSICAL_ID_MARKER){exports.external.log("ignoring DELETE event caused by a failed CREATE event"),await submitResponse("SUCCESS",event);return}try{const userHandler=require(exports.external.userHandlerIndex).handler,result=await userHandler(sanitizedEvent,context),responseEvent=renderResponse(event,result);await submitResponse("SUCCESS",responseEvent)}catch(e){const resp={...event,Reason:exports.external.includeStackTraces?e.stack:e.message};resp.PhysicalResourceId||(event.RequestType==="Create"?(exports.external.log("CREATE failed, responding with a marker physical resource id so that the subsequent DELETE will be ignored"),resp.PhysicalResourceId=CREATE_FAILED_PHYSICAL_ID_MARKER):exports.external.log(`ERROR: Malformed event. "PhysicalResourceId" is required: ${JSON.stringify(event)}`)),await submitResponse("FAILED",resp)}}exports.handler=handler;function renderResponse(cfnRequest,handlerResponse={}){const physicalResourceId=handlerResponse.PhysicalResourceId??cfnRequest.PhysicalResourceId??cfnRequest.RequestId;if(cfnRequest.RequestType==="Delete"&&physicalResourceId!==cfnRequest.PhysicalResourceId)throw new Error(`DELETE: cannot change the physical resource ID from "${cfnRequest.PhysicalResourceId}" to "${handlerResponse.PhysicalResourceId}" during deletion`);return{...cfnRequest,...handlerResponse,PhysicalResourceId:physicalResourceId}}async function submitResponse(status,event){const json={Status:status,Reason:event.Reason??status,StackId:event.StackId,RequestId:event.RequestId,PhysicalResourceId:event.PhysicalResourceId||MISSING_PHYSICAL_ID_MARKER,LogicalResourceId:event.LogicalResourceId,NoEcho:event.NoEcho,Data:event.Data},parsedUrl=url.parse(event.ResponseURL),loggingSafeUrl=`${parsedUrl.protocol}//${parsedUrl.hostname}/${parsedUrl.pathname}?***`;exports.external.log("submit response to cloudformation",loggingSafeUrl,json);const responseBody=JSON.stringify(json),req={hostname:parsedUrl.hostname,path:parsedUrl.path,method:"PUT",headers:{"content-type":"","content-length":Buffer.byteLength(responseBody,"utf8")}};await withRetries({attempts:5,sleep:1e3},exports.external.sendHttpRequest)(req,responseBody)}async function defaultSendHttpRequest(options,requestBody){return new Promise((resolve,reject)=>{try{const request=https.request(options,response=>{response.resume(),!response.statusCode||response.statusCode>=400?reject(new Error(`Unsuccessful HTTP response: ${response.statusCode}`)):resolve()});request.on("error",reject),request.write(requestBody),request.end()}catch(e){reject(e)}})}function defaultLog(fmt,...params){console.log(fmt,...params)}function withRetries(options,fn){return async(...xs)=>{let attempts=options.attempts,ms=options.sleep;for(;;)try{return await fn(...xs)}catch(e){if(attempts--<=0)throw e;await sleep(Math.floor(Math.random()*ms)),ms*=2}}}exports.withRetries=withRetries;async function sleep(ms){return new Promise(ok=>setTimeout(ok,ms))}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "36.0.0",
|
|
3
3
|
"files": {
|
|
4
|
-
"
|
|
4
|
+
"ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a": {
|
|
5
5
|
"source": {
|
|
6
|
-
"path": "asset.
|
|
6
|
+
"path": "asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a",
|
|
7
7
|
"packaging": "zip"
|
|
8
8
|
},
|
|
9
9
|
"destinations": {
|
|
10
10
|
"current_account-current_region": {
|
|
11
11
|
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
|
|
12
|
-
"objectKey": "
|
|
12
|
+
"objectKey": "ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a.zip",
|
|
13
13
|
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
|
-
"
|
|
30
|
+
"d2223c3158e5b4a83d5429fd9d8bb998cfcb32c3fc10ec7e016d9b60cff0827d": {
|
|
31
31
|
"source": {
|
|
32
32
|
"path": "lammem-withClientProps.template.json",
|
|
33
33
|
"packaging": "file"
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"destinations": {
|
|
36
36
|
"current_account-current_region": {
|
|
37
37
|
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
|
|
38
|
-
"objectKey": "
|
|
38
|
+
"objectKey": "d2223c3158e5b4a83d5429fd9d8bb998cfcb32c3fc10ec7e016d9b60cff0827d.json",
|
|
39
39
|
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -258,7 +258,7 @@
|
|
|
258
258
|
"Arn"
|
|
259
259
|
]
|
|
260
260
|
},
|
|
261
|
-
"Runtime": "
|
|
261
|
+
"Runtime": "nodejs20.x",
|
|
262
262
|
"TracingConfig": {
|
|
263
263
|
"Mode": "Active"
|
|
264
264
|
},
|
|
@@ -652,7 +652,7 @@
|
|
|
652
652
|
"S3Bucket": {
|
|
653
653
|
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
|
|
654
654
|
},
|
|
655
|
-
"S3Key": "
|
|
655
|
+
"S3Key": "ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a.zip"
|
|
656
656
|
},
|
|
657
657
|
"Timeout": 900,
|
|
658
658
|
"MemorySize": 128,
|
|
@@ -663,7 +663,15 @@
|
|
|
663
663
|
"Arn"
|
|
664
664
|
]
|
|
665
665
|
},
|
|
666
|
-
"Runtime":
|
|
666
|
+
"Runtime": {
|
|
667
|
+
"Fn::FindInMap": [
|
|
668
|
+
"LatestNodeRuntimeMap",
|
|
669
|
+
{
|
|
670
|
+
"Ref": "AWS::Region"
|
|
671
|
+
},
|
|
672
|
+
"value"
|
|
673
|
+
]
|
|
674
|
+
},
|
|
667
675
|
"Description": "Lambda function for removing all inbound/outbound rules from the VPC default security group"
|
|
668
676
|
},
|
|
669
677
|
"DependsOn": [
|
|
@@ -689,6 +697,115 @@
|
|
|
689
697
|
}
|
|
690
698
|
}
|
|
691
699
|
},
|
|
700
|
+
"Mappings": {
|
|
701
|
+
"LatestNodeRuntimeMap": {
|
|
702
|
+
"af-south-1": {
|
|
703
|
+
"value": "nodejs20.x"
|
|
704
|
+
},
|
|
705
|
+
"ap-east-1": {
|
|
706
|
+
"value": "nodejs20.x"
|
|
707
|
+
},
|
|
708
|
+
"ap-northeast-1": {
|
|
709
|
+
"value": "nodejs20.x"
|
|
710
|
+
},
|
|
711
|
+
"ap-northeast-2": {
|
|
712
|
+
"value": "nodejs20.x"
|
|
713
|
+
},
|
|
714
|
+
"ap-northeast-3": {
|
|
715
|
+
"value": "nodejs20.x"
|
|
716
|
+
},
|
|
717
|
+
"ap-south-1": {
|
|
718
|
+
"value": "nodejs20.x"
|
|
719
|
+
},
|
|
720
|
+
"ap-south-2": {
|
|
721
|
+
"value": "nodejs20.x"
|
|
722
|
+
},
|
|
723
|
+
"ap-southeast-1": {
|
|
724
|
+
"value": "nodejs20.x"
|
|
725
|
+
},
|
|
726
|
+
"ap-southeast-2": {
|
|
727
|
+
"value": "nodejs20.x"
|
|
728
|
+
},
|
|
729
|
+
"ap-southeast-3": {
|
|
730
|
+
"value": "nodejs20.x"
|
|
731
|
+
},
|
|
732
|
+
"ap-southeast-4": {
|
|
733
|
+
"value": "nodejs20.x"
|
|
734
|
+
},
|
|
735
|
+
"ca-central-1": {
|
|
736
|
+
"value": "nodejs20.x"
|
|
737
|
+
},
|
|
738
|
+
"cn-north-1": {
|
|
739
|
+
"value": "nodejs18.x"
|
|
740
|
+
},
|
|
741
|
+
"cn-northwest-1": {
|
|
742
|
+
"value": "nodejs18.x"
|
|
743
|
+
},
|
|
744
|
+
"eu-central-1": {
|
|
745
|
+
"value": "nodejs20.x"
|
|
746
|
+
},
|
|
747
|
+
"eu-central-2": {
|
|
748
|
+
"value": "nodejs20.x"
|
|
749
|
+
},
|
|
750
|
+
"eu-north-1": {
|
|
751
|
+
"value": "nodejs20.x"
|
|
752
|
+
},
|
|
753
|
+
"eu-south-1": {
|
|
754
|
+
"value": "nodejs20.x"
|
|
755
|
+
},
|
|
756
|
+
"eu-south-2": {
|
|
757
|
+
"value": "nodejs20.x"
|
|
758
|
+
},
|
|
759
|
+
"eu-west-1": {
|
|
760
|
+
"value": "nodejs20.x"
|
|
761
|
+
},
|
|
762
|
+
"eu-west-2": {
|
|
763
|
+
"value": "nodejs20.x"
|
|
764
|
+
},
|
|
765
|
+
"eu-west-3": {
|
|
766
|
+
"value": "nodejs20.x"
|
|
767
|
+
},
|
|
768
|
+
"il-central-1": {
|
|
769
|
+
"value": "nodejs20.x"
|
|
770
|
+
},
|
|
771
|
+
"me-central-1": {
|
|
772
|
+
"value": "nodejs20.x"
|
|
773
|
+
},
|
|
774
|
+
"me-south-1": {
|
|
775
|
+
"value": "nodejs20.x"
|
|
776
|
+
},
|
|
777
|
+
"sa-east-1": {
|
|
778
|
+
"value": "nodejs20.x"
|
|
779
|
+
},
|
|
780
|
+
"us-east-1": {
|
|
781
|
+
"value": "nodejs20.x"
|
|
782
|
+
},
|
|
783
|
+
"us-east-2": {
|
|
784
|
+
"value": "nodejs20.x"
|
|
785
|
+
},
|
|
786
|
+
"us-gov-east-1": {
|
|
787
|
+
"value": "nodejs18.x"
|
|
788
|
+
},
|
|
789
|
+
"us-gov-west-1": {
|
|
790
|
+
"value": "nodejs18.x"
|
|
791
|
+
},
|
|
792
|
+
"us-iso-east-1": {
|
|
793
|
+
"value": "nodejs18.x"
|
|
794
|
+
},
|
|
795
|
+
"us-iso-west-1": {
|
|
796
|
+
"value": "nodejs18.x"
|
|
797
|
+
},
|
|
798
|
+
"us-isob-east-1": {
|
|
799
|
+
"value": "nodejs18.x"
|
|
800
|
+
},
|
|
801
|
+
"us-west-1": {
|
|
802
|
+
"value": "nodejs20.x"
|
|
803
|
+
},
|
|
804
|
+
"us-west-2": {
|
|
805
|
+
"value": "nodejs20.x"
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
},
|
|
692
809
|
"Parameters": {
|
|
693
810
|
"BootstrapVersion": {
|
|
694
811
|
"Type": "AWS::SSM::Parameter::Value<String>",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"validateOnSynth": false,
|
|
67
67
|
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
|
|
68
68
|
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
|
|
69
|
-
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/
|
|
69
|
+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/d2223c3158e5b4a83d5429fd9d8bb998cfcb32c3fc10ec7e016d9b60cff0827d.json",
|
|
70
70
|
"requiresBootstrapStackVersion": 6,
|
|
71
71
|
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
|
|
72
72
|
"additionalDependencies": [
|
|
@@ -202,6 +202,12 @@
|
|
|
202
202
|
"data": "VpcFlowLog8FF33A73"
|
|
203
203
|
}
|
|
204
204
|
],
|
|
205
|
+
"/lammem-withClientProps/LatestNodeRuntimeMap": [
|
|
206
|
+
{
|
|
207
|
+
"type": "aws:cdk:logicalId",
|
|
208
|
+
"data": "LatestNodeRuntimeMap"
|
|
209
|
+
}
|
|
210
|
+
],
|
|
205
211
|
"/lammem-withClientProps/Custom::VpcRestrictDefaultSGCustomResourceProvider/Role": [
|
|
206
212
|
{
|
|
207
213
|
"type": "aws:cdk:logicalId",
|