@aws-solutions-constructs/aws-apigateway-sagemakerendpoint 2.51.0 → 2.52.1

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 (35) hide show
  1. package/.eslintignore +3 -1
  2. package/.jsii +49 -4
  3. package/integ.config.json +7 -0
  4. package/lib/index.js +1 -1
  5. package/package.json +9 -8
  6. package/test/integ.apisag-additional-request-templates.js +5 -2
  7. package/test/integ.apisag-additional-request-templates.js.snapshot/apisag-additional-request-templates.assets.json +19 -0
  8. package/test/integ.apisag-additional-request-templates.js.snapshot/apisag-additional-request-templates.template.json +396 -0
  9. package/test/integ.apisag-additional-request-templates.js.snapshot/apisagadditionalrequesttemplatesIntegDefaultTestDeployAssert6CEA10C7.assets.json +19 -0
  10. package/test/integ.apisag-additional-request-templates.js.snapshot/apisagadditionalrequesttemplatesIntegDefaultTestDeployAssert6CEA10C7.template.json +36 -0
  11. package/test/integ.apisag-additional-request-templates.js.snapshot/cdk.out +1 -0
  12. package/test/integ.apisag-additional-request-templates.js.snapshot/integ.json +12 -0
  13. package/test/integ.apisag-additional-request-templates.js.snapshot/manifest.json +185 -0
  14. package/test/integ.apisag-additional-request-templates.js.snapshot/tree.json +647 -0
  15. package/test/integ.apisag-apigateway-sagemakerendpoint-overwrite.js +5 -2
  16. package/test/integ.apisag-apigateway-sagemakerendpoint-overwrite.js.snapshot/apisag-apigateway-sagemakerendpoint-overwrite.assets.json +19 -0
  17. package/test/integ.apisag-apigateway-sagemakerendpoint-overwrite.js.snapshot/apisag-apigateway-sagemakerendpoint-overwrite.template.json +406 -0
  18. package/test/integ.apisag-apigateway-sagemakerendpoint-overwrite.js.snapshot/apisagapigatewaysagemakerendpointoverwriteIntegDefaultTestDeployAssert75D4108E.assets.json +19 -0
  19. package/test/integ.apisag-apigateway-sagemakerendpoint-overwrite.js.snapshot/apisagapigatewaysagemakerendpointoverwriteIntegDefaultTestDeployAssert75D4108E.template.json +36 -0
  20. package/test/integ.apisag-apigateway-sagemakerendpoint-overwrite.js.snapshot/cdk.out +1 -0
  21. package/test/integ.apisag-apigateway-sagemakerendpoint-overwrite.js.snapshot/integ.json +12 -0
  22. package/test/integ.apisag-apigateway-sagemakerendpoint-overwrite.js.snapshot/manifest.json +185 -0
  23. package/test/integ.apisag-apigateway-sagemakerendpoint-overwrite.js.snapshot/tree.json +656 -0
  24. package/test/integ.apisag-no-overwrite.js +5 -2
  25. package/test/integ.apisag-no-overwrite.js.snapshot/apisag-no-overwrite.assets.json +19 -0
  26. package/test/integ.apisag-no-overwrite.js.snapshot/apisag-no-overwrite.template.json +395 -0
  27. package/test/integ.apisag-no-overwrite.js.snapshot/apisagnooverwriteIntegDefaultTestDeployAssert36F1A3A9.assets.json +19 -0
  28. package/test/integ.apisag-no-overwrite.js.snapshot/apisagnooverwriteIntegDefaultTestDeployAssert36F1A3A9.template.json +36 -0
  29. package/test/integ.apisag-no-overwrite.js.snapshot/cdk.out +1 -0
  30. package/test/integ.apisag-no-overwrite.js.snapshot/integ.json +12 -0
  31. package/test/integ.apisag-no-overwrite.js.snapshot/manifest.json +185 -0
  32. package/test/integ.apisag-no-overwrite.js.snapshot/tree.json +646 -0
  33. package/test/integ.apisag-additional-request-templates.expected.json +0 -396
  34. package/test/integ.apisag-apigateway-sagemakerendpoint-overwrite.expected.json +0 -406
  35. package/test/integ.apisag-no-overwrite.expected.json +0 -395
