@aws-solutions-constructs/aws-lambda-opensearch 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 (55) hide show
  1. package/.jsii +43 -4
  2. package/lib/index.js +1 -1
  3. package/package.json +6 -6
  4. package/test/integ.lamopn-cluster-config.js.snapshot/cdk.out +1 -1
  5. package/test/integ.lamopn-cluster-config.js.snapshot/integ.json +1 -1
  6. package/test/integ.lamopn-cluster-config.js.snapshot/lamopn-cluster-config.assets.json +3 -3
  7. package/test/integ.lamopn-cluster-config.js.snapshot/lamopn-cluster-config.template.json +29 -3
  8. package/test/integ.lamopn-cluster-config.js.snapshot/lamopnclusterconfigIntegDefaultTestDeployAssertD8012D1A.assets.json +1 -1
  9. package/test/integ.lamopn-cluster-config.js.snapshot/manifest.json +52 -13
  10. package/test/integ.lamopn-cluster-config.js.snapshot/tree.json +1 -2177
  11. package/test/integ.lamopn-disabled-zone-awareness.js.snapshot/cdk.out +1 -1
  12. package/test/integ.lamopn-disabled-zone-awareness.js.snapshot/integ.json +1 -1
  13. package/test/integ.lamopn-disabled-zone-awareness.js.snapshot/lamopn-disabled-zone-awareness.assets.json +3 -3
  14. package/test/integ.lamopn-disabled-zone-awareness.js.snapshot/lamopn-disabled-zone-awareness.template.json +28 -3
  15. package/test/integ.lamopn-disabled-zone-awareness.js.snapshot/lamopndisabledzoneawarenessIntegDefaultTestDeployAssert7E083B68.assets.json +1 -1
  16. package/test/integ.lamopn-disabled-zone-awareness.js.snapshot/manifest.json +52 -13
  17. package/test/integ.lamopn-disabled-zone-awareness.js.snapshot/tree.json +1 -2050
  18. package/test/integ.lamopn-domain-arguments.js.snapshot/{asset.abbc4eca9e7ddabc31da3ce83159e6eee8e72e2c358ab8af0711044514c41290 → asset.36fdcee3b182bca7e3283fbd947213d1e59968159f93aec9fd62d15935c721b0}/index.js +13 -0
  19. package/test/integ.lamopn-domain-arguments.js.snapshot/cdk.out +1 -1
  20. package/test/integ.lamopn-domain-arguments.js.snapshot/integ.json +1 -1
  21. package/test/integ.lamopn-domain-arguments.js.snapshot/lamopn-domain-arguments.assets.json +6 -6
  22. package/test/integ.lamopn-domain-arguments.js.snapshot/lamopn-domain-arguments.template.json +25 -36
  23. package/test/integ.lamopn-domain-arguments.js.snapshot/lamopndomainargumentsIntegDefaultTestDeployAssert47534E1E.assets.json +1 -1
  24. package/test/integ.lamopn-domain-arguments.js.snapshot/manifest.json +338 -6
  25. package/test/integ.lamopn-domain-arguments.js.snapshot/tree.json +1 -1256
  26. package/test/integ.lamopn-existing-vpc.js.snapshot/{asset.abbc4eca9e7ddabc31da3ce83159e6eee8e72e2c358ab8af0711044514c41290 → asset.36fdcee3b182bca7e3283fbd947213d1e59968159f93aec9fd62d15935c721b0}/index.js +13 -0
  27. package/test/integ.lamopn-existing-vpc.js.snapshot/asset.7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200/__entrypoint__.js +1 -0
  28. package/test/integ.lamopn-existing-vpc.js.snapshot/cdk.out +1 -1
  29. package/test/integ.lamopn-existing-vpc.js.snapshot/integ.json +1 -1
  30. package/test/integ.lamopn-existing-vpc.js.snapshot/lamopn-existing-vpc.assets.json +9 -9
  31. package/test/integ.lamopn-existing-vpc.js.snapshot/lamopn-existing-vpc.template.json +33 -5
  32. package/test/integ.lamopn-existing-vpc.js.snapshot/lamopnexistingvpcIntegDefaultTestDeployAssert4A7EE058.assets.json +1 -1
  33. package/test/integ.lamopn-existing-vpc.js.snapshot/manifest.json +659 -3
  34. package/test/integ.lamopn-existing-vpc.js.snapshot/tree.json +1 -2207
  35. package/test/integ.lamopn-no-arguments.js.snapshot/{asset.abbc4eca9e7ddabc31da3ce83159e6eee8e72e2c358ab8af0711044514c41290 → asset.36fdcee3b182bca7e3283fbd947213d1e59968159f93aec9fd62d15935c721b0}/index.js +13 -0
  36. package/test/integ.lamopn-no-arguments.js.snapshot/cdk.out +1 -1
  37. package/test/integ.lamopn-no-arguments.js.snapshot/integ.json +1 -1
  38. package/test/integ.lamopn-no-arguments.js.snapshot/lamopn-no-arguments.assets.json +6 -6
  39. package/test/integ.lamopn-no-arguments.js.snapshot/lamopn-no-arguments.template.json +25 -36
  40. package/test/integ.lamopn-no-arguments.js.snapshot/lamopnnoargumentsIntegDefaultTestDeployAssert4290A592.assets.json +1 -1
  41. package/test/integ.lamopn-no-arguments.js.snapshot/manifest.json +338 -6
  42. package/test/integ.lamopn-no-arguments.js.snapshot/tree.json +1 -1256
  43. package/test/integ.lamopn-vpc-props.js.snapshot/{asset.abbc4eca9e7ddabc31da3ce83159e6eee8e72e2c358ab8af0711044514c41290 → asset.36fdcee3b182bca7e3283fbd947213d1e59968159f93aec9fd62d15935c721b0}/index.js +13 -0
  44. package/test/integ.lamopn-vpc-props.js.snapshot/asset.7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200/__entrypoint__.js +1 -0
  45. package/test/integ.lamopn-vpc-props.js.snapshot/cdk.out +1 -1
  46. package/test/integ.lamopn-vpc-props.js.snapshot/integ.json +1 -1
  47. package/test/integ.lamopn-vpc-props.js.snapshot/lamopn-vpc-props.assets.json +9 -9
  48. package/test/integ.lamopn-vpc-props.js.snapshot/lamopn-vpc-props.template.json +31 -5
  49. package/test/integ.lamopn-vpc-props.js.snapshot/lamopnvpcpropsIntegDefaultTestDeployAssertC7FD49B0.assets.json +1 -1
  50. package/test/integ.lamopn-vpc-props.js.snapshot/manifest.json +587 -3
  51. package/test/integ.lamopn-vpc-props.js.snapshot/tree.json +1 -1795
  52. package/test/integ.lamopn-existing-vpc.js.snapshot/asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a/__entrypoint__.js +0 -1
  53. package/test/integ.lamopn-vpc-props.js.snapshot/asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a/__entrypoint__.js +0 -1
  54. /package/test/integ.lamopn-existing-vpc.js.snapshot/{asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a → asset.7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200}/index.js +0 -0
  55. /package/test/integ.lamopn-vpc-props.js.snapshot/{asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a → asset.7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200}/index.js +0 -0
