@aws-solutions-constructs/aws-cloudfront-apigateway-lambda 2.79.1 → 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 (44) hide show
  1. package/.jsii +76 -58
  2. package/lib/index.d.ts +7 -0
  3. package/lib/index.js +4 -3
  4. package/package.json +8 -8
  5. package/test/integ.cftaplam-customCloudfrontLoggingBucket.js.snapshot/asset.3a18fd3de4803f72260a058823accffd4f8d69986c6862a23cd86265f6cafa0f/index.js +23 -0
  6. package/test/integ.cftaplam-customCloudfrontLoggingBucket.js.snapshot/cdk.out +1 -1
  7. package/test/integ.cftaplam-customCloudfrontLoggingBucket.js.snapshot/cftaplam-customCloudfrontLoggingBucket.assets.json +6 -6
  8. package/test/integ.cftaplam-customCloudfrontLoggingBucket.js.snapshot/cftaplam-customCloudfrontLoggingBucket.template.json +30 -41
  9. package/test/integ.cftaplam-customCloudfrontLoggingBucket.js.snapshot/cftaplamcustomCloudfrontLoggingBucketIntegDefaultTestDeployAssert35A683E0.assets.json +1 -1
  10. package/test/integ.cftaplam-customCloudfrontLoggingBucket.js.snapshot/integ.json +1 -1
  11. package/test/integ.cftaplam-customCloudfrontLoggingBucket.js.snapshot/manifest.json +429 -6
  12. package/test/integ.cftaplam-customCloudfrontLoggingBucket.js.snapshot/tree.json +1 -1713
  13. package/test/integ.cftaplam-no-arguments.js.snapshot/asset.3a18fd3de4803f72260a058823accffd4f8d69986c6862a23cd86265f6cafa0f/index.js +23 -0
  14. package/test/integ.cftaplam-no-arguments.js.snapshot/cdk.out +1 -1
  15. package/test/integ.cftaplam-no-arguments.js.snapshot/cftaplam-no-arguments.assets.json +6 -6
  16. package/test/integ.cftaplam-no-arguments.js.snapshot/cftaplam-no-arguments.template.json +30 -41
  17. package/test/integ.cftaplam-no-arguments.js.snapshot/cftaplamnoargumentsIntegDefaultTestDeployAssertACC32F59.assets.json +1 -1
  18. package/test/integ.cftaplam-no-arguments.js.snapshot/integ.json +1 -1
  19. package/test/integ.cftaplam-no-arguments.js.snapshot/manifest.json +429 -6
  20. package/test/integ.cftaplam-no-arguments.js.snapshot/tree.json +1 -1713
  21. package/test/integ.cftaplam-no-usage-plan.d.ts +13 -0
  22. package/test/integ.cftaplam-no-usage-plan.js +50 -0
  23. package/test/integ.cftaplam-no-usage-plan.js.snapshot/asset.3a18fd3de4803f72260a058823accffd4f8d69986c6862a23cd86265f6cafa0f/index.js +23 -0
  24. package/test/integ.cftaplam-no-usage-plan.js.snapshot/asset.faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6/index.js +1 -0
  25. package/test/integ.cftaplam-no-usage-plan.js.snapshot/cdk.out +1 -0
  26. package/test/integ.cftaplam-no-usage-plan.js.snapshot/cftaplam-no-usage-plan.assets.json +45 -0
  27. package/test/integ.cftaplam-no-usage-plan.js.snapshot/cftaplam-no-usage-plan.template.json +1403 -0
  28. package/test/integ.cftaplam-no-usage-plan.js.snapshot/cftaplamnousageplanIntegDefaultTestDeployAssertABA4F4C5.assets.json +19 -0
  29. package/test/integ.cftaplam-no-usage-plan.js.snapshot/cftaplamnousageplanIntegDefaultTestDeployAssertABA4F4C5.template.json +36 -0
  30. package/test/integ.cftaplam-no-usage-plan.js.snapshot/integ.json +12 -0
  31. package/test/integ.cftaplam-no-usage-plan.js.snapshot/manifest.json +704 -0
  32. package/test/integ.cftaplam-no-usage-plan.js.snapshot/tree.json +1 -0
  33. package/test/integ.cftaplam-override-behavior.js.snapshot/asset.3a18fd3de4803f72260a058823accffd4f8d69986c6862a23cd86265f6cafa0f/index.js +23 -0
  34. package/test/integ.cftaplam-override-behavior.js.snapshot/cdk.out +1 -1
  35. package/test/integ.cftaplam-override-behavior.js.snapshot/cftaplam-override-behavior.assets.json +6 -6
  36. package/test/integ.cftaplam-override-behavior.js.snapshot/cftaplam-override-behavior.template.json +30 -41
  37. package/test/integ.cftaplam-override-behavior.js.snapshot/cftaplamoverridebehaviorIntegDefaultTestDeployAssert3DC30427.assets.json +1 -1
  38. package/test/integ.cftaplam-override-behavior.js.snapshot/integ.json +1 -1
  39. package/test/integ.cftaplam-override-behavior.js.snapshot/manifest.json +468 -6
  40. package/test/integ.cftaplam-override-behavior.js.snapshot/tree.json +1 -1797
  41. package/test/test.cloudfront-apigateway-lambda.test.js +42 -1
  42. package/test/integ.cftaplam-customCloudfrontLoggingBucket.js.snapshot/asset.42a35bbf0dec9ef0ac5b0dde87e71a1b8929e8d2d178dd09ccfb2c928ec0198c/index.js +0 -10
  43. package/test/integ.cftaplam-no-arguments.js.snapshot/asset.42a35bbf0dec9ef0ac5b0dde87e71a1b8929e8d2d178dd09ccfb2c928ec0198c/index.js +0 -10
  44. package/test/integ.cftaplam-override-behavior.js.snapshot/asset.42a35bbf0dec9ef0ac5b0dde87e71a1b8929e8d2d178dd09ccfb2c928ec0198c/index.js +0 -10