@@ -1,406 +0,0 @@
1
- {
2
- "Description": "Integration Test for aws-apigateway-sagemakerendpoint",
3
- "Resources": {
4
- "apigatewayroleE6D48DBD": {
5
- "Type": "AWS::IAM::Role",
6
- "Properties": {
7
- "AssumeRolePolicyDocument": {
8
- "Statement": [
9
- {
10
- "Action": "sts:AssumeRole",
11
- "Effect": "Allow",
12
- "Principal": {
13
- "Service": "apigateway.amazonaws.com"
14
- }
15
- }
16
- ],
17
- "Version": "2012-10-17"
18
- },
19
- "Description": "existing role for SageMaker integration",
20
- "Policies": [
21
- {
22
- "PolicyDocument": {
23
- "Statement": [
24
- {
25
- "Action": "sagemaker:InvokeEndpoint",
26
- "Effect": "Allow",
27
- "Resource": {
28
- "Fn::Join": [
29
- "",
30
- [
31
- "arn:",
32
- {
33
- "Ref": "AWS::Partition"
34
- },
35
- ":sagemaker:",
36
- {
37
- "Ref": "AWS::Region"
38
- },
39
- ":",
40
- {
41
- "Ref": "AWS::AccountId"
42
- },
43
- ":endpoint/my-endpoint"
44
- ]
45
- ]
46
- }
47
- }
48
- ],
49
- "Version": "2012-10-17"
50
- },
51
- "PolicyName": "InvokePolicy"
52
- }
53
- ]
54
- }
55
- },
56
- "testapigatewaysagemakerendpointoverwriteApiAccessLogGroupC0933D4E": {
57
- "Type": "AWS::Logs::LogGroup",
58
- "UpdateReplacePolicy": "Retain",
59
- "DeletionPolicy": "Retain",
60
- "Metadata": {
61
- "cfn_nag": {
62
- "rules_to_suppress": [
63
- {
64
- "id": "W86",
65
- "reason": "Retention period for CloudWatchLogs LogGroups are set to 'Never Expire' to preserve customer data indefinitely"
66
- },
67
- {
68
- "id": "W84",
69
- "reason": "By default CloudWatchLogs LogGroups data is encrypted using the CloudWatch server-side encryption keys (AWS Managed Keys)"
70
- }
71
- ]
72
- }
73
- }
74
- },
75
- "testapigatewaysagemakerendpointoverwriteRestApi0EE22754": {
76
- "Type": "AWS::ApiGateway::RestApi",
77
- "Properties": {
78
- "EndpointConfiguration": {
79
- "Types": [
80
- "EDGE"
81
- ]
82
- },
83
- "Name": "RestApi"
84
- }
85
- },
86
- "testapigatewaysagemakerendpointoverwriteRestApiDeployment3B3B03364a19f99c87430d39385b3313a65df211": {
87
- "Type": "AWS::ApiGateway::Deployment",
88
- "Properties": {
89
- "Description": "Automatically created by the RestApi construct",
90
- "RestApiId": {
91
- "Ref": "testapigatewaysagemakerendpointoverwriteRestApi0EE22754"
92
- }
93
- },
94
- "DependsOn": [
95
- "testapigatewaysagemakerendpointoverwriteRestApipredictedratingsuseridGET06B35696",
96
- "testapigatewaysagemakerendpointoverwriteRestApipredictedratingsuseridB999A556",
97
- "testapigatewaysagemakerendpointoverwriteRestApipredictedratings1C8B9193",
98
- "testapigatewaysagemakerendpointoverwriteRestApirequestvalidatorFA90CC69"
99
- ],
100
- "Metadata": {
101
- "cfn_nag": {
102
- "rules_to_suppress": [
103
- {
104
- "id": "W45",
105
- "reason": "ApiGateway has AccessLogging enabled in AWS::ApiGateway::Stage resource, but cfn_nag checks for it in AWS::ApiGateway::Deployment resource"
106
- }
107
- ]
108
- }
109
- }
110
- },
111
- "testapigatewaysagemakerendpointoverwriteRestApiDeploymentStageprod39A2035F": {
112
- "Type": "AWS::ApiGateway::Stage",
113
- "Properties": {
114
- "AccessLogSetting": {
115
- "DestinationArn": {
116
- "Fn::GetAtt": [
117
- "testapigatewaysagemakerendpointoverwriteApiAccessLogGroupC0933D4E",
118
- "Arn"
119
- ]
120
- },
121
- "Format": "{\"requestId\":\"$context.requestId\",\"ip\":\"$context.identity.sourceIp\",\"user\":\"$context.identity.user\",\"caller\":\"$context.identity.caller\",\"requestTime\":\"$context.requestTime\",\"httpMethod\":\"$context.httpMethod\",\"resourcePath\":\"$context.resourcePath\",\"status\":\"$context.status\",\"protocol\":\"$context.protocol\",\"responseLength\":\"$context.responseLength\"}"
122
- },
123
- "DeploymentId": {
124
- "Ref": "testapigatewaysagemakerendpointoverwriteRestApiDeployment3B3B03364a19f99c87430d39385b3313a65df211"
125
- },
126
- "MethodSettings": [
127
- {
128
- "DataTraceEnabled": false,
129
- "HttpMethod": "*",
130
- "LoggingLevel": "INFO",
131
- "ResourcePath": "/*"
132
- }
133
- ],
134
- "RestApiId": {
135
- "Ref": "testapigatewaysagemakerendpointoverwriteRestApi0EE22754"
136
- },
137
- "StageName": "prod",
138
- "TracingEnabled": true
139
- }
140
- },
141
- "testapigatewaysagemakerendpointoverwriteRestApipredictedratings1C8B9193": {
142
- "Type": "AWS::ApiGateway::Resource",
143
- "Properties": {
144
- "ParentId": {
145
- "Fn::GetAtt": [
146
- "testapigatewaysagemakerendpointoverwriteRestApi0EE22754",
147
- "RootResourceId"
148
- ]
149
- },
150
- "PathPart": "predicted-ratings",
151
- "RestApiId": {
152
- "Ref": "testapigatewaysagemakerendpointoverwriteRestApi0EE22754"
153
- }
154
- }
155
- },
156
- "testapigatewaysagemakerendpointoverwriteRestApipredictedratingsuseridB999A556": {
157
- "Type": "AWS::ApiGateway::Resource",
158
- "Properties": {
159
- "ParentId": {
160
- "Ref": "testapigatewaysagemakerendpointoverwriteRestApipredictedratings1C8B9193"
161
- },
162
- "PathPart": "{user_id}",
163
- "RestApiId": {
164
- "Ref": "testapigatewaysagemakerendpointoverwriteRestApi0EE22754"
165
- }
166
- }
167
- },
168
- "testapigatewaysagemakerendpointoverwriteRestApipredictedratingsuseridGET06B35696": {
169
- "Type": "AWS::ApiGateway::Method",
170
- "Properties": {
171
- "AuthorizationType": "AWS_IAM",
172
- "HttpMethod": "GET",
173
- "Integration": {
174
- "Credentials": {
175
- "Fn::GetAtt": [
176
- "apigatewayroleE6D48DBD",
177
- "Arn"
178
- ]
179
- },
180
- "IntegrationHttpMethod": "POST",
181
- "IntegrationResponses": [
182
- {
183
- "ResponseTemplates": {
184
- "application/json": "{\n \"ratings\": [\n#set( $predictions = $input.path(\"$.predictions\") )\n#foreach( $item in $predictions )\n $item.scores[0]#if( $foreach.hasNext ),#end\n $esc.newline\n#end\n ]\n}"
185
- },
186
- "StatusCode": "200"
187
- },
188
- {
189
- "SelectionPattern": "5\\d{2}",
190
- "StatusCode": "500"
191
- },
192
- {
193
- "SelectionPattern": "4\\d{2}",
194
- "StatusCode": "400"
195
- }
196
- ],
197
- "PassthroughBehavior": "NEVER",
198
- "RequestParameters": {
199
- "integration.request.header.Content-Type": "'application/json'"
200
- },
201
- "RequestTemplates": {
202
- "application/json": "{\n \"instances\": [\n#set( $user_id = $input.params(\"user_id\") )\n#set( $items = $input.params(\"items\") )\n#foreach( $item in $items.split(\",\") )\n {\"in0\": [$user_id], \"in1\": [$item]}#if( $foreach.hasNext ),#end\n $esc.newline\n#end\n ]\n}"
203
- },
204
- "Type": "AWS",
205
- "Uri": {
206
- "Fn::Join": [
207
- "",
208
- [
209
- "arn:",
210
- {
211
- "Ref": "AWS::Partition"
212
- },
213
- ":apigateway:",
214
- {
215
- "Ref": "AWS::Region"
216
- },
217
- ":runtime.sagemaker:path/endpoints/my-endpoint/invocations"
218
- ]
219
- ]
220
- }
221
- },
222
- "MethodResponses": [
223
- {
224
- "StatusCode": "200"
225
- },
226
- {
227
- "StatusCode": "500"
228
- },
229
- {
230
- "StatusCode": "400"
231
- }
232
- ],
233
- "RequestValidatorId": {
234
- "Ref": "testapigatewaysagemakerendpointoverwriteRestApirequestvalidatorFA90CC69"
235
- },
236
- "ResourceId": {
237
- "Ref": "testapigatewaysagemakerendpointoverwriteRestApipredictedratingsuseridB999A556"
238
- },
239
- "RestApiId": {
240
- "Ref": "testapigatewaysagemakerendpointoverwriteRestApi0EE22754"
241
- }
242
- }
243
- },
244
- "testapigatewaysagemakerendpointoverwriteRestApiUsagePlan64BD97E7": {
245
- "Type": "AWS::ApiGateway::UsagePlan",
246
- "Properties": {
247
- "ApiStages": [
248
- {
249
- "ApiId": {
250
- "Ref": "testapigatewaysagemakerendpointoverwriteRestApi0EE22754"
251
- },
252
- "Stage": {
253
- "Ref": "testapigatewaysagemakerendpointoverwriteRestApiDeploymentStageprod39A2035F"
254
- },
255
- "Throttle": {}
256
- }
257
- ]
258
- }
259
- },
260
- "testapigatewaysagemakerendpointoverwriteRestApirequestvalidatorFA90CC69": {
261
- "Type": "AWS::ApiGateway::RequestValidator",
262
- "Properties": {
263
- "Name": "request-param-validator",
264
- "RestApiId": {
265
- "Ref": "testapigatewaysagemakerendpointoverwriteRestApi0EE22754"
266
- },
267
- "ValidateRequestParameters": true
268
- }
269
- },
270
- "testapigatewaysagemakerendpointoverwriteLambdaRestApiCloudWatchRole2ED1F54A": {
271
- "Type": "AWS::IAM::Role",
272
- "Properties": {
273
- "AssumeRolePolicyDocument": {
274
- "Statement": [
275
- {
276
- "Action": "sts:AssumeRole",
277
- "Effect": "Allow",
278
- "Principal": {
279
- "Service": "apigateway.amazonaws.com"
280
- }
281
- }
282
- ],
283
- "Version": "2012-10-17"
284
- },
285
- "Policies": [
286
- {
287
- "PolicyDocument": {
288
- "Statement": [
289
- {
290
- "Action": [
291
- "logs:CreateLogGroup",
292
- "logs:CreateLogStream",
293
- "logs:DescribeLogGroups",
294
- "logs:DescribeLogStreams",
295
- "logs:PutLogEvents",
296
- "logs:GetLogEvents",
297
- "logs:FilterLogEvents"
298
- ],
299
- "Effect": "Allow",
300
- "Resource": {
301
- "Fn::Join": [
302
- "",
303
- [
304
- "arn:",
305
- {
306
- "Ref": "AWS::Partition"
307
- },
308
- ":logs:",
309
- {
310
- "Ref": "AWS::Region"
311
- },
312
- ":",
313
- {
314
- "Ref": "AWS::AccountId"
315
- },
316
- ":*"
317
- ]
318
- ]
319
- }
320
- }
321
- ],
322
- "Version": "2012-10-17"
323
- },
324
- "PolicyName": "LambdaRestApiCloudWatchRolePolicy"
325
- }
326
- ]
327
- }
328
- },
329
- "testapigatewaysagemakerendpointoverwriteLambdaRestApiAccount8093B262": {
330
- "Type": "AWS::ApiGateway::Account",
331
- "Properties": {
332
- "CloudWatchRoleArn": {
333
- "Fn::GetAtt": [
334
- "testapigatewaysagemakerendpointoverwriteLambdaRestApiCloudWatchRole2ED1F54A",
335
- "Arn"
336
- ]
337
- }
338
- },
339
- "DependsOn": [
340
- "testapigatewaysagemakerendpointoverwriteRestApi0EE22754"
341
- ]
342
- }
343
- },
344
- "Outputs": {
345
- "testapigatewaysagemakerendpointoverwriteRestApiEndpointE0CCBC1C": {
346
- "Value": {
347
- "Fn::Join": [
348
- "",
349
- [
350
- "https://",
351
- {
352
- "Ref": "testapigatewaysagemakerendpointoverwriteRestApi0EE22754"
353
- },
354
- ".execute-api.",
355
- {
356
- "Ref": "AWS::Region"
357
- },
358
- ".",
359
- {
360
- "Ref": "AWS::URLSuffix"
361
- },
362
- "/",
363
- {
364
- "Ref": "testapigatewaysagemakerendpointoverwriteRestApiDeploymentStageprod39A2035F"
365
- },
366
- "/"
367
- ]
368
- ]
369
- }
370
- }
371
- },
372
- "Parameters": {
373
- "BootstrapVersion": {
374
- "Type": "AWS::SSM::Parameter::Value<String>",
375
- "Default": "/cdk-bootstrap/hnb659fds/version",
376
- "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
377
- }
378
- },
379
- "Rules": {
380
- "CheckBootstrapVersion": {
381
- "Assertions": [
382
- {
383
- "Assert": {
384
- "Fn::Not": [
385
- {
386
- "Fn::Contains": [
387
- [
388
- "1",
389
- "2",
390
- "3",
391
- "4",
392
- "5"
393
- ],
394
- {
395
- "Ref": "BootstrapVersion"
396
- }
397
- ]
398
- }
399
- ]
400
- },
401
- "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
402
- }
403
- ]
404
- }
405
- }
406
- }