@@ -1,3 +1,16 @@
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
+
1
14
  var AWS = require('aws-sdk');
2
15
  var path = require('path');
3
16
 
@@ -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
  "lamopn-vpc-props/Integ/DefaultTest": {
5
5
  "stacks": [
@@ -1,35 +1,35 @@
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
  }
16
16
  }
17
17
  },
18
- "abbc4eca9e7ddabc31da3ce83159e6eee8e72e2c358ab8af0711044514c41290": {
18
+ "36fdcee3b182bca7e3283fbd947213d1e59968159f93aec9fd62d15935c721b0": {
19
19
  "source": {
20
- "path": "asset.abbc4eca9e7ddabc31da3ce83159e6eee8e72e2c358ab8af0711044514c41290",
20
+ "path": "asset.36fdcee3b182bca7e3283fbd947213d1e59968159f93aec9fd62d15935c721b0",
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": "abbc4eca9e7ddabc31da3ce83159e6eee8e72e2c358ab8af0711044514c41290.zip",
26
+ "objectKey": "36fdcee3b182bca7e3283fbd947213d1e59968159f93aec9fd62d15935c721b0.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
  }
30
30
  }
31
31
  },
32
- "d948bdee30e48d7e27f9d42e78bbe3bc5eeadc02adc6a8305dde47df293208e3": {
32
+ "a76af453e4a0196665528384d3d7eaf723cb9e1c4a1da3014d57a18b4719c4b7": {
33
33
  "source": {
34
34
  "path": "lamopn-vpc-props.template.json",
35
35
  "packaging": "file"
@@ -37,7 +37,7 @@
37
37
  "destinations": {
38
38
  "current_account-us-east-1": {
39
39
  "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1",
40
- "objectKey": "d948bdee30e48d7e27f9d42e78bbe3bc5eeadc02adc6a8305dde47df293208e3.json",
40
+ "objectKey": "a76af453e4a0196665528384d3d7eaf723cb9e1c4a1da3014d57a18b4719c4b7.json",
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
  }
@@ -73,9 +73,7 @@
73
73
  "ec2:CreateNetworkInterface",
74
74
  "ec2:DeleteNetworkInterface",
75
75
  "ec2:DescribeNetworkInterfaces",
76
- "ec2:UnassignPrivateIpAddresses",
77
- "xray:PutTelemetryRecords",
78
- "xray:PutTraceSegments"
76
+ "ec2:UnassignPrivateIpAddresses"
79
77
  ],
80
78
  "Effect": "Allow",
81
79
  "Resource": "*"
@@ -138,7 +136,7 @@
138
136
  "S3Bucket": {
139
137
  "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1"
140
138
  },
141
- "S3Key": "abbc4eca9e7ddabc31da3ce83159e6eee8e72e2c358ab8af0711044514c41290.zip"
139
+ "S3Key": "36fdcee3b182bca7e3283fbd947213d1e59968159f93aec9fd62d15935c721b0.zip"
142
140
  },
143
141
  "Environment": {
144
142
  "Variables": {
@@ -206,6 +204,34 @@
206
204
  }
207
205
  }
208
206
  },
207
+ "testlambdaopensearchLambdaFunctioninlinePolicyAddedToExecutionRole09B870594": {
208
+ "Type": "AWS::IAM::Policy",
209
+ "Properties": {
210
+ "PolicyDocument": {
211
+ "Statement": [
212
+ {
213
+ "Action": [
214
+ "xray:PutTelemetryRecords",
215
+ "xray:PutTraceSegments"
216
+ ],
217
+ "Effect": "Allow",
218
+ "Resource": "*"
219
+ }
220
+ ],
221
+ "Version": "2012-10-17"
222
+ },
223
+ "PolicyName": "testlambdaopensearchLambdaFunctioninlinePolicyAddedToExecutionRole09B870594",
224
+ "Roles": [
225
+ {
226
+ "Ref": "testlambdaopensearchLambdaFunctionServiceRole4722AB8A"
227
+ }
228
+ ]
229
+ },
230
+ "DependsOn": [
231
+ "VpcisolatedSubnet1RouteTableAssociationD259E31A",
232
+ "VpcisolatedSubnet2RouteTableAssociation25A4716F"
233
+ ]
234
+ },
209
235
  "testlambdaopensearchCognitoUserPoolA09096F9": {
210
236
  "Type": "AWS::Cognito::UserPool",
211
237
  "Properties": {
@@ -1237,7 +1263,7 @@
1237
1263
  "S3Bucket": {
1238
1264
  "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-us-east-1"
1239
1265
  },
1240
- "S3Key": "ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a.zip"
1266
+ "S3Key": "7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200.zip"
1241
1267
  },
1242
1268
  "Timeout": 900,
1243
1269
  "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": {