@aws-solutions-constructs/aws-lambda-secretsmanager 2.60.0 → 2.62.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 +19 -6
- package/lib/index.js +1 -1
- package/package.json +6 -6
- package/test/integ.lamsec-deployFunction.js +3 -2
- package/test/integ.lamsec-deployFunction.js.snapshot/lamsec-deployFunction.assets.json +2 -2
- package/test/integ.lamsec-deployFunction.js.snapshot/lamsec-deployFunction.template.json +1 -1
- package/test/integ.lamsec-deployFunction.js.snapshot/manifest.json +1 -1
- package/test/integ.lamsec-deployFunction.js.snapshot/tree.json +25 -25
- package/test/integ.lamsec-deployFunctionWithExistingVpc.js +2 -2
- package/test/integ.lamsec-deployFunctionWithExistingVpc.js.snapshot/{asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e → asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a}/__entrypoint__.js +1 -1
- package/test/integ.lamsec-deployFunctionWithExistingVpc.js.snapshot/lamsec-deployFunctionWithExistingVpc.assets.json +5 -5
- package/test/integ.lamsec-deployFunctionWithExistingVpc.js.snapshot/lamsec-deployFunctionWithExistingVpc.template.json +120 -3
- package/test/integ.lamsec-deployFunctionWithExistingVpc.js.snapshot/manifest.json +7 -1
- package/test/integ.lamsec-deployFunctionWithExistingVpc.js.snapshot/tree.json +84 -76
- package/test/integ.lamsec-deployFunctionWithVpc.js +4 -3
- package/test/integ.lamsec-deployFunctionWithVpc.js.snapshot/{asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e → asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a}/__entrypoint__.js +1 -1
- package/test/integ.lamsec-deployFunctionWithVpc.js.snapshot/lamsec-deployFunctionWithVpc.assets.json +5 -5
- package/test/integ.lamsec-deployFunctionWithVpc.js.snapshot/lamsec-deployFunctionWithVpc.template.json +120 -3
- package/test/integ.lamsec-deployFunctionWithVpc.js.snapshot/manifest.json +7 -1
- package/test/integ.lamsec-deployFunctionWithVpc.js.snapshot/tree.json +64 -56
- package/test/integ.lamsec-existingFunction.js +2 -2
- package/test/integ.lamsec-existingFunction.js.snapshot/lamsec-existingFunction.assets.json +2 -2
- package/test/integ.lamsec-existingFunction.js.snapshot/lamsec-existingFunction.template.json +1 -1
- package/test/integ.lamsec-existingFunction.js.snapshot/manifest.json +1 -1
- package/test/integ.lamsec-existingFunction.js.snapshot/tree.json +25 -25
- package/test/lambda-secretsmanager.test.js +17 -17
- /package/test/integ.lamsec-deployFunctionWithExistingVpc.js.snapshot/{asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e → asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a}/index.js +0 -0
- /package/test/integ.lamsec-deployFunctionWithVpc.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))}
|
package/test/integ.lamsec-deployFunctionWithVpc.js.snapshot/lamsec-deployFunctionWithVpc.assets.json
CHANGED
|
@@ -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
|
+
"6aa89e59ba64067219537ccf116444dda70ccd298eaa7fe42169df80bdc01254": {
|
|
31
31
|
"source": {
|
|
32
32
|
"path": "lamsec-deployFunctionWithVpc.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": "6aa89e59ba64067219537ccf116444dda70ccd298eaa7fe42169df80bdc01254.json",
|
|
39
39
|
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
"Arn"
|
|
160
160
|
]
|
|
161
161
|
},
|
|
162
|
-
"Runtime": "
|
|
162
|
+
"Runtime": "nodejs20.x",
|
|
163
163
|
"TracingConfig": {
|
|
164
164
|
"Mode": "Active"
|
|
165
165
|
},
|
|
@@ -603,7 +603,7 @@
|
|
|
603
603
|
"S3Bucket": {
|
|
604
604
|
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
|
|
605
605
|
},
|
|
606
|
-
"S3Key": "
|
|
606
|
+
"S3Key": "ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a.zip"
|
|
607
607
|
},
|
|
608
608
|
"Timeout": 900,
|
|
609
609
|
"MemorySize": 128,
|
|
@@ -614,7 +614,15 @@
|
|
|
614
614
|
"Arn"
|
|
615
615
|
]
|
|
616
616
|
},
|
|
617
|
-
"Runtime":
|
|
617
|
+
"Runtime": {
|
|
618
|
+
"Fn::FindInMap": [
|
|
619
|
+
"LatestNodeRuntimeMap",
|
|
620
|
+
{
|
|
621
|
+
"Ref": "AWS::Region"
|
|
622
|
+
},
|
|
623
|
+
"value"
|
|
624
|
+
]
|
|
625
|
+
},
|
|
618
626
|
"Description": "Lambda function for removing all inbound/outbound rules from the VPC default security group"
|
|
619
627
|
},
|
|
620
628
|
"DependsOn": [
|
|
@@ -698,6 +706,115 @@
|
|
|
698
706
|
}
|
|
699
707
|
}
|
|
700
708
|
},
|
|
709
|
+
"Mappings": {
|
|
710
|
+
"LatestNodeRuntimeMap": {
|
|
711
|
+
"af-south-1": {
|
|
712
|
+
"value": "nodejs20.x"
|
|
713
|
+
},
|
|
714
|
+
"ap-east-1": {
|
|
715
|
+
"value": "nodejs20.x"
|
|
716
|
+
},
|
|
717
|
+
"ap-northeast-1": {
|
|
718
|
+
"value": "nodejs20.x"
|
|
719
|
+
},
|
|
720
|
+
"ap-northeast-2": {
|
|
721
|
+
"value": "nodejs20.x"
|
|
722
|
+
},
|
|
723
|
+
"ap-northeast-3": {
|
|
724
|
+
"value": "nodejs20.x"
|
|
725
|
+
},
|
|
726
|
+
"ap-south-1": {
|
|
727
|
+
"value": "nodejs20.x"
|
|
728
|
+
},
|
|
729
|
+
"ap-south-2": {
|
|
730
|
+
"value": "nodejs20.x"
|
|
731
|
+
},
|
|
732
|
+
"ap-southeast-1": {
|
|
733
|
+
"value": "nodejs20.x"
|
|
734
|
+
},
|
|
735
|
+
"ap-southeast-2": {
|
|
736
|
+
"value": "nodejs20.x"
|
|
737
|
+
},
|
|
738
|
+
"ap-southeast-3": {
|
|
739
|
+
"value": "nodejs20.x"
|
|
740
|
+
},
|
|
741
|
+
"ap-southeast-4": {
|
|
742
|
+
"value": "nodejs20.x"
|
|
743
|
+
},
|
|
744
|
+
"ca-central-1": {
|
|
745
|
+
"value": "nodejs20.x"
|
|
746
|
+
},
|
|
747
|
+
"cn-north-1": {
|
|
748
|
+
"value": "nodejs18.x"
|
|
749
|
+
},
|
|
750
|
+
"cn-northwest-1": {
|
|
751
|
+
"value": "nodejs18.x"
|
|
752
|
+
},
|
|
753
|
+
"eu-central-1": {
|
|
754
|
+
"value": "nodejs20.x"
|
|
755
|
+
},
|
|
756
|
+
"eu-central-2": {
|
|
757
|
+
"value": "nodejs20.x"
|
|
758
|
+
},
|
|
759
|
+
"eu-north-1": {
|
|
760
|
+
"value": "nodejs20.x"
|
|
761
|
+
},
|
|
762
|
+
"eu-south-1": {
|
|
763
|
+
"value": "nodejs20.x"
|
|
764
|
+
},
|
|
765
|
+
"eu-south-2": {
|
|
766
|
+
"value": "nodejs20.x"
|
|
767
|
+
},
|
|
768
|
+
"eu-west-1": {
|
|
769
|
+
"value": "nodejs20.x"
|
|
770
|
+
},
|
|
771
|
+
"eu-west-2": {
|
|
772
|
+
"value": "nodejs20.x"
|
|
773
|
+
},
|
|
774
|
+
"eu-west-3": {
|
|
775
|
+
"value": "nodejs20.x"
|
|
776
|
+
},
|
|
777
|
+
"il-central-1": {
|
|
778
|
+
"value": "nodejs20.x"
|
|
779
|
+
},
|
|
780
|
+
"me-central-1": {
|
|
781
|
+
"value": "nodejs20.x"
|
|
782
|
+
},
|
|
783
|
+
"me-south-1": {
|
|
784
|
+
"value": "nodejs20.x"
|
|
785
|
+
},
|
|
786
|
+
"sa-east-1": {
|
|
787
|
+
"value": "nodejs20.x"
|
|
788
|
+
},
|
|
789
|
+
"us-east-1": {
|
|
790
|
+
"value": "nodejs20.x"
|
|
791
|
+
},
|
|
792
|
+
"us-east-2": {
|
|
793
|
+
"value": "nodejs20.x"
|
|
794
|
+
},
|
|
795
|
+
"us-gov-east-1": {
|
|
796
|
+
"value": "nodejs18.x"
|
|
797
|
+
},
|
|
798
|
+
"us-gov-west-1": {
|
|
799
|
+
"value": "nodejs18.x"
|
|
800
|
+
},
|
|
801
|
+
"us-iso-east-1": {
|
|
802
|
+
"value": "nodejs18.x"
|
|
803
|
+
},
|
|
804
|
+
"us-iso-west-1": {
|
|
805
|
+
"value": "nodejs18.x"
|
|
806
|
+
},
|
|
807
|
+
"us-isob-east-1": {
|
|
808
|
+
"value": "nodejs18.x"
|
|
809
|
+
},
|
|
810
|
+
"us-west-1": {
|
|
811
|
+
"value": "nodejs20.x"
|
|
812
|
+
},
|
|
813
|
+
"us-west-2": {
|
|
814
|
+
"value": "nodejs20.x"
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
},
|
|
701
818
|
"Parameters": {
|
|
702
819
|
"BootstrapVersion": {
|
|
703
820
|
"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}/6aa89e59ba64067219537ccf116444dda70ccd298eaa7fe42169df80bdc01254.json",
|
|
70
70
|
"requiresBootstrapStackVersion": 6,
|
|
71
71
|
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
|
|
72
72
|
"additionalDependencies": [
|
|
@@ -190,6 +190,12 @@
|
|
|
190
190
|
"data": "VpcSECRETSMANAGERF52907C2"
|
|
191
191
|
}
|
|
192
192
|
],
|
|
193
|
+
"/lamsec-deployFunctionWithVpc/LatestNodeRuntimeMap": [
|
|
194
|
+
{
|
|
195
|
+
"type": "aws:cdk:logicalId",
|
|
196
|
+
"data": "LatestNodeRuntimeMap"
|
|
197
|
+
}
|
|
198
|
+
],
|
|
193
199
|
"/lamsec-deployFunctionWithVpc/Custom::VpcRestrictDefaultSGCustomResourceProvider/Role": [
|
|
194
200
|
{
|
|
195
201
|
"type": "aws:cdk:logicalId",
|