@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.
Files changed (63) hide show
  1. package/.jsii +43 -4
  2. package/lib/index.js +1 -1
  3. package/package.json +7 -7
  4. package/test/integ.alblam-privateApiExistingResources.js.snapshot/alblam-privateApiExistingResources.assets.json +9 -9
  5. package/test/integ.alblam-privateApiExistingResources.js.snapshot/alblam-privateApiExistingResources.template.json +33 -5
  6. package/test/integ.alblam-privateApiExistingResources.js.snapshot/alblamprivateApiExistingResourcesIntegDefaultTestDeployAssertC865AE59.assets.json +1 -1
  7. package/test/integ.alblam-privateApiExistingResources.js.snapshot/asset.44065ab998484f0809423b22009edee6d159633b21d16657230931448f4bec08/index.js +21 -0
  8. package/test/integ.alblam-privateApiExistingResources.js.snapshot/asset.7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200/__entrypoint__.js +1 -0
  9. package/test/integ.alblam-privateApiExistingResources.js.snapshot/cdk.out +1 -1
  10. package/test/integ.alblam-privateApiExistingResources.js.snapshot/integ.json +1 -1
  11. package/test/integ.alblam-privateApiExistingResources.js.snapshot/manifest.json +505 -3
  12. package/test/integ.alblam-privateApiExistingResources.js.snapshot/tree.json +1 -1708
  13. package/test/integ.alblam-privateApiNewResources.js.snapshot/alblam-privateApiNewResources.assets.json +9 -9
  14. package/test/integ.alblam-privateApiNewResources.js.snapshot/alblam-privateApiNewResources.template.json +31 -5
  15. package/test/integ.alblam-privateApiNewResources.js.snapshot/alblamprivateApiNewResourcesIntegDefaultTestDeployAssertB0CCE59F.assets.json +1 -1
  16. package/test/integ.alblam-privateApiNewResources.js.snapshot/asset.44065ab998484f0809423b22009edee6d159633b21d16657230931448f4bec08/index.js +21 -0
  17. package/test/integ.alblam-privateApiNewResources.js.snapshot/asset.7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200/__entrypoint__.js +1 -0
  18. package/test/integ.alblam-privateApiNewResources.js.snapshot/cdk.out +1 -1
  19. package/test/integ.alblam-privateApiNewResources.js.snapshot/integ.json +1 -1
  20. package/test/integ.alblam-privateApiNewResources.js.snapshot/manifest.json +432 -3
  21. package/test/integ.alblam-privateApiNewResources.js.snapshot/tree.json +1 -1294
  22. package/test/integ.alblam-publicApiExistingResources.js.snapshot/alblam-publicApiExistingResources.assets.json +9 -9
  23. package/test/integ.alblam-publicApiExistingResources.js.snapshot/alblam-publicApiExistingResources.template.json +33 -5
  24. package/test/integ.alblam-publicApiExistingResources.js.snapshot/alblampublicApiExistingResourcesIntegDefaultTestDeployAssert22C8EEFD.assets.json +1 -1
  25. package/test/integ.alblam-publicApiExistingResources.js.snapshot/asset.44065ab998484f0809423b22009edee6d159633b21d16657230931448f4bec08/index.js +21 -0
  26. package/test/integ.alblam-publicApiExistingResources.js.snapshot/asset.7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200/__entrypoint__.js +1 -0
  27. package/test/integ.alblam-publicApiExistingResources.js.snapshot/cdk.out +1 -1
  28. package/test/integ.alblam-publicApiExistingResources.js.snapshot/integ.json +1 -1
  29. package/test/integ.alblam-publicApiExistingResources.js.snapshot/manifest.json +505 -3
  30. package/test/integ.alblam-publicApiExistingResources.js.snapshot/tree.json +1 -1708
  31. package/test/integ.alblam-publicApiNewResources.js.snapshot/alblam-publicApiNewResources.assets.json +9 -9
  32. package/test/integ.alblam-publicApiNewResources.js.snapshot/alblam-publicApiNewResources.template.json +33 -5
  33. package/test/integ.alblam-publicApiNewResources.js.snapshot/alblampublicApiNewResourcesIntegDefaultTestDeployAssert43CC63D2.assets.json +1 -1
  34. package/test/integ.alblam-publicApiNewResources.js.snapshot/asset.44065ab998484f0809423b22009edee6d159633b21d16657230931448f4bec08/index.js +21 -0
  35. package/test/integ.alblam-publicApiNewResources.js.snapshot/asset.7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200/__entrypoint__.js +1 -0
  36. package/test/integ.alblam-publicApiNewResources.js.snapshot/cdk.out +1 -1
  37. package/test/integ.alblam-publicApiNewResources.js.snapshot/integ.json +1 -1
  38. package/test/integ.alblam-publicApiNewResources.js.snapshot/manifest.json +501 -3
  39. package/test/integ.alblam-publicApiNewResources.js.snapshot/tree.json +1 -1706
  40. package/test/integ.alblam-twoTargets.js.snapshot/alblam-twoTargets.assets.json +9 -9
  41. package/test/integ.alblam-twoTargets.js.snapshot/alblam-twoTargets.template.json +65 -9
  42. package/test/integ.alblam-twoTargets.js.snapshot/alblamtwoTargetsIntegDefaultTestDeployAssert4F811416.assets.json +1 -1
  43. package/test/integ.alblam-twoTargets.js.snapshot/asset.44065ab998484f0809423b22009edee6d159633b21d16657230931448f4bec08/index.js +21 -0
  44. package/test/integ.alblam-twoTargets.js.snapshot/asset.7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200/__entrypoint__.js +1 -0
  45. package/test/integ.alblam-twoTargets.js.snapshot/cdk.out +1 -1
  46. package/test/integ.alblam-twoTargets.js.snapshot/integ.json +1 -1
  47. package/test/integ.alblam-twoTargets.js.snapshot/manifest.json +676 -3
  48. package/test/integ.alblam-twoTargets.js.snapshot/tree.json +1 -2067
  49. package/test/integ.alblam-privateApiExistingResources.js.snapshot/asset.7caf594b8ad91abecca72f7f10a23a5cf446d05dc00d6194619935e7e3fd5a79/index.js +0 -8
  50. package/test/integ.alblam-privateApiExistingResources.js.snapshot/asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a/__entrypoint__.js +0 -1
  51. package/test/integ.alblam-privateApiNewResources.js.snapshot/asset.7caf594b8ad91abecca72f7f10a23a5cf446d05dc00d6194619935e7e3fd5a79/index.js +0 -8
  52. package/test/integ.alblam-privateApiNewResources.js.snapshot/asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a/__entrypoint__.js +0 -1
  53. package/test/integ.alblam-publicApiExistingResources.js.snapshot/asset.7caf594b8ad91abecca72f7f10a23a5cf446d05dc00d6194619935e7e3fd5a79/index.js +0 -8
  54. package/test/integ.alblam-publicApiExistingResources.js.snapshot/asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a/__entrypoint__.js +0 -1
  55. package/test/integ.alblam-publicApiNewResources.js.snapshot/asset.7caf594b8ad91abecca72f7f10a23a5cf446d05dc00d6194619935e7e3fd5a79/index.js +0 -8
  56. package/test/integ.alblam-publicApiNewResources.js.snapshot/asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a/__entrypoint__.js +0 -1
  57. package/test/integ.alblam-twoTargets.js.snapshot/asset.7caf594b8ad91abecca72f7f10a23a5cf446d05dc00d6194619935e7e3fd5a79/index.js +0 -8
  58. package/test/integ.alblam-twoTargets.js.snapshot/asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a/__entrypoint__.js +0 -1
  59. /package/test/integ.alblam-privateApiExistingResources.js.snapshot/{asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a → asset.7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200}/index.js +0 -0
  60. /package/test/integ.alblam-privateApiNewResources.js.snapshot/{asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a → asset.7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200}/index.js +0 -0
  61. /package/test/integ.alblam-publicApiExistingResources.js.snapshot/{asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a → asset.7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200}/index.js +0 -0
  62. /package/test/integ.alblam-publicApiNewResources.js.snapshot/{asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a → asset.7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200}/index.js +0 -0
  63. /package/test/integ.alblam-twoTargets.js.snapshot/{asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a → asset.7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200}/index.js +0 -0