@@ -0,0 +1,13 @@
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
+ export {};
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
6
+ * with the License. A copy of the License is located at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
11
+ * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
12
+ * and limitations under the License.
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const aws_cdk_lib_1 = require("aws-cdk-lib");
16
+ const lib_1 = require("../lib");
17
+ const lambda = require("aws-cdk-lib/aws-lambda");
18
+ const core_1 = require("@aws-solutions-constructs/core");
19
+ const apigateway = require("aws-cdk-lib/aws-apigateway");
20
+ const integ_tests_alpha_1 = require("@aws-cdk/integ-tests-alpha");
21
+ const defaults = require("@aws-solutions-constructs/core");
22
+ // Setup
23
+ const app = new aws_cdk_lib_1.App();
24
+ const stack = new aws_cdk_lib_1.Stack(app, (0, core_1.generateIntegStackName)(__filename));
25
+ stack.templateOptions.description = 'Integration Test for aws-cloudfront-apigateway-lambda';
26
+ const lambdaProps = {
27
+ code: lambda.Code.fromAsset(`${__dirname}/lambda`),
28
+ runtime: defaults.COMMERCIAL_REGION_LAMBDA_NODE_RUNTIME,
29
+ handler: 'index.handler'
30
+ };
31
+ new lib_1.CloudFrontToApiGatewayToLambda(stack, 'test-cloudfront-apigateway-lambda', {
32
+ apiGatewayProps: {
33
+ defaultMethodOptions: {
34
+ authorizationType: apigateway.AuthorizationType.CUSTOM,
35
+ authorizer: (0, core_1.CreateApiAuthorizer)(stack, `${(0, core_1.generateIntegStackName)(__filename)}-authorizer`)
36
+ },
37
+ },
38
+ lambdaFunctionProps: lambdaProps,
39
+ cloudFrontLoggingBucketProps: {
40
+ removalPolicy: aws_cdk_lib_1.RemovalPolicy.DESTROY,
41
+ autoDeleteObjects: true
42
+ },
43
+ createUsagePlan: false,
44
+ });
45
+ (0, core_1.suppressCustomHandlerCfnNagWarnings)(stack, 'Custom::S3AutoDeleteObjectsCustomResourceProvider');
46
+ // Synth
47
+ new integ_tests_alpha_1.IntegTest(stack, 'Integ', { testCases: [
48
+ stack
49
+ ] });
50
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZWcuY2Z0YXBsYW0tbm8tdXNhZ2UtcGxhbi5qcyI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aywgJ0ludGVnJywgeyB0ZXN0Q2FzZXM6IFtcbiAgc3RhY2tcbl0gfSk7XG4iXX0=
@@ -0,0 +1,23 @@
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
+ console.log('Loading function');
15
+
16
+ exports.handler = async (event, context) => {
17
+ console.log('Received event:', JSON.stringify(event, null, 2));
18
+     return {
19
+       statusCode: 200,
20
+       headers: { 'Content-Type': 'text/plain' },
21
+       body: `Hello from Project Vesper! You've hit ${event.path}\n`
22
+     };
23
+ };
@@ -0,0 +1 @@
1
+ "use strict";var f=Object.create,i=Object.defineProperty,I=Object.getOwnPropertyDescriptor,C=Object.getOwnPropertyNames,w=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty,A=(t,e)=>{for(var o in e)i(t,o,{get:e[o],enumerable:!0})},d=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of C(e))!P.call(t,s)&&s!==o&&i(t,s,{get:()=>e[s],enumerable:!(r=I(e,s))||r.enumerable});return t},l=(t,e,o)=>(o=t!=null?f(w(t)):{},d(e||!t||!t.__esModule?i(o,"default",{value:t,enumerable:!0}):o,t)),B=t=>d(i({},"__esModule",{value:!0}),t),q={};A(q,{autoDeleteHandler:()=>S,handler:()=>H}),module.exports=B(q);var h=require("@aws-sdk/client-s3"),y=l(require("https")),m=l(require("url")),a={sendHttpRequest:D,log:T,includeStackTraces:!0,userHandlerIndex:"./index"},p="AWSCDK::CustomResourceProviderFramework::CREATE_FAILED",L="AWSCDK::CustomResourceProviderFramework::MISSING_PHYSICAL_ID";function R(t){return async(e,o)=>{let r={...e,ResponseURL:"..."};if(a.log(JSON.stringify(r,void 0,2)),e.RequestType==="Delete"&&e.PhysicalResourceId===p){a.log("ignoring DELETE event caused by a failed CREATE event"),await u("SUCCESS",e);return}try{let s=await t(r,o),n=k(e,s);await u("SUCCESS",n)}catch(s){let n={...e,Reason:a.includeStackTraces?s.stack:s.message};n.PhysicalResourceId||(e.RequestType==="Create"?(a.log("CREATE failed, responding with a marker physical resource id so that the subsequent DELETE will be ignored"),n.PhysicalResourceId=p):a.log(`ERROR: Malformed event. "PhysicalResourceId" is required: ${JSON.stringify(e)}`)),await u("FAILED",n)}}}function k(t,e={}){let o=e.PhysicalResourceId??t.PhysicalResourceId??t.RequestId;if(t.RequestType==="Delete"&&o!==t.PhysicalResourceId)throw new Error(`DELETE: cannot change the physical resource ID from "${t.PhysicalResourceId}" to "${e.PhysicalResourceId}" during deletion`);return{...t,...e,PhysicalResourceId:o}}async function u(t,e){let o={Status:t,Reason:e.Reason??t,StackId:e.StackId,RequestId:e.RequestId,PhysicalResourceId:e.PhysicalResourceId||L,LogicalResourceId:e.LogicalResourceId,NoEcho:e.NoEcho,Data:e.Data},r=m.parse(e.ResponseURL),s=`${r.protocol}//${r.hostname}/${r.pathname}?***`;a.log("submit response to cloudformation",s,o);let n=JSON.stringify(o),E={hostname:r.hostname,path:r.path,method:"PUT",headers:{"content-type":"","content-length":Buffer.byteLength(n,"utf8")}};await O({attempts:5,sleep:1e3},a.sendHttpRequest)(E,n)}async function D(t,e){return new Promise((o,r)=>{try{let s=y.request(t,n=>{n.resume(),!n.statusCode||n.statusCode>=400?r(new Error(`Unsuccessful HTTP response: ${n.statusCode}`)):o()});s.on("error",r),s.write(e),s.end()}catch(s){r(s)}})}function T(t,...e){console.log(t,...e)}function O(t,e){return async(...o)=>{let r=t.attempts,s=t.sleep;for(;;)try{return await e(...o)}catch(n){if(r--<=0)throw n;await b(Math.floor(Math.random()*s)),s*=2}}}async function b(t){return new Promise(e=>setTimeout(e,t))}var g="aws-cdk:auto-delete-objects",x=JSON.stringify({Version:"2012-10-17",Statement:[]}),c=new h.S3({}),H=R(S);async function S(t){switch(t.RequestType){case"Create":return;case"Update":return{PhysicalResourceId:(await F(t)).PhysicalResourceId};case"Delete":return N(t.ResourceProperties?.BucketName)}}async function F(t){let e=t,o=e.OldResourceProperties?.BucketName;return{PhysicalResourceId:e.ResourceProperties?.BucketName??o}}async function _(t){try{let e=(await c.getBucketPolicy({Bucket:t}))?.Policy??x,o=JSON.parse(e);o.Statement.push({Principal:"*",Effect:"Deny",Action:["s3:PutObject"],Resource:[`arn:aws:s3:::${t}/*`]}),await c.putBucketPolicy({Bucket:t,Policy:JSON.stringify(o)})}catch(e){if(e.name==="NoSuchBucket")throw e;console.log(`Could not set new object deny policy on bucket '${t}' prior to deletion.`)}}async function U(t){let e;do{e=await c.listObjectVersions({Bucket:t});let o=[...e.Versions??[],...e.DeleteMarkers??[]];if(o.length===0)return;let r=o.map(s=>({Key:s.Key,VersionId:s.VersionId}));await c.deleteObjects({Bucket:t,Delete:{Objects:r}})}while(e?.IsTruncated)}async function N(t){if(!t)throw new Error("No BucketName was provided.");try{if(!await W(t)){console.log(`Bucket does not have '${g}' tag, skipping cleaning.`);return}await _(t),await U(t)}catch(e){if(e.name==="NoSuchBucket"){console.log(`Bucket '${t}' does not exist.`);return}throw e}}async function W(t){return(await c.getBucketTagging({Bucket:t})).TagSet?.some(o=>o.Key===g&&o.Value==="true")}
@@ -0,0 +1 @@
1
+ {"version":"40.0.0"}
@@ -0,0 +1,45 @@
1
+ {
2
+ "version": "40.0.0",
3
+ "files": {
4
+ "3a18fd3de4803f72260a058823accffd4f8d69986c6862a23cd86265f6cafa0f": {
5
+ "source": {
6
+ "path": "asset.3a18fd3de4803f72260a058823accffd4f8d69986c6862a23cd86265f6cafa0f",
7
+ "packaging": "zip"
8
+ },
9
+ "destinations": {
10
+ "current_account-current_region": {
11
+ "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
12
+ "objectKey": "3a18fd3de4803f72260a058823accffd4f8d69986c6862a23cd86265f6cafa0f.zip",
13
+ "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
14
+ }
15
+ }
16
+ },
17
+ "faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6": {
18
+ "source": {
19
+ "path": "asset.faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6",
20
+ "packaging": "zip"
21
+ },
22
+ "destinations": {
23
+ "current_account-current_region": {
24
+ "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
25
+ "objectKey": "faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6.zip",
26
+ "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
27
+ }
28
+ }
29
+ },
30
+ "7df9e12538d0b0731b350b862b5b0f431802deac8db86e07c2abaf7034bb666b": {
31
+ "source": {
32
+ "path": "cftaplam-no-usage-plan.template.json",
33
+ "packaging": "file"
34
+ },
35
+ "destinations": {
36
+ "current_account-current_region": {
37
+ "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
38
+ "objectKey": "7df9e12538d0b0731b350b862b5b0f431802deac8db86e07c2abaf7034bb666b.json",
39
+ "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
40
+ }
41
+ }
42
+ }
43
+ },
44
+ "dockerImages": {}
45
+ }