@aws-solutions-constructs/aws-alb-lambda 2.80.0 → 2.81.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 +43 -4
- package/lib/index.js +1 -1
- package/package.json +7 -7
- package/test/integ.alblam-privateApiExistingResources.js.snapshot/alblam-privateApiExistingResources.assets.json +9 -9
- package/test/integ.alblam-privateApiExistingResources.js.snapshot/alblam-privateApiExistingResources.template.json +33 -5
- package/test/integ.alblam-privateApiExistingResources.js.snapshot/alblamprivateApiExistingResourcesIntegDefaultTestDeployAssertC865AE59.assets.json +1 -1
- package/test/integ.alblam-privateApiExistingResources.js.snapshot/asset.44065ab998484f0809423b22009edee6d159633b21d16657230931448f4bec08/index.js +21 -0
- package/test/integ.alblam-privateApiExistingResources.js.snapshot/asset.7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200/__entrypoint__.js +1 -0
- package/test/integ.alblam-privateApiExistingResources.js.snapshot/cdk.out +1 -1
- package/test/integ.alblam-privateApiExistingResources.js.snapshot/integ.json +1 -1
- package/test/integ.alblam-privateApiExistingResources.js.snapshot/manifest.json +505 -3
- package/test/integ.alblam-privateApiExistingResources.js.snapshot/tree.json +1 -1708
- package/test/integ.alblam-privateApiNewResources.js.snapshot/alblam-privateApiNewResources.assets.json +9 -9
- package/test/integ.alblam-privateApiNewResources.js.snapshot/alblam-privateApiNewResources.template.json +31 -5
- package/test/integ.alblam-privateApiNewResources.js.snapshot/alblamprivateApiNewResourcesIntegDefaultTestDeployAssertB0CCE59F.assets.json +1 -1
- package/test/integ.alblam-privateApiNewResources.js.snapshot/asset.44065ab998484f0809423b22009edee6d159633b21d16657230931448f4bec08/index.js +21 -0
- package/test/integ.alblam-privateApiNewResources.js.snapshot/asset.7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200/__entrypoint__.js +1 -0
- package/test/integ.alblam-privateApiNewResources.js.snapshot/cdk.out +1 -1
- package/test/integ.alblam-privateApiNewResources.js.snapshot/integ.json +1 -1
- package/test/integ.alblam-privateApiNewResources.js.snapshot/manifest.json +432 -3
- package/test/integ.alblam-privateApiNewResources.js.snapshot/tree.json +1 -1294
- package/test/integ.alblam-publicApiExistingResources.js.snapshot/alblam-publicApiExistingResources.assets.json +9 -9
- package/test/integ.alblam-publicApiExistingResources.js.snapshot/alblam-publicApiExistingResources.template.json +33 -5
- package/test/integ.alblam-publicApiExistingResources.js.snapshot/alblampublicApiExistingResourcesIntegDefaultTestDeployAssert22C8EEFD.assets.json +1 -1
- package/test/integ.alblam-publicApiExistingResources.js.snapshot/asset.44065ab998484f0809423b22009edee6d159633b21d16657230931448f4bec08/index.js +21 -0
- package/test/integ.alblam-publicApiExistingResources.js.snapshot/asset.7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200/__entrypoint__.js +1 -0
- package/test/integ.alblam-publicApiExistingResources.js.snapshot/cdk.out +1 -1
- package/test/integ.alblam-publicApiExistingResources.js.snapshot/integ.json +1 -1
- package/test/integ.alblam-publicApiExistingResources.js.snapshot/manifest.json +505 -3
- package/test/integ.alblam-publicApiExistingResources.js.snapshot/tree.json +1 -1708
- package/test/integ.alblam-publicApiNewResources.js.snapshot/alblam-publicApiNewResources.assets.json +9 -9
- package/test/integ.alblam-publicApiNewResources.js.snapshot/alblam-publicApiNewResources.template.json +33 -5
- package/test/integ.alblam-publicApiNewResources.js.snapshot/alblampublicApiNewResourcesIntegDefaultTestDeployAssert43CC63D2.assets.json +1 -1
- package/test/integ.alblam-publicApiNewResources.js.snapshot/asset.44065ab998484f0809423b22009edee6d159633b21d16657230931448f4bec08/index.js +21 -0
- package/test/integ.alblam-publicApiNewResources.js.snapshot/asset.7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200/__entrypoint__.js +1 -0
- package/test/integ.alblam-publicApiNewResources.js.snapshot/cdk.out +1 -1
- package/test/integ.alblam-publicApiNewResources.js.snapshot/integ.json +1 -1
- package/test/integ.alblam-publicApiNewResources.js.snapshot/manifest.json +501 -3
- package/test/integ.alblam-publicApiNewResources.js.snapshot/tree.json +1 -1706
- package/test/integ.alblam-twoTargets.js.snapshot/alblam-twoTargets.assets.json +9 -9
- package/test/integ.alblam-twoTargets.js.snapshot/alblam-twoTargets.template.json +65 -9
- package/test/integ.alblam-twoTargets.js.snapshot/alblamtwoTargetsIntegDefaultTestDeployAssert4F811416.assets.json +1 -1
- package/test/integ.alblam-twoTargets.js.snapshot/asset.44065ab998484f0809423b22009edee6d159633b21d16657230931448f4bec08/index.js +21 -0
- package/test/integ.alblam-twoTargets.js.snapshot/asset.7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200/__entrypoint__.js +1 -0
- package/test/integ.alblam-twoTargets.js.snapshot/cdk.out +1 -1
- package/test/integ.alblam-twoTargets.js.snapshot/integ.json +1 -1
- package/test/integ.alblam-twoTargets.js.snapshot/manifest.json +676 -3
- package/test/integ.alblam-twoTargets.js.snapshot/tree.json +1 -2067
- package/test/integ.alblam-privateApiExistingResources.js.snapshot/asset.7caf594b8ad91abecca72f7f10a23a5cf446d05dc00d6194619935e7e3fd5a79/index.js +0 -8
- package/test/integ.alblam-privateApiExistingResources.js.snapshot/asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a/__entrypoint__.js +0 -1
- package/test/integ.alblam-privateApiNewResources.js.snapshot/asset.7caf594b8ad91abecca72f7f10a23a5cf446d05dc00d6194619935e7e3fd5a79/index.js +0 -8
- package/test/integ.alblam-privateApiNewResources.js.snapshot/asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a/__entrypoint__.js +0 -1
- package/test/integ.alblam-publicApiExistingResources.js.snapshot/asset.7caf594b8ad91abecca72f7f10a23a5cf446d05dc00d6194619935e7e3fd5a79/index.js +0 -8
- package/test/integ.alblam-publicApiExistingResources.js.snapshot/asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a/__entrypoint__.js +0 -1
- package/test/integ.alblam-publicApiNewResources.js.snapshot/asset.7caf594b8ad91abecca72f7f10a23a5cf446d05dc00d6194619935e7e3fd5a79/index.js +0 -8
- package/test/integ.alblam-publicApiNewResources.js.snapshot/asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a/__entrypoint__.js +0 -1
- package/test/integ.alblam-twoTargets.js.snapshot/asset.7caf594b8ad91abecca72f7f10a23a5cf446d05dc00d6194619935e7e3fd5a79/index.js +0 -8
- package/test/integ.alblam-twoTargets.js.snapshot/asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a/__entrypoint__.js +0 -1
- /package/test/integ.alblam-privateApiExistingResources.js.snapshot/{asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a → asset.7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200}/index.js +0 -0
- /package/test/integ.alblam-privateApiNewResources.js.snapshot/{asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a → asset.7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200}/index.js +0 -0
- /package/test/integ.alblam-publicApiExistingResources.js.snapshot/{asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a → asset.7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200}/index.js +0 -0
- /package/test/integ.alblam-publicApiNewResources.js.snapshot/{asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a → asset.7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200}/index.js +0 -0
- /package/test/integ.alblam-twoTargets.js.snapshot/{asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a → asset.7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200}/index.js +0 -0
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "
|
|
2
|
+
"version": "40.0.0",
|
|
3
3
|
"files": {
|
|
4
|
-
"
|
|
4
|
+
"7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200": {
|
|
5
5
|
"source": {
|
|
6
|
-
"path": "asset.
|
|
6
|
+
"path": "asset.7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200",
|
|
7
7
|
"packaging": "zip"
|
|
8
8
|
},
|
|
9
9
|
"destinations": {
|
|
10
10
|
"current_account-us-east-1": {
|
|
11
11
|
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1",
|
|
12
|
-
"objectKey": "
|
|
12
|
+
"objectKey": "7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200.zip",
|
|
13
13
|
"region": "us-east-1",
|
|
14
14
|
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-us-east-1"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
|
-
"
|
|
18
|
+
"44065ab998484f0809423b22009edee6d159633b21d16657230931448f4bec08": {
|
|
19
19
|
"source": {
|
|
20
|
-
"path": "asset.
|
|
20
|
+
"path": "asset.44065ab998484f0809423b22009edee6d159633b21d16657230931448f4bec08",
|
|
21
21
|
"packaging": "zip"
|
|
22
22
|
},
|
|
23
23
|
"destinations": {
|
|
24
24
|
"current_account-us-east-1": {
|
|
25
25
|
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1",
|
|
26
|
-
"objectKey": "
|
|
26
|
+
"objectKey": "44065ab998484f0809423b22009edee6d159633b21d16657230931448f4bec08.zip",
|
|
27
27
|
"region": "us-east-1",
|
|
28
28
|
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-us-east-1"
|
|
29
29
|
}
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
|
-
"
|
|
46
|
+
"249dfcc0c708325301a54217866881be2cf5b9e8d6cfefb7fff8622947a4bc05": {
|
|
47
47
|
"source": {
|
|
48
48
|
"path": "alblam-publicApiExistingResources.template.json",
|
|
49
49
|
"packaging": "file"
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"destinations": {
|
|
52
52
|
"current_account-us-east-1": {
|
|
53
53
|
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1",
|
|
54
|
-
"objectKey": "
|
|
54
|
+
"objectKey": "249dfcc0c708325301a54217866881be2cf5b9e8d6cfefb7fff8622947a4bc05.json",
|
|
55
55
|
"region": "us-east-1",
|
|
56
56
|
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-us-east-1"
|
|
57
57
|
}
|
|
@@ -620,7 +620,7 @@
|
|
|
620
620
|
"S3Bucket": {
|
|
621
621
|
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1"
|
|
622
622
|
},
|
|
623
|
-
"S3Key": "
|
|
623
|
+
"S3Key": "7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200.zip"
|
|
624
624
|
},
|
|
625
625
|
"Timeout": 900,
|
|
626
626
|
"MemorySize": 128,
|
|
@@ -757,9 +757,7 @@
|
|
|
757
757
|
"ec2:CreateNetworkInterface",
|
|
758
758
|
"ec2:DeleteNetworkInterface",
|
|
759
759
|
"ec2:DescribeNetworkInterfaces",
|
|
760
|
-
"ec2:UnassignPrivateIpAddresses"
|
|
761
|
-
"xray:PutTelemetryRecords",
|
|
762
|
-
"xray:PutTraceSegments"
|
|
760
|
+
"ec2:UnassignPrivateIpAddresses"
|
|
763
761
|
],
|
|
764
762
|
"Effect": "Allow",
|
|
765
763
|
"Resource": "*"
|
|
@@ -792,7 +790,7 @@
|
|
|
792
790
|
"S3Bucket": {
|
|
793
791
|
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1"
|
|
794
792
|
},
|
|
795
|
-
"S3Key": "
|
|
793
|
+
"S3Key": "44065ab998484f0809423b22009edee6d159633b21d16657230931448f4bec08.zip"
|
|
796
794
|
},
|
|
797
795
|
"Environment": {
|
|
798
796
|
"Variables": {
|
|
@@ -856,6 +854,36 @@
|
|
|
856
854
|
}
|
|
857
855
|
}
|
|
858
856
|
},
|
|
857
|
+
"LambdaFunctioninlinePolicyAddedToExecutionRole007875684": {
|
|
858
|
+
"Type": "AWS::IAM::Policy",
|
|
859
|
+
"Properties": {
|
|
860
|
+
"PolicyDocument": {
|
|
861
|
+
"Statement": [
|
|
862
|
+
{
|
|
863
|
+
"Action": [
|
|
864
|
+
"xray:PutTelemetryRecords",
|
|
865
|
+
"xray:PutTraceSegments"
|
|
866
|
+
],
|
|
867
|
+
"Effect": "Allow",
|
|
868
|
+
"Resource": "*"
|
|
869
|
+
}
|
|
870
|
+
],
|
|
871
|
+
"Version": "2012-10-17"
|
|
872
|
+
},
|
|
873
|
+
"PolicyName": "LambdaFunctioninlinePolicyAddedToExecutionRole007875684",
|
|
874
|
+
"Roles": [
|
|
875
|
+
{
|
|
876
|
+
"Ref": "LambdaFunctionServiceRole0C4CDE0B"
|
|
877
|
+
}
|
|
878
|
+
]
|
|
879
|
+
},
|
|
880
|
+
"DependsOn": [
|
|
881
|
+
"VpcPrivateSubnet1DefaultRouteBE02A9ED",
|
|
882
|
+
"VpcPrivateSubnet1RouteTableAssociation70C59FA6",
|
|
883
|
+
"VpcPrivateSubnet2DefaultRoute060D2087",
|
|
884
|
+
"VpcPrivateSubnet2RouteTableAssociationA89CAD56"
|
|
885
|
+
]
|
|
886
|
+
},
|
|
859
887
|
"LambdaFunctionInvoke2UTWxhlfyqbT5FTn5jvgbLgjFfJwzswGk55DU1HYAD69E89D": {
|
|
860
888
|
"Type": "AWS::Lambda::Permission",
|
|
861
889
|
"Properties": {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
|
|
5
|
+
* with the License. A copy of the License is located at
|
|
6
|
+
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
|
|
10
|
+
* OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
|
|
11
|
+
* and limitations under the License.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
exports.handler = async function (event) {
|
|
15
|
+
console.log("request:", JSON.stringify(event, undefined, 2));
|
|
16
|
+
return {
|
|
17
|
+
statusCode: 200,
|
|
18
|
+
headers: { "Content-Type": "text/plain" },
|
|
19
|
+
body: `Hello, CDK! You've hit ${event.path}\n`,
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.external=void 0,exports.handler=handler,exports.withRetries=withRetries;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)}}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}}}async function sleep(ms){return new Promise(ok=>setTimeout(ok,ms))}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"
|
|
1
|
+
{"version":"40.0.0"}
|