@@ -1,15 +1,15 @@
1
1
  {
2
- "version": "36.0.0",
2
+ "version": "40.0.0",
3
3
  "files": {
4
- "ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a": {
4
+ "7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200": {
5
5
  "source": {
6
- "path": "asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a",
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": "ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a.zip",
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
  }
@@ -29,21 +29,21 @@
29
29
  }
30
30
  }
31
31
  },
32
- "7caf594b8ad91abecca72f7f10a23a5cf446d05dc00d6194619935e7e3fd5a79": {
32
+ "44065ab998484f0809423b22009edee6d159633b21d16657230931448f4bec08": {
33
33
  "source": {
34
- "path": "asset.7caf594b8ad91abecca72f7f10a23a5cf446d05dc00d6194619935e7e3fd5a79",
34
+ "path": "asset.44065ab998484f0809423b22009edee6d159633b21d16657230931448f4bec08",
35
35
  "packaging": "zip"
36
36
  },
37
37
  "destinations": {
38
38
  "current_account-us-east-1": {
39
39
  "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1",
40
- "objectKey": "7caf594b8ad91abecca72f7f10a23a5cf446d05dc00d6194619935e7e3fd5a79.zip",
40
+ "objectKey": "44065ab998484f0809423b22009edee6d159633b21d16657230931448f4bec08.zip",
41
41
  "region": "us-east-1",
42
42
  "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-us-east-1"
43
43
  }
44
44
  }
45
45
  },
46
- "e52542be646d6f7bda49aee4b8a52a884191e0522ebeca044993584e64738959": {
46
+ "3c84d6901d177dd45f6bec66792cfda609f744e57d78d42f050939e5864facf0": {
47
47
  "source": {
48
48
  "path": "alblam-publicApiNewResources.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": "e52542be646d6f7bda49aee4b8a52a884191e0522ebeca044993584e64738959.json",
54
+ "objectKey": "3c84d6901d177dd45f6bec66792cfda609f744e57d78d42f050939e5864facf0.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
  }
@@ -383,9 +383,7 @@
383
383
  "ec2:CreateNetworkInterface",
384
384
  "ec2:DeleteNetworkInterface",
385
385
  "ec2:DescribeNetworkInterfaces",
386
- "ec2:UnassignPrivateIpAddresses",
387
- "xray:PutTelemetryRecords",
388
- "xray:PutTraceSegments"
386
+ "ec2:UnassignPrivateIpAddresses"
389
387
  ],
390
388
  "Effect": "Allow",
391
389
  "Resource": "*"
@@ -448,7 +446,7 @@
448
446
  "S3Bucket": {
449
447
  "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1"
450
448
  },
451
- "S3Key": "7caf594b8ad91abecca72f7f10a23a5cf446d05dc00d6194619935e7e3fd5a79.zip"
449
+ "S3Key": "44065ab998484f0809423b22009edee6d159633b21d16657230931448f4bec08.zip"
452
450
  },
453
451
  "Environment": {
454
452
  "Variables": {
@@ -512,6 +510,36 @@
512
510
  }
513
511
  }
514
512
  },
513
+ "testoneLambdaFunctioninlinePolicyAddedToExecutionRole028251896": {
514
+ "Type": "AWS::IAM::Policy",
515
+ "Properties": {
516
+ "PolicyDocument": {
517
+ "Statement": [
518
+ {
519
+ "Action": [
520
+ "xray:PutTelemetryRecords",
521
+ "xray:PutTraceSegments"
522
+ ],
523
+ "Effect": "Allow",
524
+ "Resource": "*"
525
+ }
526
+ ],
527
+ "Version": "2012-10-17"
528
+ },
529
+ "PolicyName": "testoneLambdaFunctioninlinePolicyAddedToExecutionRole028251896",
530
+ "Roles": [
531
+ {
532
+ "Ref": "testoneLambdaFunctionServiceRoleE92573D3"
533
+ }
534
+ ]
535
+ },
536
+ "DependsOn": [
537
+ "VpcPrivateSubnet1DefaultRouteBE02A9ED",
538
+ "VpcPrivateSubnet1RouteTableAssociation70C59FA6",
539
+ "VpcPrivateSubnet2DefaultRoute060D2087",
540
+ "VpcPrivateSubnet2RouteTableAssociationA89CAD56"
541
+ ]
542
+ },
515
543
  "testoneLambdaFunctionInvoke2UTWxhlfyqbT5FTn5jvgbLgjFfJwzswGk55DU1HY508A8518": {
516
544
  "Type": "AWS::Lambda::Permission",
517
545
  "Properties": {
@@ -1205,7 +1233,7 @@
1205
1233
  "S3Bucket": {
1206
1234
  "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1"
1207
1235
  },
1208
- "S3Key": "ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a.zip"
1236
+ "S3Key": "7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200.zip"
1209
1237
  },
1210
1238
  "Timeout": 900,
1211
1239
  "MemorySize": 128,
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "36.0.0",
2
+ "version": "40.0.0",
3
3
  "files": {
4
4
  "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": {
5
5
  "source": {
@@ -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":"36.0.0"}
1
+ {"version":"40.0.0"}
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "36.0.0",
2
+ "version": "40.0.0",
3
3
  "testCases": {
4
4
  "alblam-publicApiNewResources/Integ/DefaultTest": {
5
5
  "stacks": [