diff --git a/CHANGELOG.md b/CHANGELOG.md index 606ca74fe..62c44c2c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,19 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [2.62.0](https://github.com/awslabs/aws-solutions-constructs/compare/v2.61.0...v2.62.0) (2024-07-16) + +Built on CDK v2.147.3 + +### Features + +* **apigateway:** accept MethodResponses along with IntegrationResponses ([#1146](https://github.com/awslabs/aws-solutions-constructs/issues/1146)) ([c351953](https://github.com/awslabs/aws-solutions-constructs/commit/c35195335b530bde8e782bdc2ded8003060c9650)) + + +### Bug Fixes + +* **resources/template-writer:** add IAM policy as customResource dependency ([#1148](https://github.com/awslabs/aws-solutions-constructs/issues/1148)) ([bbdeddd](https://github.com/awslabs/aws-solutions-constructs/commit/bbdeddd4b5c57cdc2397f82d1724027e610df550)) + ## [2.61.0](https://github.com/awslabs/aws-solutions-constructs/compare/v2.60.0...v2.61.0) (2024-07-05) Built on CDK v2.147.3 diff --git a/source/lerna.json b/source/lerna.json index 33f23319f..073356302 100644 --- a/source/lerna.json +++ b/source/lerna.json @@ -6,5 +6,5 @@ "./patterns/@aws-solutions-constructs/*" ], "rejectCycles": "true", - "version": "2.61.0" + "version": "2.62.0" } diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/README.md b/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/README.md index 3b6c211ad..e4ade4bd7 100755 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/README.md +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/README.md @@ -70,18 +70,22 @@ new ApiGatewayToDynamoDB(this, "test-api-gateway-dynamodb-default", new ApiGatew |createRequestTemplate?|`string`|API Gateway Request Template for the create method for the default `application/json` content-type. This property is required if the `allowCreateOperation` property is set to true.| |additionalCreateRequestTemplates?|`{ [contentType: string]: string; }`|Optional Create Request Templates for content-types other than `application/json`. Use the `createRequestTemplate` property to set the request template for the `application/json` content-type. This property can only be specified if the `allowCreateOperation` property is set to true.| |createIntegrationResponses?|[`api.IntegrationResponses[]`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.IntegrationResponse.html)|Optional, custom API Gateway Integration Response for the create method. This property can only be specified if the `allowCreateOperation` property is set to true.| +|createMethodResponses?|[`api.MethodResponses[]`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.MethodResponse.html)| Optional, custom API Gateway Method Responses for the create action. default: [{ statusCode: "200", responseParameters: { "method.response.header.Content-Type": true }},{ statusCode: "500", responseParameters: { "method.response.header.Content-Type": true } } ]| |allowReadOperation?|`boolean`|Whether to deploy an API Gateway Method for GET HTTP operations on DynamoDB table (i.e. dynamodb:Query).| |readRequestTemplate?|`string`|API Gateway Request Template for the read method for the default `application/json` content-type. The default template only supports a partition key and not partition + sort keys.| |additionalReadRequestTemplates?|`{ [contentType: string]: string; }`|Optional Read Request Templates for content-types other than `application/json`. Use the `readRequestTemplate` property to set the request template for the `application/json` content-type.| |readIntegrationResponses?|[`api.IntegrationResponses[]`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.IntegrationResponse.html)|Optional, custom API Gateway Integration Response for the read method.| |allowUpdateOperation?|`boolean`|Whether to deploy API Gateway Method for PUT HTTP operations on DynamoDB table (i.e. dynamodb:UpdateItem).| +|readMethodResponses?|[`api.MethodResponses[]`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.MethodResponse.html)| Optional, custom API Gateway Method Responses for the read action. default: [{ statusCode: "200", responseParameters: { "method.response.header.Content-Type": true }},{ statusCode: "500", responseParameters: { "method.response.header.Content-Type": true } } ]| |updateRequestTemplate?|`string`|API Gateway Request Template for the update method. This property is required if the `allowUpdateOperation` property is set to true.| |additionalUpdateRequestTemplates?|`{ [contentType: string]: string; }`|Optional Update Request Templates for content-types other than `application/json`. Use the `updateRequestTemplate` property to set the request template for the `application/json` content-type. This property can only be specified if the `allowUpdateOperation` property is set to true.| |updateIntegrationResponses?|[`api.IntegrationResponses[]`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.IntegrationResponse.html)|Optional, custom API Gateway Integration Response for the update method. This property can only be specified if the `allowUpdateOperation` property is set to true.| +|updateMethodResponses?|[`api.MethodResponses[]`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.MethodResponse.html)| Optional, custom API Gateway Method Responses for the update action. default: [{ statusCode: "200", responseParameters: { "method.response.header.Content-Type": true }},{ statusCode: "500", responseParameters: { "method.response.header.Content-Type": true } } ]| |allowDeleteOperation?|`boolean`|Whether to deploy API Gateway Method for DELETE HTTP operations on DynamoDB table (i.e. dynamodb:DeleteItem).| |deleteRequestTemplate?|`string`|API Gateway Request Template for the delete method for the default `application/json` content-type. | |additionalDeleteRequestTemplates?|`{ [contentType: string]: string; }`|Optional Delete request templates for content-types other than `application/json`. Use the `deleteRequestTemplate` property to set the request template for the `application/json` content-type. This property can only be specified if the `allowDeleteOperation` property is set to true.| |deleteIntegrationResponses?|[`api.IntegrationResponses[]`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.IntegrationResponse.html)|Optional, custom API Gateway Integration Response for the delete method. This property can only be specified if the `allowDeleteOperation` property is set to true.| +|deleteMethodResponses?|[`api.MethodResponses[]`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.MethodResponse.html)| Optional, custom API Gateway Method Responses for the delete action. default: [{ statusCode: "200", responseParameters: { "method.response.header.Content-Type": true }},{ statusCode: "500", responseParameters: { "method.response.header.Content-Type": true } } ]| |logGroupProps?|[`logs.LogGroupProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_logs.LogGroupProps.html)|User provided props to override the default props for for the CloudWatchLogs LogGroup.| ## Pattern Properties diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/lib/index.ts b/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/lib/index.ts index 84cc33e36..2b2315eb0 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/lib/index.ts +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/lib/index.ts @@ -77,6 +77,25 @@ export interface ApiGatewayToDynamoDBProps { * @default - [{statusCode:"200"},{statusCode:"500",responseTemplates:{"text/html":"Error"},selectionPattern:"500"}] */ readonly createIntegrationResponses?: api.IntegrationResponse[]; + /** + * Optional, custom API Gateway Method Responses for the create action. + * + * @default - [ + * { + * statusCode: "200", + * responseParameters: { + * "method.response.header.Content-Type": true + * } + * }, + * { + * statusCode: "500", + * responseParameters: { + * "method.response.header.Content-Type": true + * }, + * } + * ] + */ + readonly createMethodResponses?: api.MethodResponse[]; /** * Whether to deploy an API Gateway Method for GET HTTP operations on DynamoDB table (i.e. dynamodb:Query). * @@ -112,6 +131,25 @@ export interface ApiGatewayToDynamoDBProps { * @default - [{statusCode:"200"},{statusCode:"500",responseTemplates:{"text/html":"Error"},selectionPattern:"500"}] */ readonly readIntegrationResponses?: api.IntegrationResponse[]; + /** + * Optional, custom API Gateway Method Responses for the read action. + * + * @default - [ + * { + * statusCode: "200", + * responseParameters: { + * "method.response.header.Content-Type": true + * } + * }, + * { + * statusCode: "500", + * responseParameters: { + * "method.response.header.Content-Type": true + * }, + * } + * ] + */ + readonly readMethodResponses?: api.MethodResponse[]; /** * Whether to deploy API Gateway Method for PUT HTTP operations on DynamoDB table (i.e. dynamodb:UpdateItem). * @@ -140,6 +178,25 @@ export interface ApiGatewayToDynamoDBProps { * @default - [{statusCode:"200"},{statusCode:"500",responseTemplates:{"text/html":"Error"},selectionPattern:"500"}] */ readonly updateIntegrationResponses?: api.IntegrationResponse[]; + /** + * Optional, custom API Gateway Method Responses for the update action. + * + * @default - [ + * { + * statusCode: "200", + * responseParameters: { + * "method.response.header.Content-Type": true + * } + * }, + * { + * statusCode: "500", + * responseParameters: { + * "method.response.header.Content-Type": true + * }, + * } + * ] + */ + readonly updateMethodResponses?: api.MethodResponse[]; /** * Whether to deploy API Gateway Method for DELETE HTTP operations on DynamoDB table (i.e. dynamodb:DeleteItem). * @@ -176,6 +233,25 @@ export interface ApiGatewayToDynamoDBProps { * @default - [{statusCode:"200"},{statusCode:"500",responseTemplates:{"text/html":"Error"},selectionPattern:"500"}] */ readonly deleteIntegrationResponses?: api.IntegrationResponse[]; + /** + * Optional, custom API Gateway Method Responses for the delete action. + * + * @default - [ + * { + * statusCode: "200", + * responseParameters: { + * "method.response.header.Content-Type": true + * } + * }, + * { + * statusCode: "500", + * responseParameters: { + * "method.response.header.Content-Type": true + * }, + * } + * ] + */ + readonly deleteMethodResponses?: api.MethodResponse[]; /** * User provided props to override the default props for the CloudWatchLogs LogGroup. * @@ -261,6 +337,7 @@ export class ApiGatewayToDynamoDB extends Construct { // ImplementCreateOperation has confirmed that createRequestTemplate exists) const createRequestTemplate = props.createRequestTemplate!.replace("${Table}", this.dynamoTable.tableName); this.addActionToPolicy("dynamodb:PutItem"); + const createMethodOptions: api.MethodOptions = props.createMethodResponses ? { methodResponses: props.createMethodResponses } : {}; defaults.addProxyMethodToApiResource({ service: "dynamodb", action: "PutItem", @@ -269,7 +346,8 @@ export class ApiGatewayToDynamoDB extends Construct { apiResource: this.apiGateway.root, requestTemplate: createRequestTemplate, additionalRequestTemplates: props.additionalCreateRequestTemplates, - integrationResponses: props.createIntegrationResponses + integrationResponses: props.createIntegrationResponses, + methodOptions: createMethodOptions }); } // Read @@ -286,6 +364,7 @@ export class ApiGatewayToDynamoDB extends Construct { }`; this.addActionToPolicy("dynamodb:Query"); + const readMethodOptions: api.MethodOptions = props.readMethodResponses ? { methodResponses: props.readMethodResponses } : {}; defaults.addProxyMethodToApiResource({ service: "dynamodb", action: "Query", @@ -294,7 +373,8 @@ export class ApiGatewayToDynamoDB extends Construct { apiResource: apiGatewayResource, requestTemplate: readRequestTemplate, additionalRequestTemplates: props.additionalReadRequestTemplates, - integrationResponses: props.readIntegrationResponses + integrationResponses: props.readIntegrationResponses, + methodOptions: readMethodOptions }); } // Update @@ -302,6 +382,7 @@ export class ApiGatewayToDynamoDB extends Construct { // ImplementUpdateOperation confirmed the existence of updateRequestTemplate const updateRequestTemplate = props.updateRequestTemplate!.replace("${Table}", this.dynamoTable.tableName); this.addActionToPolicy("dynamodb:UpdateItem"); + const updateMethodOptions: api.MethodOptions = props.updateMethodResponses ? { methodResponses: props.updateMethodResponses } : {}; defaults.addProxyMethodToApiResource({ service: "dynamodb", action: "UpdateItem", @@ -310,7 +391,8 @@ export class ApiGatewayToDynamoDB extends Construct { apiResource: apiGatewayResource, requestTemplate: updateRequestTemplate, additionalRequestTemplates: props.additionalUpdateRequestTemplates, - integrationResponses: props.updateIntegrationResponses + integrationResponses: props.updateIntegrationResponses, + methodOptions: updateMethodOptions }); } // Delete @@ -327,6 +409,7 @@ export class ApiGatewayToDynamoDB extends Construct { }`; this.addActionToPolicy("dynamodb:DeleteItem"); + const deleteMethodOptions: api.MethodOptions = props.deleteMethodResponses ? { methodResponses: props.deleteMethodResponses } : {}; defaults.addProxyMethodToApiResource({ service: "dynamodb", action: "DeleteItem", @@ -335,7 +418,8 @@ export class ApiGatewayToDynamoDB extends Construct { apiResource: apiGatewayResource, requestTemplate: deleteRequestTemplate, additionalRequestTemplates: props.additionalDeleteRequestTemplates, - integrationResponses: props.deleteIntegrationResponses + integrationResponses: props.deleteIntegrationResponses, + methodOptions: deleteMethodOptions }); } } diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/apigateway-dynamodb.test.ts b/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/apigateway-dynamodb.test.ts index d3b0ca594..50cedf1e8 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/apigateway-dynamodb.test.ts +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/apigateway-dynamodb.test.ts @@ -774,3 +774,112 @@ test('Test that CheckDynamoDBProps is getting called', () => { // Assertion expect(app).toThrowError(/Error - Either provide existingTableObj or dynamoTableProps, but not both.\n/); }); + +test("provide createMethodResponses", () => { + const stack = new Stack(); + const apiGatewayToDynamoDBProps: ApiGatewayToDynamoDBProps = { + allowCreateOperation: true, + createRequestTemplate: "fingerprint", + createMethodResponses: [{ + statusCode: "100" + }] + }; + new ApiGatewayToDynamoDB(stack, "test-api-gateway-dynamodb", apiGatewayToDynamoDBProps); + + const template = Template.fromStack(stack); + // Checking for fingerprint ensures we're looking at the correct Method + template.hasResourceProperties("AWS::ApiGateway::Method", { + HttpMethod: "POST", + Integration: { + RequestTemplates: { + "application/json": "fingerprint" + } + }, + MethodResponses: [ + { + StatusCode: "100" + } + ] + }); +}); + +test("provide readMethodResponses", () => { + const stack = new Stack(); + const apiGatewayToDynamoDBProps: ApiGatewayToDynamoDBProps = { + allowReadOperation: true, + readRequestTemplate: "fingerprint", + readMethodResponses: [{ + statusCode: "100" + }] + }; + new ApiGatewayToDynamoDB(stack, "test-api-gateway-dynamodb", apiGatewayToDynamoDBProps); + + const template = Template.fromStack(stack); + template.hasResourceProperties("AWS::ApiGateway::Method", { + HttpMethod: "GET", + Integration: { + RequestTemplates: { + "application/json": "fingerprint" + } + }, + MethodResponses: [ + { + StatusCode: "100" + } + ] + }); +}); + +test("provide updateMethodResponses", () => { + const stack = new Stack(); + const apiGatewayToDynamoDBProps: ApiGatewayToDynamoDBProps = { + allowUpdateOperation: true, + updateRequestTemplate: "fingerprint", + updateMethodResponses: [{ + statusCode: "100" + }] + }; + new ApiGatewayToDynamoDB(stack, "test-api-gateway-dynamodb", apiGatewayToDynamoDBProps); + + const template = Template.fromStack(stack); + template.hasResourceProperties("AWS::ApiGateway::Method", { + HttpMethod: "PUT", + Integration: { + RequestTemplates: { + "application/json": "fingerprint" + } + }, + MethodResponses: [ + { + StatusCode: "100" + } + ] + }); +}); + +test("provide deleteMethodResponses", () => { + const stack = new Stack(); + const apiGatewayToDynamoDBProps: ApiGatewayToDynamoDBProps = { + allowDeleteOperation: true, + deleteRequestTemplate: "fingerprint", + deleteMethodResponses: [{ + statusCode: "100" + }] + }; + new ApiGatewayToDynamoDB(stack, "test-api-gateway-dynamodb", apiGatewayToDynamoDBProps); + + const template = Template.fromStack(stack); + template.hasResourceProperties("AWS::ApiGateway::Method", { + HttpMethod: "DELETE", + Integration: { + RequestTemplates: { + "application/json": "fingerprint" + } + }, + MethodResponses: [ + { + StatusCode: "100" + } + ] + }); +}); diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/integ.apiddb-custom-method-response.js.snapshot/apiddb-custom-method-response.assets.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/integ.apiddb-custom-method-response.js.snapshot/apiddb-custom-method-response.assets.json new file mode 100644 index 000000000..b7d5d6fc4 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/integ.apiddb-custom-method-response.js.snapshot/apiddb-custom-method-response.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.0", + "files": { + "7913a7050e5c393d80027306c7e295d8910401b542b654afce863313ba52d253": { + "source": { + "path": "apiddb-custom-method-response.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "7913a7050e5c393d80027306c7e295d8910401b542b654afce863313ba52d253.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/integ.apiddb-custom-method-response.js.snapshot/apiddb-custom-method-response.template.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/integ.apiddb-custom-method-response.js.snapshot/apiddb-custom-method-response.template.json new file mode 100644 index 000000000..b593b33e5 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/integ.apiddb-custom-method-response.js.snapshot/apiddb-custom-method-response.template.json @@ -0,0 +1,489 @@ +{ + "Description": "Integration Test for aws-apigateway-dynamodb", + "Resources": { + "existingtableE51CCC93": { + "Type": "AWS::DynamoDB::Table", + "Properties": { + "AttributeDefinitions": [ + { + "AttributeName": "id", + "AttributeType": "S" + } + ], + "BillingMode": "PAY_PER_REQUEST", + "KeySchema": [ + { + "AttributeName": "id", + "KeyType": "HASH" + } + ], + "PointInTimeRecoverySpecification": { + "PointInTimeRecoveryEnabled": true + }, + "SSESpecification": { + "SSEEnabled": true + } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "testapigatewaydynamodbadditionalrequesttemplatesApiAccessLogGroupAF75D750": { + "Type": "AWS::Logs::LogGroup", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain", + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W86", + "reason": "Retention period for CloudWatchLogs LogGroups are set to 'Never Expire' to preserve customer data indefinitely" + }, + { + "id": "W84", + "reason": "By default CloudWatchLogs LogGroups data is encrypted using the CloudWatch server-side encryption keys (AWS Managed Keys)" + } + ] + } + } + }, + "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C": { + "Type": "AWS::ApiGateway::RestApi", + "Properties": { + "EndpointConfiguration": { + "Types": [ + "EDGE" + ] + }, + "Name": "RestApi" + } + }, + "testapigatewaydynamodbadditionalrequesttemplatesRestApiDeployment0AE7C47799d5eb6ebbe5fc8402f3118bd7d77b35": { + "Type": "AWS::ApiGateway::Deployment", + "Properties": { + "Description": "Automatically created by the RestApi construct", + "RestApiId": { + "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C" + } + }, + "DependsOn": [ + "testapigatewaydynamodbadditionalrequesttemplatesRestApiidDELETEF6A7D04D", + "testapigatewaydynamodbadditionalrequesttemplatesRestApiidGET05129D15", + "testapigatewaydynamodbadditionalrequesttemplatesRestApiidA77CCE90" + ], + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W45", + "reason": "ApiGateway has AccessLogging enabled in AWS::ApiGateway::Stage resource, but cfn_nag checks for it in AWS::ApiGateway::Deployment resource" + } + ] + } + } + }, + "testapigatewaydynamodbadditionalrequesttemplatesRestApiDeploymentStageprod33ED5D23": { + "Type": "AWS::ApiGateway::Stage", + "Properties": { + "AccessLogSetting": { + "DestinationArn": { + "Fn::GetAtt": [ + "testapigatewaydynamodbadditionalrequesttemplatesApiAccessLogGroupAF75D750", + "Arn" + ] + }, + "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\"}" + }, + "DeploymentId": { + "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApiDeployment0AE7C47799d5eb6ebbe5fc8402f3118bd7d77b35" + }, + "MethodSettings": [ + { + "DataTraceEnabled": false, + "HttpMethod": "*", + "LoggingLevel": "INFO", + "ResourcePath": "/*" + } + ], + "RestApiId": { + "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C" + }, + "StageName": "prod", + "TracingEnabled": true + } + }, + "testapigatewaydynamodbadditionalrequesttemplatesRestApiidA77CCE90": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Fn::GetAtt": [ + "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C", + "RootResourceId" + ] + }, + "PathPart": "{id}", + "RestApiId": { + "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C" + } + } + }, + "testapigatewaydynamodbadditionalrequesttemplatesRestApiidGET05129D15": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "AWS_IAM", + "HttpMethod": "GET", + "Integration": { + "Credentials": { + "Fn::GetAtt": [ + "testapigatewaydynamodbadditionalrequesttemplatesapigatewayroleFDAECAC6", + "Arn" + ] + }, + "IntegrationHttpMethod": "POST", + "IntegrationResponses": [ + { + "StatusCode": "200" + }, + { + "ResponseTemplates": { + "text/html": "Error" + }, + "SelectionPattern": "500", + "StatusCode": "500" + } + ], + "PassthroughBehavior": "NEVER", + "RequestParameters": { + "integration.request.header.Content-Type": "'application/json'" + }, + "RequestTemplates": { + "application/json": { + "Fn::Join": [ + "", + [ + "{ \"TableName\": \"", + { + "Ref": "existingtableE51CCC93" + }, + "\", \"KeyConditionExpression\": \"id = :v1\", \"ExpressionAttributeValues\": { \":v1\": { \"S\": \"$input.params('id')\" } } }" + ] + ] + } + }, + "Type": "AWS", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":dynamodb:action/Query" + ] + ] + } + }, + "MethodResponses": [ + { + "ResponseParameters": { + "method.response.header.Content-Type": true + }, + "StatusCode": "200" + }, + { + "ResponseParameters": { + "method.response.header.Content-Type": true + }, + "StatusCode": "500" + } + ], + "ResourceId": { + "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApiidA77CCE90" + }, + "RestApiId": { + "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C" + } + } + }, + "testapigatewaydynamodbadditionalrequesttemplatesRestApiidDELETEF6A7D04D": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "AWS_IAM", + "HttpMethod": "DELETE", + "Integration": { + "Credentials": { + "Fn::GetAtt": [ + "testapigatewaydynamodbadditionalrequesttemplatesapigatewayroleFDAECAC6", + "Arn" + ] + }, + "IntegrationHttpMethod": "POST", + "IntegrationResponses": [ + { + "ResponseTemplates": { + "text/html": "OK" + }, + "StatusCode": "200" + }, + { + "ResponseTemplates": { + "text/html": "IntegrationTestError" + }, + "StatusCode": "400" + } + ], + "PassthroughBehavior": "NEVER", + "RequestParameters": { + "integration.request.header.Content-Type": "'application/json'" + }, + "RequestTemplates": { + "application/json": { + "Fn::Join": [ + "", + [ + "{ \"TableName\": \"", + { + "Ref": "existingtableE51CCC93" + }, + "\", \"Key\": { \"id\": { \"S\": \"$input.params('id')\" } }, \"ReturnValues\": \"ALL_OLD\" }" + ] + ] + } + }, + "Type": "AWS", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":dynamodb:action/DeleteItem" + ] + ] + } + }, + "MethodResponses": [ + { + "StatusCode": "200" + }, + { + "StatusCode": "400" + } + ], + "ResourceId": { + "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApiidA77CCE90" + }, + "RestApiId": { + "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C" + } + } + }, + "testapigatewaydynamodbadditionalrequesttemplatesRestApiUsagePlan905D10C7": { + "Type": "AWS::ApiGateway::UsagePlan", + "Properties": { + "ApiStages": [ + { + "ApiId": { + "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C" + }, + "Stage": { + "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApiDeploymentStageprod33ED5D23" + }, + "Throttle": {} + } + ] + } + }, + "testapigatewaydynamodbadditionalrequesttemplatesLambdaRestApiCloudWatchRole51265771": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "apigateway.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Policies": [ + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:DescribeLogGroups", + "logs:DescribeLogStreams", + "logs:FilterLogEvents", + "logs:GetLogEvents", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":*" + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "LambdaRestApiCloudWatchRolePolicy" + } + ] + } + }, + "testapigatewaydynamodbadditionalrequesttemplatesLambdaRestApiAccount8891474D": { + "Type": "AWS::ApiGateway::Account", + "Properties": { + "CloudWatchRoleArn": { + "Fn::GetAtt": [ + "testapigatewaydynamodbadditionalrequesttemplatesLambdaRestApiCloudWatchRole51265771", + "Arn" + ] + } + }, + "DependsOn": [ + "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C" + ] + }, + "testapigatewaydynamodbadditionalrequesttemplatesapigatewayroleFDAECAC6": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "apigateway.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "testapigatewaydynamodbadditionalrequesttemplatesapigatewayroleDefaultPolicy4C47B35E": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "dynamodb:DeleteItem", + "dynamodb:Query" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "existingtableE51CCC93", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "testapigatewaydynamodbadditionalrequesttemplatesapigatewayroleDefaultPolicy4C47B35E", + "Roles": [ + { + "Ref": "testapigatewaydynamodbadditionalrequesttemplatesapigatewayroleFDAECAC6" + } + ] + } + } + }, + "Outputs": { + "testapigatewaydynamodbadditionalrequesttemplatesRestApiEndpoint855E7762": { + "Value": { + "Fn::Join": [ + "", + [ + "https://", + { + "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C" + }, + ".execute-api.", + { + "Ref": "AWS::Region" + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApiDeploymentStageprod33ED5D23" + }, + "/" + ] + ] + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/integ.apiddb-custom-method-response.js.snapshot/apiddbcustommethodresponseIntegDefaultTestDeployAssertAC6F68EC.assets.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/integ.apiddb-custom-method-response.js.snapshot/apiddbcustommethodresponseIntegDefaultTestDeployAssertAC6F68EC.assets.json new file mode 100644 index 000000000..41b1607d2 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/integ.apiddb-custom-method-response.js.snapshot/apiddbcustommethodresponseIntegDefaultTestDeployAssertAC6F68EC.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "apiddbcustommethodresponseIntegDefaultTestDeployAssertAC6F68EC.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/integ.apiddb-custom-method-response.js.snapshot/apiddbcustommethodresponseIntegDefaultTestDeployAssertAC6F68EC.template.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/integ.apiddb-custom-method-response.js.snapshot/apiddbcustommethodresponseIntegDefaultTestDeployAssertAC6F68EC.template.json new file mode 100644 index 000000000..ad9d0fb73 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/integ.apiddb-custom-method-response.js.snapshot/apiddbcustommethodresponseIntegDefaultTestDeployAssertAC6F68EC.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/integ.apiddb-custom-method-response.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/integ.apiddb-custom-method-response.js.snapshot/cdk.out new file mode 100644 index 000000000..1f0068d32 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/integ.apiddb-custom-method-response.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"36.0.0"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/integ.apiddb-custom-method-response.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/integ.apiddb-custom-method-response.js.snapshot/integ.json new file mode 100644 index 000000000..21d9c8174 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/integ.apiddb-custom-method-response.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "36.0.0", + "testCases": { + "apiddb-custom-method-response/Integ/DefaultTest": { + "stacks": [ + "apiddb-custom-method-response" + ], + "assertionStack": "apiddb-custom-method-response/Integ/DefaultTest/DeployAssert", + "assertionStackName": "apiddbcustommethodresponseIntegDefaultTestDeployAssertAC6F68EC" + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/integ.apiddb-custom-method-response.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/integ.apiddb-custom-method-response.js.snapshot/manifest.json new file mode 100644 index 000000000..0be344028 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/integ.apiddb-custom-method-response.js.snapshot/manifest.json @@ -0,0 +1,191 @@ +{ + "version": "36.0.0", + "artifacts": { + "apiddbcustommethodresponseIntegDefaultTestDeployAssertAC6F68EC.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "apiddbcustommethodresponseIntegDefaultTestDeployAssertAC6F68EC.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "apiddbcustommethodresponseIntegDefaultTestDeployAssertAC6F68EC": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "apiddbcustommethodresponseIntegDefaultTestDeployAssertAC6F68EC.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "apiddbcustommethodresponseIntegDefaultTestDeployAssertAC6F68EC.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "apiddbcustommethodresponseIntegDefaultTestDeployAssertAC6F68EC.assets" + ], + "metadata": { + "/apiddb-custom-method-response/Integ/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/apiddb-custom-method-response/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "apiddb-custom-method-response/Integ/DefaultTest/DeployAssert" + }, + "apiddb-custom-method-response.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "apiddb-custom-method-response.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "apiddb-custom-method-response": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "apiddb-custom-method-response.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/7913a7050e5c393d80027306c7e295d8910401b542b654afce863313ba52d253.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "apiddb-custom-method-response.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "apiddb-custom-method-response.assets" + ], + "metadata": { + "/apiddb-custom-method-response/existing-table/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "existingtableE51CCC93" + } + ], + "/apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/ApiAccessLogGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaydynamodbadditionalrequesttemplatesApiAccessLogGroupAF75D750" + } + ], + "/apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/RestApi/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C" + } + ], + "/apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/RestApi/Deployment/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaydynamodbadditionalrequesttemplatesRestApiDeployment0AE7C47799d5eb6ebbe5fc8402f3118bd7d77b35" + } + ], + "/apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/RestApi/DeploymentStage.prod/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaydynamodbadditionalrequesttemplatesRestApiDeploymentStageprod33ED5D23" + } + ], + "/apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/RestApi/Endpoint": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaydynamodbadditionalrequesttemplatesRestApiEndpoint855E7762" + } + ], + "/apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/RestApi/Default/{id}/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaydynamodbadditionalrequesttemplatesRestApiidA77CCE90" + } + ], + "/apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/RestApi/Default/{id}/GET/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaydynamodbadditionalrequesttemplatesRestApiidGET05129D15" + } + ], + "/apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/RestApi/Default/{id}/DELETE/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaydynamodbadditionalrequesttemplatesRestApiidDELETEF6A7D04D" + } + ], + "/apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/RestApi/UsagePlan/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaydynamodbadditionalrequesttemplatesRestApiUsagePlan905D10C7" + } + ], + "/apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/LambdaRestApiCloudWatchRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaydynamodbadditionalrequesttemplatesLambdaRestApiCloudWatchRole51265771" + } + ], + "/apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/LambdaRestApiAccount": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaydynamodbadditionalrequesttemplatesLambdaRestApiAccount8891474D" + } + ], + "/apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/api-gateway-role/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaydynamodbadditionalrequesttemplatesapigatewayroleFDAECAC6" + } + ], + "/apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/api-gateway-role/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaydynamodbadditionalrequesttemplatesapigatewayroleDefaultPolicy4C47B35E" + } + ], + "/apiddb-custom-method-response/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/apiddb-custom-method-response/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "apiddb-custom-method-response" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/integ.apiddb-custom-method-response.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/integ.apiddb-custom-method-response.js.snapshot/tree.json new file mode 100644 index 000000000..63a68829e --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/integ.apiddb-custom-method-response.js.snapshot/tree.json @@ -0,0 +1,764 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "apiddb-custom-method-response": { + "id": "apiddb-custom-method-response", + "path": "apiddb-custom-method-response", + "children": { + "existing-table": { + "id": "existing-table", + "path": "apiddb-custom-method-response/existing-table", + "children": { + "Resource": { + "id": "Resource", + "path": "apiddb-custom-method-response/existing-table/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::DynamoDB::Table", + "aws:cdk:cloudformation:props": { + "attributeDefinitions": [ + { + "attributeName": "id", + "attributeType": "S" + } + ], + "billingMode": "PAY_PER_REQUEST", + "keySchema": [ + { + "attributeName": "id", + "keyType": "HASH" + } + ], + "pointInTimeRecoverySpecification": { + "pointInTimeRecoveryEnabled": true + }, + "sseSpecification": { + "sseEnabled": true + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_dynamodb.CfnTable", + "version": "2.145.0" + } + }, + "ScalingRole": { + "id": "ScalingRole", + "path": "apiddb-custom-method-response/existing-table/ScalingRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_dynamodb.Table", + "version": "2.145.0" + } + }, + "test-api-gateway-dynamodb-additional-request-templates": { + "id": "test-api-gateway-dynamodb-additional-request-templates", + "path": "apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates", + "children": { + "ApiAccessLogGroup": { + "id": "ApiAccessLogGroup", + "path": "apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/ApiAccessLogGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/ApiAccessLogGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", + "aws:cdk:cloudformation:props": {} + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.CfnLogGroup", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.LogGroup", + "version": "2.145.0" + } + }, + "RestApi": { + "id": "RestApi", + "path": "apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/RestApi", + "children": { + "Resource": { + "id": "Resource", + "path": "apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/RestApi/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::RestApi", + "aws:cdk:cloudformation:props": { + "endpointConfiguration": { + "types": [ + "EDGE" + ] + }, + "name": "RestApi" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnRestApi", + "version": "2.145.0" + } + }, + "Deployment": { + "id": "Deployment", + "path": "apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/RestApi/Deployment", + "children": { + "Resource": { + "id": "Resource", + "path": "apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/RestApi/Deployment/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Deployment", + "aws:cdk:cloudformation:props": { + "description": "Automatically created by the RestApi construct", + "restApiId": { + "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnDeployment", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.Deployment", + "version": "2.145.0" + } + }, + "DeploymentStage.prod": { + "id": "DeploymentStage.prod", + "path": "apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/RestApi/DeploymentStage.prod", + "children": { + "Resource": { + "id": "Resource", + "path": "apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/RestApi/DeploymentStage.prod/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Stage", + "aws:cdk:cloudformation:props": { + "accessLogSetting": { + "destinationArn": { + "Fn::GetAtt": [ + "testapigatewaydynamodbadditionalrequesttemplatesApiAccessLogGroupAF75D750", + "Arn" + ] + }, + "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\"}" + }, + "deploymentId": { + "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApiDeployment0AE7C47799d5eb6ebbe5fc8402f3118bd7d77b35" + }, + "methodSettings": [ + { + "httpMethod": "*", + "resourcePath": "/*", + "dataTraceEnabled": false, + "loggingLevel": "INFO" + } + ], + "restApiId": { + "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C" + }, + "stageName": "prod", + "tracingEnabled": true + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnStage", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.Stage", + "version": "2.145.0" + } + }, + "Endpoint": { + "id": "Endpoint", + "path": "apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/RestApi/Endpoint", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnOutput", + "version": "2.145.0" + } + }, + "Default": { + "id": "Default", + "path": "apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/RestApi/Default", + "children": { + "{id}": { + "id": "{id}", + "path": "apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/RestApi/Default/{id}", + "children": { + "Resource": { + "id": "Resource", + "path": "apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/RestApi/Default/{id}/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Resource", + "aws:cdk:cloudformation:props": { + "parentId": { + "Fn::GetAtt": [ + "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C", + "RootResourceId" + ] + }, + "pathPart": "{id}", + "restApiId": { + "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnResource", + "version": "2.145.0" + } + }, + "GET": { + "id": "GET", + "path": "apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/RestApi/Default/{id}/GET", + "children": { + "Resource": { + "id": "Resource", + "path": "apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/RestApi/Default/{id}/GET/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Method", + "aws:cdk:cloudformation:props": { + "authorizationType": "AWS_IAM", + "httpMethod": "GET", + "integration": { + "type": "AWS", + "uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":dynamodb:action/Query" + ] + ] + }, + "integrationHttpMethod": "POST", + "requestParameters": { + "integration.request.header.Content-Type": "'application/json'" + }, + "requestTemplates": { + "application/json": { + "Fn::Join": [ + "", + [ + "{ \"TableName\": \"", + { + "Ref": "existingtableE51CCC93" + }, + "\", \"KeyConditionExpression\": \"id = :v1\", \"ExpressionAttributeValues\": { \":v1\": { \"S\": \"$input.params('id')\" } } }" + ] + ] + } + }, + "passthroughBehavior": "NEVER", + "integrationResponses": [ + { + "statusCode": "200" + }, + { + "statusCode": "500", + "responseTemplates": { + "text/html": "Error" + }, + "selectionPattern": "500" + } + ], + "credentials": { + "Fn::GetAtt": [ + "testapigatewaydynamodbadditionalrequesttemplatesapigatewayroleFDAECAC6", + "Arn" + ] + } + }, + "methodResponses": [ + { + "statusCode": "200", + "responseParameters": { + "method.response.header.Content-Type": true + } + }, + { + "statusCode": "500", + "responseParameters": { + "method.response.header.Content-Type": true + } + } + ], + "resourceId": { + "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApiidA77CCE90" + }, + "restApiId": { + "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.Method", + "version": "2.145.0" + } + }, + "DELETE": { + "id": "DELETE", + "path": "apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/RestApi/Default/{id}/DELETE", + "children": { + "Resource": { + "id": "Resource", + "path": "apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/RestApi/Default/{id}/DELETE/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Method", + "aws:cdk:cloudformation:props": { + "authorizationType": "AWS_IAM", + "httpMethod": "DELETE", + "integration": { + "type": "AWS", + "uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":dynamodb:action/DeleteItem" + ] + ] + }, + "integrationHttpMethod": "POST", + "requestParameters": { + "integration.request.header.Content-Type": "'application/json'" + }, + "requestTemplates": { + "application/json": { + "Fn::Join": [ + "", + [ + "{ \"TableName\": \"", + { + "Ref": "existingtableE51CCC93" + }, + "\", \"Key\": { \"id\": { \"S\": \"$input.params('id')\" } }, \"ReturnValues\": \"ALL_OLD\" }" + ] + ] + } + }, + "passthroughBehavior": "NEVER", + "integrationResponses": [ + { + "statusCode": "200", + "responseTemplates": { + "text/html": "OK" + } + }, + { + "statusCode": "400", + "responseTemplates": { + "text/html": "IntegrationTestError" + } + } + ], + "credentials": { + "Fn::GetAtt": [ + "testapigatewaydynamodbadditionalrequesttemplatesapigatewayroleFDAECAC6", + "Arn" + ] + } + }, + "methodResponses": [ + { + "statusCode": "200" + }, + { + "statusCode": "400" + } + ], + "resourceId": { + "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApiidA77CCE90" + }, + "restApiId": { + "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.Method", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.Resource", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.ResourceBase", + "version": "2.145.0" + } + }, + "UsagePlan": { + "id": "UsagePlan", + "path": "apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/RestApi/UsagePlan", + "children": { + "Resource": { + "id": "Resource", + "path": "apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/RestApi/UsagePlan/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::UsagePlan", + "aws:cdk:cloudformation:props": { + "apiStages": [ + { + "apiId": { + "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C" + }, + "stage": { + "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApiDeploymentStageprod33ED5D23" + }, + "throttle": {} + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnUsagePlan", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.UsagePlan", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.RestApi", + "version": "2.145.0" + } + }, + "LambdaRestApiCloudWatchRole": { + "id": "LambdaRestApiCloudWatchRole", + "path": "apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/LambdaRestApiCloudWatchRole", + "children": { + "ImportLambdaRestApiCloudWatchRole": { + "id": "ImportLambdaRestApiCloudWatchRole", + "path": "apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/LambdaRestApiCloudWatchRole/ImportLambdaRestApiCloudWatchRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.145.0" + } + }, + "Resource": { + "id": "Resource", + "path": "apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/LambdaRestApiCloudWatchRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "apigateway.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "policies": [ + { + "policyName": "LambdaRestApiCloudWatchRolePolicy", + "policyDocument": { + "Statement": [ + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:DescribeLogGroups", + "logs:DescribeLogStreams", + "logs:FilterLogEvents", + "logs:GetLogEvents", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":*" + ] + ] + } + } + ], + "Version": "2012-10-17" + } + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.145.0" + } + }, + "LambdaRestApiAccount": { + "id": "LambdaRestApiAccount", + "path": "apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/LambdaRestApiAccount", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Account", + "aws:cdk:cloudformation:props": { + "cloudWatchRoleArn": { + "Fn::GetAtt": [ + "testapigatewaydynamodbadditionalrequesttemplatesLambdaRestApiCloudWatchRole51265771", + "Arn" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnAccount", + "version": "2.145.0" + } + }, + "api-gateway-role": { + "id": "api-gateway-role", + "path": "apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/api-gateway-role", + "children": { + "Importapi-gateway-role": { + "id": "Importapi-gateway-role", + "path": "apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/api-gateway-role/Importapi-gateway-role", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.145.0" + } + }, + "Resource": { + "id": "Resource", + "path": "apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/api-gateway-role/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "apigateway.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.145.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/api-gateway-role/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "apiddb-custom-method-response/test-api-gateway-dynamodb-additional-request-templates/api-gateway-role/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": [ + "dynamodb:DeleteItem", + "dynamodb:Query" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "existingtableE51CCC93", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "policyName": "testapigatewaydynamodbadditionalrequesttemplatesapigatewayroleDefaultPolicy4C47B35E", + "roles": [ + { + "Ref": "testapigatewaydynamodbadditionalrequesttemplatesapigatewayroleFDAECAC6" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Policy", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-solutions-constructs/aws-apigateway-dynamodb.ApiGatewayToDynamoDB", + "version": "2.59.0" + } + }, + "Integ": { + "id": "Integ", + "path": "apiddb-custom-method-response/Integ", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "apiddb-custom-method-response/Integ/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "apiddb-custom-method-response/Integ/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "apiddb-custom-method-response/Integ/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "apiddb-custom-method-response/Integ/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "2.145.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "apiddb-custom-method-response/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "2.145.0-alpha.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "2.145.0-alpha.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "apiddb-custom-method-response/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "2.145.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "apiddb-custom-method-response/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "2.145.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.App", + "version": "2.145.0" + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/integ.apiddb-custom-method-response.ts b/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/integ.apiddb-custom-method-response.ts new file mode 100644 index 000000000..919c7a782 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/integ.apiddb-custom-method-response.ts @@ -0,0 +1,66 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance + * with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES + * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +// Imports +import { App, Stack } from "aws-cdk-lib"; +import { ApiGatewayToDynamoDB } from "../lib"; +import { generateIntegStackName } from '@aws-solutions-constructs/core'; +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; +import * as dynamodb from "aws-cdk-lib/aws-dynamodb"; + +// Setup +const app = new App(); +const stack = new Stack(app, generateIntegStackName(__filename)); +stack.templateOptions.description = 'Integration Test for aws-apigateway-dynamodb'; + +const partitionKeyName = 'id'; + +const existingTableObj = new dynamodb.Table(stack, 'existing-table', { + partitionKey: { + name: partitionKeyName, + type: dynamodb.AttributeType.STRING, + }, + pointInTimeRecovery: true, + encryption: dynamodb.TableEncryption.AWS_MANAGED, + billingMode: dynamodb.BillingMode.PAY_PER_REQUEST +}); + +new ApiGatewayToDynamoDB(stack, 'test-api-gateway-dynamodb-additional-request-templates', { + existingTableObj, + allowDeleteOperation: true, + deleteIntegrationResponses: [ + { + statusCode: '200', + responseTemplates: { + 'text/html': 'OK' + } + }, + { + statusCode: '400', + responseTemplates: { + 'text/html': 'IntegrationTestError' + } + } + ], + deleteMethodResponses: [{ + statusCode: "200" + }, + { + statusCode: "400" + }] +}); + +// Synth +new IntegTest(stack, 'Integ', { testCases: [ + stack +] }); diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-iot/lib/index.ts b/source/patterns/@aws-solutions-constructs/aws-apigateway-iot/lib/index.ts index 33fa931ab..b8ba880c9 100755 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-iot/lib/index.ts +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-iot/lib/index.ts @@ -259,6 +259,7 @@ export class ApiGatewayToIot extends Construct { const resourceMethodOptions = { requestParameters: methodReqParams, methodResponses: methodResp, + requestValidator: this.requestValidator, }; const resourceMethodParams: defaults.AddProxyMethodToApiResourceInputParams = { @@ -268,7 +269,6 @@ export class ApiGatewayToIot extends Construct { apiMethod: 'POST', apiResource: resource, requestTemplate: "$input.json('$')", - requestValidator: this.requestValidator, awsIntegrationProps: integrationReqProps, methodOptions: resourceMethodOptions }; diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/README.md b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/README.md index ab85b9a29..29c7114d9 100755 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/README.md +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/README.md @@ -64,11 +64,12 @@ new ApiGatewayToKinesisStreams(this, "test-apigw-kinesis", new ApiGatewayToKines |additionalPutRecordRequestTemplates?|`{ [contentType: string]: string; }`|Optional PutRecord Request Templates for content-types other than `application/json`. Use the `putRecordRequestTemplate` property to set the request template for the `application/json` content-type.| |putRecordRequestModel?|[`api.ModelOptions`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.ModelOptions.html)|API Gateway request model for the PutRecord action. If not provided, a default one will be created.| |putRecordIntegrationResponses?|[`api.IntegrationResponses[]`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.IntegrationResponse.html)|Optional, custom API Gateway Integration Response for the PutRecord action.| +|putRecordMethodResponses?|[`api.MethodResponses[]`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.MethodResponse.html)| Optional, custom API Gateway Method Responses for the putRecord action. default: [{ statusCode: "200", responseParameters: { "method.response.header.Content-Type": true }},{ statusCode: "500", responseParameters: { "method.response.header.Content-Type": true } } ]| |putRecordsRequestTemplate?|`string`|API Gateway request template for the PutRecords action. If not provided, a default one will be used.| |additionalPutRecordsRequestTemplates?|`{ [contentType: string]: string; }`|Optional PutRecords Request Templates for content-types other than `application/json`. Use the `putRecordsRequestTemplate` property to set the request template for the `application/json` content-type.| -|putRecordsRequestModel?|[`api.ModelOptions`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.ModelOptions.html)| -API Gateway request model for the PutRecords action. If not provided, a default one will be created.| +|putRecordsRequestModel?|[`api.ModelOptions`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.ModelOptions.html)| API Gateway request model for the PutRecords action. If not provided, a default one will be created.| |putRecordsIntegrationResponses?|[`api.IntegrationResponses[]`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.IntegrationResponse.html)|Optional, custom API Gateway Integration Response for the PutRecords action.| +|putRecordsMethodResponses?|[`api.MethodResponses[]`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.MethodResponse.html)| Optional, custom API Gateway Method Responses for the putRecords action. default: [{ statusCode: "200", responseParameters: { "method.response.header.Content-Type": true }},{ statusCode: "500", responseParameters: { "method.response.header.Content-Type": true } } ]| |existingStreamObj?|[`kinesis.Stream`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kinesis.Stream.html)|Existing instance of Kinesis Stream, providing both this and `kinesisStreamProps` will cause an error.| |kinesisStreamProps?|[`kinesis.StreamProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kinesis.StreamProps.html)|Optional user-provided props to override the default props for the Kinesis stream.| |logGroupProps?|[`logs.LogGroupProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_logs.LogGroupProps.html)|User provided props to override the default props for for the CloudWatchLogs LogGroup.| diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/lib/index.ts b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/lib/index.ts index 767bc37c4..090c8cf05 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/lib/index.ts +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/lib/index.ts @@ -60,6 +60,25 @@ export interface ApiGatewayToKinesisStreamsProps { * @default - [{statusCode:"200"},{statusCode:"500",responseTemplates:{"text/html":"Error"},selectionPattern:"500"}] */ readonly putRecordIntegrationResponses?: api.IntegrationResponse[]; + /** + * Optional, custom API Gateway Method Responses for the PutRecord action. + * + * @default - [ + * { + * statusCode: "200", + * responseParameters: { + * "method.response.header.Content-Type": true + * } + * }, + * { + * statusCode: "500", + * responseParameters: { + * "method.response.header.Content-Type": true + * }, + * } + * ] + */ + readonly putRecordMethodResponses?: api.MethodResponse[]; /** * API Gateway request template for the PutRecords action for the default `application/json` content-type. * If not provided, a default one will be used. @@ -85,11 +104,30 @@ export interface ApiGatewayToKinesisStreamsProps { */ readonly putRecordsRequestModel?: api.ModelOptions; /** - * Optional, custom API Gateway Integration Response for the PutRecord action. + * Optional, custom API Gateway Integration Response for the PutRecords action. * * @default - [{statusCode:"200"},{statusCode:"500",responseTemplates:{"text/html":"Error"},selectionPattern:"500"}] */ readonly putRecordsIntegrationResponses?: api.IntegrationResponse[]; + /** + * Optional, custom API Gateway Method Responses for the PutRecord action. + * + * @default - [ + * { + * statusCode: "200", + * responseParameters: { + * "method.response.header.Content-Type": true + * } + * }, + * { + * statusCode: "500", + * responseParameters: { + * "method.response.header.Content-Type": true + * }, + * } + * ] + */ + readonly putRecordsMethodResponses?: api.MethodResponse[]; /** * Existing instance of Kinesis Stream, providing both this and `kinesisStreamProps` will cause an error. * @@ -163,6 +201,13 @@ export class ApiGatewayToKinesisStreams extends Construct { validateRequestBody: true }); + let putRecordMethodOptions: api.MethodOptions = { + requestValidator, + requestModels: { 'application/json': this.buildPutRecordModel(props.putRecordRequestModel) }, + }; + if (props.putRecordMethodResponses) { + putRecordMethodOptions = defaults.overrideProps(putRecordMethodOptions, { methodResponses: props.putRecordMethodResponses}); + } // PutRecord const putRecordResource = this.apiGateway.root.addResource('record'); defaults.addProxyMethodToApiResource({ @@ -174,11 +219,18 @@ export class ApiGatewayToKinesisStreams extends Construct { requestTemplate: this.buildPutRecordTemplate(props.putRecordRequestTemplate), additionalRequestTemplates: this.buildAdditionalPutRecordTemplates(props.additionalPutRecordRequestTemplates), contentType: "'x-amz-json-1.1'", - requestValidator, - requestModel: { 'application/json': this.buildPutRecordModel(props.putRecordRequestModel) }, - integrationResponses: props.putRecordIntegrationResponses + integrationResponses: props.putRecordIntegrationResponses, + methodOptions: putRecordMethodOptions }); + let putRecordsMethodOptions: api.MethodOptions = { + requestValidator, + requestModels: { 'application/json': this.buildPutRecordsModel(props.putRecordsRequestModel) }, + }; + if (props.putRecordsMethodResponses) { + putRecordsMethodOptions = defaults.overrideProps(putRecordsMethodOptions, { methodResponses: props.putRecordsMethodResponses}); + } + // PutRecords const putRecordsResource = this.apiGateway.root.addResource('records'); defaults.addProxyMethodToApiResource({ @@ -190,9 +242,8 @@ export class ApiGatewayToKinesisStreams extends Construct { requestTemplate: this.buildPutRecordsTemplate(props.putRecordsRequestTemplate), additionalRequestTemplates: this.buildAdditionalPutRecordTemplates(props.additionalPutRecordsRequestTemplates), contentType: "'x-amz-json-1.1'", - requestValidator, - requestModel: { 'application/json': this.buildPutRecordsModel(props.putRecordsRequestModel) }, - integrationResponses: props.putRecordsIntegrationResponses + integrationResponses: props.putRecordsIntegrationResponses, + methodOptions: putRecordsMethodOptions }); if (props.createCloudWatchAlarms === undefined || props.createCloudWatchAlarms) { diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/apigateway-kinesisstreams.test.ts b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/apigateway-kinesisstreams.test.ts index a3bbaf0ff..9743bf828 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/apigateway-kinesisstreams.test.ts +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/apigateway-kinesisstreams.test.ts @@ -238,3 +238,75 @@ test('Confirm that CheckKinesisStreamProps is called', () => { }; expect(app).toThrowError(); }); + +test('Construct uses custom putRecordMethodResponses property', () => { + const stack = new Stack(); + new ApiGatewayToKinesisStreams(stack, 'api-gateway-kinesis-streams ', { + putRecordIntegrationResponses: [ + { + statusCode: '200', + responseTemplates: { + 'text/html': 'OK' + } + } + ], + putRecordMethodResponses: [{ + statusCode: "200" + }] + }); + + const template = Template.fromStack(stack); + + template.hasResourceProperties('AWS::ApiGateway::Method', { + HttpMethod: 'POST', + Integration: { + IntegrationResponses: [ + { + ResponseTemplates: { + 'text/html': 'OK' + }, + StatusCode: '200' + } + ], + }, + MethodResponses: [{ + StatusCode: "200" + }] + }); +}); + +test('Construct uses custom putRecordsMethodResponses property', () => { + const stack = new Stack(); + new ApiGatewayToKinesisStreams(stack, 'api-gateway-kinesis-streams ', { + putRecordsIntegrationResponses: [ + { + statusCode: '200', + responseTemplates: { + 'text/html': 'OK' + } + } + ], + putRecordsMethodResponses: [{ + statusCode: "200" + }] + }); + + const template = Template.fromStack(stack); + + template.hasResourceProperties('AWS::ApiGateway::Method', { + HttpMethod: 'POST', + Integration: { + IntegrationResponses: [ + { + ResponseTemplates: { + 'text/html': 'OK' + }, + StatusCode: '200' + } + ], + }, + MethodResponses: [{ + StatusCode: "200" + }] + }); +}); diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-additional-request-templates.js.snapshot/apikin-additional-request-templates.assets.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-additional-request-templates.js.snapshot/apikin-additional-request-templates.assets.json index a267c4746..b3be29e0f 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-additional-request-templates.js.snapshot/apikin-additional-request-templates.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-additional-request-templates.js.snapshot/apikin-additional-request-templates.assets.json @@ -1,7 +1,7 @@ { "version": "36.0.0", "files": { - "3eb0236d686b5c362f7ff9e4be95ad674ee6739f8d3460e1e994e6d54a2e117c": { + "66c4a74fa528b6b9e62db0f24a50ddf18997b021b8452f499c0a9188e62b354c": { "source": { "path": "apikin-additional-request-templates.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "3eb0236d686b5c362f7ff9e4be95ad674ee6739f8d3460e1e994e6d54a2e117c.json", + "objectKey": "66c4a74fa528b6b9e62db0f24a50ddf18997b021b8452f499c0a9188e62b354c.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-additional-request-templates.js.snapshot/apikin-additional-request-templates.template.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-additional-request-templates.js.snapshot/apikin-additional-request-templates.template.json index 3ae410a38..ad15e883c 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-additional-request-templates.js.snapshot/apikin-additional-request-templates.template.json +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-additional-request-templates.js.snapshot/apikin-additional-request-templates.template.json @@ -31,7 +31,7 @@ "Name": "RestApi" } }, - "testapigatewaykinesisadditionalrequesttemplatesRestApiDeployment5A447E3D3f205cdf3c053c5a1187e7b2a0f3474d": { + "testapigatewaykinesisadditionalrequesttemplatesRestApiDeployment5A447E3D178e061c8d56d2d9b095ca538d00fe24": { "Type": "AWS::ApiGateway::Deployment", "Properties": { "Description": "Automatically created by the RestApi construct", @@ -72,7 +72,7 @@ "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\"}" }, "DeploymentId": { - "Ref": "testapigatewaykinesisadditionalrequesttemplatesRestApiDeployment5A447E3D3f205cdf3c053c5a1187e7b2a0f3474d" + "Ref": "testapigatewaykinesisadditionalrequesttemplatesRestApiDeployment5A447E3D178e061c8d56d2d9b095ca538d00fe24" }, "MethodSettings": [ { diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-additional-request-templates.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-additional-request-templates.js.snapshot/manifest.json index 7c3bbd7ee..65459ec7e 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-additional-request-templates.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-additional-request-templates.js.snapshot/manifest.json @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/3eb0236d686b5c362f7ff9e4be95ad674ee6739f8d3460e1e994e6d54a2e117c.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/66c4a74fa528b6b9e62db0f24a50ddf18997b021b8452f499c0a9188e62b354c.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -97,7 +97,7 @@ "/apikin-additional-request-templates/test-apigateway-kinesis-additional-request-templates/RestApi/Deployment/Resource": [ { "type": "aws:cdk:logicalId", - "data": "testapigatewaykinesisadditionalrequesttemplatesRestApiDeployment5A447E3D3f205cdf3c053c5a1187e7b2a0f3474d" + "data": "testapigatewaykinesisadditionalrequesttemplatesRestApiDeployment5A447E3D178e061c8d56d2d9b095ca538d00fe24" } ], "/apikin-additional-request-templates/test-apigateway-kinesis-additional-request-templates/RestApi/DeploymentStage.prod/Resource": [ @@ -213,6 +213,15 @@ "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } + ], + "testapigatewaykinesisadditionalrequesttemplatesRestApiDeployment5A447E3D3f205cdf3c053c5a1187e7b2a0f3474d": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaykinesisadditionalrequesttemplatesRestApiDeployment5A447E3D3f205cdf3c053c5a1187e7b2a0f3474d", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } ] }, "displayName": "apikin-additional-request-templates" diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-additional-request-templates.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-additional-request-templates.js.snapshot/tree.json index 40cd7ddde..b2cfd4f02 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-additional-request-templates.js.snapshot/tree.json +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-additional-request-templates.js.snapshot/tree.json @@ -25,13 +25,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_logs.CfnLogGroup", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_logs.LogGroup", - "version": "2.143.0" + "version": "2.145.0" } }, "RestApi": { @@ -54,7 +54,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnRestApi", - "version": "2.143.0" + "version": "2.145.0" } }, "Deployment": { @@ -75,13 +75,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnDeployment", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Deployment", - "version": "2.143.0" + "version": "2.145.0" } }, "DeploymentStage.prod": { @@ -104,7 +104,7 @@ "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\"}" }, "deploymentId": { - "Ref": "testapigatewaykinesisadditionalrequesttemplatesRestApiDeployment5A447E3D3f205cdf3c053c5a1187e7b2a0f3474d" + "Ref": "testapigatewaykinesisadditionalrequesttemplatesRestApiDeployment5A447E3D178e061c8d56d2d9b095ca538d00fe24" }, "methodSettings": [ { @@ -123,13 +123,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnStage", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Stage", - "version": "2.143.0" + "version": "2.145.0" } }, "Endpoint": { @@ -137,7 +137,7 @@ "path": "apikin-additional-request-templates/test-apigateway-kinesis-additional-request-templates/RestApi/Endpoint", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", - "version": "2.143.0" + "version": "2.145.0" } }, "Default": { @@ -168,7 +168,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnResource", - "version": "2.143.0" + "version": "2.145.0" } }, "POST": { @@ -283,19 +283,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Method", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Resource", - "version": "2.143.0" + "version": "2.145.0" } }, "records": { @@ -322,7 +322,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnResource", - "version": "2.143.0" + "version": "2.145.0" } }, "POST": { @@ -425,25 +425,25 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Method", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Resource", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.ResourceBase", - "version": "2.143.0" + "version": "2.145.0" } }, "UsagePlan": { @@ -471,13 +471,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnUsagePlan", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.UsagePlan", - "version": "2.143.0" + "version": "2.145.0" } }, "request-validator": { @@ -499,13 +499,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnRequestValidator", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.RequestValidator", - "version": "2.143.0" + "version": "2.145.0" } }, "PutRecordModel": { @@ -545,13 +545,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnModel", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Model", - "version": "2.143.0" + "version": "2.145.0" } }, "PutRecordsModel": { @@ -602,19 +602,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnModel", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Model", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.RestApi", - "version": "2.143.0" + "version": "2.145.0" } }, "LambdaRestApiCloudWatchRole": { @@ -626,7 +626,7 @@ "path": "apikin-additional-request-templates/test-apigateway-kinesis-additional-request-templates/LambdaRestApiCloudWatchRole/ImportLambdaRestApiCloudWatchRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.143.0" + "version": "2.145.0" } }, "Resource": { @@ -693,13 +693,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.143.0" + "version": "2.145.0" } }, "LambdaRestApiAccount": { @@ -718,7 +718,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnAccount", - "version": "2.143.0" + "version": "2.145.0" } }, "api-gateway-role": { @@ -730,7 +730,7 @@ "path": "apikin-additional-request-templates/test-apigateway-kinesis-additional-request-templates/api-gateway-role/Importapi-gateway-role", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.143.0" + "version": "2.145.0" } }, "Resource": { @@ -755,7 +755,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.143.0" + "version": "2.145.0" } }, "DefaultPolicy": { @@ -797,19 +797,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.143.0" + "version": "2.145.0" } }, "KinesisStreamGetRecordsIteratorAgeAlarm": { @@ -834,13 +834,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", - "version": "2.143.0" + "version": "2.145.0" } }, "KinesisStreamReadProvisionedThroughputExceededAlarm": { @@ -865,19 +865,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "@aws-solutions-constructs/aws-apigateway-kinesisstreams.ApiGatewayToKinesisStreams", - "version": "2.57.0" + "version": "2.59.0" } }, "KinesisStream": { @@ -900,13 +900,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kinesis.CfnStream", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kinesis.Stream", - "version": "2.143.0" + "version": "2.145.0" } }, "Integ": { @@ -934,7 +934,7 @@ "path": "apikin-additional-request-templates/Integ/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.143.0" + "version": "2.145.0" } }, "CheckBootstrapVersion": { @@ -942,25 +942,25 @@ "path": "apikin-additional-request-templates/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", - "version": "2.143.0-alpha.0" + "version": "2.145.0-alpha.0" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", - "version": "2.143.0-alpha.0" + "version": "2.145.0-alpha.0" } }, "BootstrapVersion": { @@ -968,7 +968,7 @@ "path": "apikin-additional-request-templates/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.143.0" + "version": "2.145.0" } }, "CheckBootstrapVersion": { @@ -976,13 +976,13 @@ "path": "apikin-additional-request-templates/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.143.0" + "version": "2.145.0" } }, "Tree": { @@ -996,7 +996,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.App", - "version": "2.143.0" + "version": "2.145.0" } } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-apigateway-kinesis-overwrite.js.snapshot/apikin-apigateway-kinesis-overwrite.assets.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-apigateway-kinesis-overwrite.js.snapshot/apikin-apigateway-kinesis-overwrite.assets.json index 6a5622625..826b220fe 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-apigateway-kinesis-overwrite.js.snapshot/apikin-apigateway-kinesis-overwrite.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-apigateway-kinesis-overwrite.js.snapshot/apikin-apigateway-kinesis-overwrite.assets.json @@ -1,7 +1,7 @@ { "version": "36.0.0", "files": { - "9b409e33b4861ebb040b829a5bc2fac6f37fa3be51723d4e280d0baf34489213": { + "0465f48229b2853b1aa5ff73fd317315867e85ae1358c39e6defc2913349dd07": { "source": { "path": "apikin-apigateway-kinesis-overwrite.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "9b409e33b4861ebb040b829a5bc2fac6f37fa3be51723d4e280d0baf34489213.json", + "objectKey": "0465f48229b2853b1aa5ff73fd317315867e85ae1358c39e6defc2913349dd07.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-apigateway-kinesis-overwrite.js.snapshot/apikin-apigateway-kinesis-overwrite.template.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-apigateway-kinesis-overwrite.js.snapshot/apikin-apigateway-kinesis-overwrite.template.json index 8c1ff3a20..f639bf3a0 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-apigateway-kinesis-overwrite.js.snapshot/apikin-apigateway-kinesis-overwrite.template.json +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-apigateway-kinesis-overwrite.js.snapshot/apikin-apigateway-kinesis-overwrite.template.json @@ -31,7 +31,7 @@ "Name": "my-api" } }, - "testapigatewaykinesisoverwriteRestApiDeployment1EE3B096ca960d6e964dacd9ef8ada66856cca97": { + "testapigatewaykinesisoverwriteRestApiDeployment1EE3B09614424f458f8c706105d1d21f3bb9267c": { "Type": "AWS::ApiGateway::Deployment", "Properties": { "Description": "Automatically created by the RestApi construct", @@ -72,7 +72,7 @@ "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\"}" }, "DeploymentId": { - "Ref": "testapigatewaykinesisoverwriteRestApiDeployment1EE3B096ca960d6e964dacd9ef8ada66856cca97" + "Ref": "testapigatewaykinesisoverwriteRestApiDeployment1EE3B09614424f458f8c706105d1d21f3bb9267c" }, "MethodSettings": [ { diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-apigateway-kinesis-overwrite.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-apigateway-kinesis-overwrite.js.snapshot/manifest.json index 5496e6e84..0ab072051 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-apigateway-kinesis-overwrite.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-apigateway-kinesis-overwrite.js.snapshot/manifest.json @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/9b409e33b4861ebb040b829a5bc2fac6f37fa3be51723d4e280d0baf34489213.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/0465f48229b2853b1aa5ff73fd317315867e85ae1358c39e6defc2913349dd07.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -97,7 +97,7 @@ "/apikin-apigateway-kinesis-overwrite/test-apigateway-kinesis-overwrite/RestApi/Deployment/Resource": [ { "type": "aws:cdk:logicalId", - "data": "testapigatewaykinesisoverwriteRestApiDeployment1EE3B096ca960d6e964dacd9ef8ada66856cca97" + "data": "testapigatewaykinesisoverwriteRestApiDeployment1EE3B09614424f458f8c706105d1d21f3bb9267c" } ], "/apikin-apigateway-kinesis-overwrite/test-apigateway-kinesis-overwrite/RestApi/DeploymentStage.prod/Resource": [ @@ -213,6 +213,15 @@ "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } + ], + "testapigatewaykinesisoverwriteRestApiDeployment1EE3B096ca960d6e964dacd9ef8ada66856cca97": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaykinesisoverwriteRestApiDeployment1EE3B096ca960d6e964dacd9ef8ada66856cca97", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } ] }, "displayName": "apikin-apigateway-kinesis-overwrite" diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-apigateway-kinesis-overwrite.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-apigateway-kinesis-overwrite.js.snapshot/tree.json index 7f77da74a..dbfd7a585 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-apigateway-kinesis-overwrite.js.snapshot/tree.json +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-apigateway-kinesis-overwrite.js.snapshot/tree.json @@ -25,13 +25,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_logs.CfnLogGroup", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_logs.LogGroup", - "version": "2.143.0" + "version": "2.145.0" } }, "RestApi": { @@ -54,7 +54,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnRestApi", - "version": "2.143.0" + "version": "2.145.0" } }, "Deployment": { @@ -75,13 +75,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnDeployment", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Deployment", - "version": "2.143.0" + "version": "2.145.0" } }, "DeploymentStage.prod": { @@ -104,7 +104,7 @@ "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\"}" }, "deploymentId": { - "Ref": "testapigatewaykinesisoverwriteRestApiDeployment1EE3B096ca960d6e964dacd9ef8ada66856cca97" + "Ref": "testapigatewaykinesisoverwriteRestApiDeployment1EE3B09614424f458f8c706105d1d21f3bb9267c" }, "methodSettings": [ { @@ -130,13 +130,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnStage", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Stage", - "version": "2.143.0" + "version": "2.145.0" } }, "Endpoint": { @@ -144,7 +144,7 @@ "path": "apikin-apigateway-kinesis-overwrite/test-apigateway-kinesis-overwrite/RestApi/Endpoint", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", - "version": "2.143.0" + "version": "2.145.0" } }, "Default": { @@ -175,7 +175,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnResource", - "version": "2.143.0" + "version": "2.145.0" } }, "POST": { @@ -278,19 +278,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Method", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Resource", - "version": "2.143.0" + "version": "2.145.0" } }, "records": { @@ -317,7 +317,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnResource", - "version": "2.143.0" + "version": "2.145.0" } }, "POST": { @@ -420,25 +420,25 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Method", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Resource", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.ResourceBase", - "version": "2.143.0" + "version": "2.145.0" } }, "UsagePlan": { @@ -466,13 +466,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnUsagePlan", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.UsagePlan", - "version": "2.143.0" + "version": "2.145.0" } }, "request-validator": { @@ -494,13 +494,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnRequestValidator", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.RequestValidator", - "version": "2.143.0" + "version": "2.145.0" } }, "PutRecordModel": { @@ -524,13 +524,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnModel", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Model", - "version": "2.143.0" + "version": "2.145.0" } }, "PutRecordsModel": { @@ -554,19 +554,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnModel", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Model", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.RestApi", - "version": "2.143.0" + "version": "2.145.0" } }, "LambdaRestApiCloudWatchRole": { @@ -578,7 +578,7 @@ "path": "apikin-apigateway-kinesis-overwrite/test-apigateway-kinesis-overwrite/LambdaRestApiCloudWatchRole/ImportLambdaRestApiCloudWatchRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.143.0" + "version": "2.145.0" } }, "Resource": { @@ -645,13 +645,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.143.0" + "version": "2.145.0" } }, "LambdaRestApiAccount": { @@ -670,7 +670,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnAccount", - "version": "2.143.0" + "version": "2.145.0" } }, "api-gateway-role": { @@ -682,7 +682,7 @@ "path": "apikin-apigateway-kinesis-overwrite/test-apigateway-kinesis-overwrite/api-gateway-role/Importapi-gateway-role", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.143.0" + "version": "2.145.0" } }, "Resource": { @@ -707,7 +707,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.143.0" + "version": "2.145.0" } }, "DefaultPolicy": { @@ -749,19 +749,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.143.0" + "version": "2.145.0" } }, "KinesisStreamGetRecordsIteratorAgeAlarm": { @@ -786,13 +786,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", - "version": "2.143.0" + "version": "2.145.0" } }, "KinesisStreamReadProvisionedThroughputExceededAlarm": { @@ -817,19 +817,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "@aws-solutions-constructs/aws-apigateway-kinesisstreams.ApiGatewayToKinesisStreams", - "version": "2.57.0" + "version": "2.59.0" } }, "KinesisStream": { @@ -852,13 +852,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kinesis.CfnStream", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kinesis.Stream", - "version": "2.143.0" + "version": "2.145.0" } }, "Integ": { @@ -886,7 +886,7 @@ "path": "apikin-apigateway-kinesis-overwrite/Integ/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.143.0" + "version": "2.145.0" } }, "CheckBootstrapVersion": { @@ -894,25 +894,25 @@ "path": "apikin-apigateway-kinesis-overwrite/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", - "version": "2.143.0-alpha.0" + "version": "2.145.0-alpha.0" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", - "version": "2.143.0-alpha.0" + "version": "2.145.0-alpha.0" } }, "BootstrapVersion": { @@ -920,7 +920,7 @@ "path": "apikin-apigateway-kinesis-overwrite/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.143.0" + "version": "2.145.0" } }, "CheckBootstrapVersion": { @@ -928,13 +928,13 @@ "path": "apikin-apigateway-kinesis-overwrite/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.143.0" + "version": "2.145.0" } }, "Tree": { @@ -948,7 +948,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.App", - "version": "2.143.0" + "version": "2.145.0" } } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-custom-integration-responses.js.snapshot/apikin-custom-integration-responses.assets.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-custom-integration-responses.js.snapshot/apikin-custom-integration-responses.assets.json index c120822ad..e0607bd7c 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-custom-integration-responses.js.snapshot/apikin-custom-integration-responses.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-custom-integration-responses.js.snapshot/apikin-custom-integration-responses.assets.json @@ -1,7 +1,7 @@ { "version": "36.0.0", "files": { - "078b51dd1ca9b3d2bd46d872dc64fd6190740bafcc01e6141770326f1f267212": { + "a43ab8f94396f0976f57a86618c60ba518b5edc900be024ea09325481605c132": { "source": { "path": "apikin-custom-integration-responses.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "078b51dd1ca9b3d2bd46d872dc64fd6190740bafcc01e6141770326f1f267212.json", + "objectKey": "a43ab8f94396f0976f57a86618c60ba518b5edc900be024ea09325481605c132.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-custom-integration-responses.js.snapshot/apikin-custom-integration-responses.template.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-custom-integration-responses.js.snapshot/apikin-custom-integration-responses.template.json index 8289cbd4e..fd74614a4 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-custom-integration-responses.js.snapshot/apikin-custom-integration-responses.template.json +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-custom-integration-responses.js.snapshot/apikin-custom-integration-responses.template.json @@ -31,7 +31,7 @@ "Name": "RestApi" } }, - "testapigatewaykinesisadditionalrequesttemplatesRestApiDeployment5A447E3D68efb2650de4064374902887dee80c33": { + "testapigatewaykinesisadditionalrequesttemplatesRestApiDeployment5A447E3D22375d3b4b188e664e530d7eed3613d8": { "Type": "AWS::ApiGateway::Deployment", "Properties": { "Description": "Automatically created by the RestApi construct", @@ -72,7 +72,7 @@ "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\"}" }, "DeploymentId": { - "Ref": "testapigatewaykinesisadditionalrequesttemplatesRestApiDeployment5A447E3D68efb2650de4064374902887dee80c33" + "Ref": "testapigatewaykinesisadditionalrequesttemplatesRestApiDeployment5A447E3D22375d3b4b188e664e530d7eed3613d8" }, "MethodSettings": [ { diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-custom-integration-responses.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-custom-integration-responses.js.snapshot/manifest.json index 0ce2d9256..bcd0180b5 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-custom-integration-responses.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-custom-integration-responses.js.snapshot/manifest.json @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/078b51dd1ca9b3d2bd46d872dc64fd6190740bafcc01e6141770326f1f267212.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/a43ab8f94396f0976f57a86618c60ba518b5edc900be024ea09325481605c132.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -97,7 +97,7 @@ "/apikin-custom-integration-responses/test-apigateway-kinesis-additional-request-templates/RestApi/Deployment/Resource": [ { "type": "aws:cdk:logicalId", - "data": "testapigatewaykinesisadditionalrequesttemplatesRestApiDeployment5A447E3D68efb2650de4064374902887dee80c33" + "data": "testapigatewaykinesisadditionalrequesttemplatesRestApiDeployment5A447E3D22375d3b4b188e664e530d7eed3613d8" } ], "/apikin-custom-integration-responses/test-apigateway-kinesis-additional-request-templates/RestApi/DeploymentStage.prod/Resource": [ @@ -213,6 +213,15 @@ "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } + ], + "testapigatewaykinesisadditionalrequesttemplatesRestApiDeployment5A447E3D68efb2650de4064374902887dee80c33": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaykinesisadditionalrequesttemplatesRestApiDeployment5A447E3D68efb2650de4064374902887dee80c33", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } ] }, "displayName": "apikin-custom-integration-responses" diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-custom-integration-responses.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-custom-integration-responses.js.snapshot/tree.json index ab3b0d6d7..d2a72296a 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-custom-integration-responses.js.snapshot/tree.json +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-custom-integration-responses.js.snapshot/tree.json @@ -25,13 +25,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_logs.CfnLogGroup", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_logs.LogGroup", - "version": "2.143.0" + "version": "2.145.0" } }, "RestApi": { @@ -54,7 +54,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnRestApi", - "version": "2.143.0" + "version": "2.145.0" } }, "Deployment": { @@ -75,13 +75,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnDeployment", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Deployment", - "version": "2.143.0" + "version": "2.145.0" } }, "DeploymentStage.prod": { @@ -104,7 +104,7 @@ "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\"}" }, "deploymentId": { - "Ref": "testapigatewaykinesisadditionalrequesttemplatesRestApiDeployment5A447E3D68efb2650de4064374902887dee80c33" + "Ref": "testapigatewaykinesisadditionalrequesttemplatesRestApiDeployment5A447E3D22375d3b4b188e664e530d7eed3613d8" }, "methodSettings": [ { @@ -123,13 +123,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnStage", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Stage", - "version": "2.143.0" + "version": "2.145.0" } }, "Endpoint": { @@ -137,7 +137,7 @@ "path": "apikin-custom-integration-responses/test-apigateway-kinesis-additional-request-templates/RestApi/Endpoint", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", - "version": "2.143.0" + "version": "2.145.0" } }, "Default": { @@ -168,7 +168,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnResource", - "version": "2.143.0" + "version": "2.145.0" } }, "POST": { @@ -267,19 +267,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Method", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Resource", - "version": "2.143.0" + "version": "2.145.0" } }, "records": { @@ -306,7 +306,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnResource", - "version": "2.143.0" + "version": "2.145.0" } }, "POST": { @@ -409,25 +409,25 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Method", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Resource", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.ResourceBase", - "version": "2.143.0" + "version": "2.145.0" } }, "UsagePlan": { @@ -455,13 +455,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnUsagePlan", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.UsagePlan", - "version": "2.143.0" + "version": "2.145.0" } }, "request-validator": { @@ -483,13 +483,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnRequestValidator", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.RequestValidator", - "version": "2.143.0" + "version": "2.145.0" } }, "PutRecordModel": { @@ -529,13 +529,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnModel", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Model", - "version": "2.143.0" + "version": "2.145.0" } }, "PutRecordsModel": { @@ -586,19 +586,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnModel", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Model", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.RestApi", - "version": "2.143.0" + "version": "2.145.0" } }, "LambdaRestApiCloudWatchRole": { @@ -610,7 +610,7 @@ "path": "apikin-custom-integration-responses/test-apigateway-kinesis-additional-request-templates/LambdaRestApiCloudWatchRole/ImportLambdaRestApiCloudWatchRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.143.0" + "version": "2.145.0" } }, "Resource": { @@ -677,13 +677,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.143.0" + "version": "2.145.0" } }, "LambdaRestApiAccount": { @@ -702,7 +702,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnAccount", - "version": "2.143.0" + "version": "2.145.0" } }, "api-gateway-role": { @@ -714,7 +714,7 @@ "path": "apikin-custom-integration-responses/test-apigateway-kinesis-additional-request-templates/api-gateway-role/Importapi-gateway-role", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.143.0" + "version": "2.145.0" } }, "Resource": { @@ -739,7 +739,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.143.0" + "version": "2.145.0" } }, "DefaultPolicy": { @@ -781,19 +781,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.143.0" + "version": "2.145.0" } }, "KinesisStreamGetRecordsIteratorAgeAlarm": { @@ -818,13 +818,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", - "version": "2.143.0" + "version": "2.145.0" } }, "KinesisStreamReadProvisionedThroughputExceededAlarm": { @@ -849,19 +849,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "@aws-solutions-constructs/aws-apigateway-kinesisstreams.ApiGatewayToKinesisStreams", - "version": "2.57.0" + "version": "2.59.0" } }, "KinesisStream": { @@ -884,13 +884,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kinesis.CfnStream", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kinesis.Stream", - "version": "2.143.0" + "version": "2.145.0" } }, "Integ": { @@ -918,7 +918,7 @@ "path": "apikin-custom-integration-responses/Integ/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.143.0" + "version": "2.145.0" } }, "CheckBootstrapVersion": { @@ -926,25 +926,25 @@ "path": "apikin-custom-integration-responses/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", - "version": "2.143.0-alpha.0" + "version": "2.145.0-alpha.0" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", - "version": "2.143.0-alpha.0" + "version": "2.145.0-alpha.0" } }, "BootstrapVersion": { @@ -952,7 +952,7 @@ "path": "apikin-custom-integration-responses/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.143.0" + "version": "2.145.0" } }, "CheckBootstrapVersion": { @@ -960,13 +960,13 @@ "path": "apikin-custom-integration-responses/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.143.0" + "version": "2.145.0" } }, "Tree": { @@ -980,7 +980,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.App", - "version": "2.143.0" + "version": "2.145.0" } } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-method-responses.js.snapshot/apikin-method-responses.assets.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-method-responses.js.snapshot/apikin-method-responses.assets.json new file mode 100644 index 000000000..bc10c0d74 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-method-responses.js.snapshot/apikin-method-responses.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.0", + "files": { + "42715264a3a3445003faaab6eaff07655fdab77730a1711c73b82494d6df6981": { + "source": { + "path": "apikin-method-responses.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "42715264a3a3445003faaab6eaff07655fdab77730a1711c73b82494d6df6981.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-method-responses.js.snapshot/apikin-method-responses.template.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-method-responses.js.snapshot/apikin-method-responses.template.json new file mode 100644 index 000000000..7b74eaba3 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-method-responses.js.snapshot/apikin-method-responses.template.json @@ -0,0 +1,616 @@ +{ + "Description": "Integration Test for aws-apigateway-kinesis", + "Resources": { + "testapigatewaykinesisdefaultApiAccessLogGroup51BF9616": { + "Type": "AWS::Logs::LogGroup", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain", + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W86", + "reason": "Retention period for CloudWatchLogs LogGroups are set to 'Never Expire' to preserve customer data indefinitely" + }, + { + "id": "W84", + "reason": "By default CloudWatchLogs LogGroups data is encrypted using the CloudWatch server-side encryption keys (AWS Managed Keys)" + } + ] + } + } + }, + "testapigatewaykinesisdefaultRestApi68CBA18C": { + "Type": "AWS::ApiGateway::RestApi", + "Properties": { + "EndpointConfiguration": { + "Types": [ + "EDGE" + ] + }, + "Name": "RestApi" + } + }, + "testapigatewaykinesisdefaultRestApiDeployment2852F1AAe11e785f0c835bae60935baac09fb799": { + "Type": "AWS::ApiGateway::Deployment", + "Properties": { + "Description": "Automatically created by the RestApi construct", + "RestApiId": { + "Ref": "testapigatewaykinesisdefaultRestApi68CBA18C" + } + }, + "DependsOn": [ + "testapigatewaykinesisdefaultRestApirecordPOST731165E8", + "testapigatewaykinesisdefaultRestApirecord500DDD57", + "testapigatewaykinesisdefaultRestApirecordsPOST165BE933", + "testapigatewaykinesisdefaultRestApirecords972EAFEA", + "testapigatewaykinesisdefaultRestApiPutRecordModel06DC611F", + "testapigatewaykinesisdefaultRestApiPutRecordsModelA7CA8D6D", + "testapigatewaykinesisdefaultRestApirequestvalidator5901C267" + ], + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W45", + "reason": "ApiGateway has AccessLogging enabled in AWS::ApiGateway::Stage resource, but cfn_nag checks for it in AWS::ApiGateway::Deployment resource" + } + ] + } + } + }, + "testapigatewaykinesisdefaultRestApiDeploymentStageprodB6206494": { + "Type": "AWS::ApiGateway::Stage", + "Properties": { + "AccessLogSetting": { + "DestinationArn": { + "Fn::GetAtt": [ + "testapigatewaykinesisdefaultApiAccessLogGroup51BF9616", + "Arn" + ] + }, + "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\"}" + }, + "DeploymentId": { + "Ref": "testapigatewaykinesisdefaultRestApiDeployment2852F1AAe11e785f0c835bae60935baac09fb799" + }, + "MethodSettings": [ + { + "DataTraceEnabled": false, + "HttpMethod": "*", + "LoggingLevel": "INFO", + "ResourcePath": "/*" + } + ], + "RestApiId": { + "Ref": "testapigatewaykinesisdefaultRestApi68CBA18C" + }, + "StageName": "prod", + "TracingEnabled": true + } + }, + "testapigatewaykinesisdefaultRestApirecord500DDD57": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Fn::GetAtt": [ + "testapigatewaykinesisdefaultRestApi68CBA18C", + "RootResourceId" + ] + }, + "PathPart": "record", + "RestApiId": { + "Ref": "testapigatewaykinesisdefaultRestApi68CBA18C" + } + } + }, + "testapigatewaykinesisdefaultRestApirecordPOST731165E8": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "AWS_IAM", + "HttpMethod": "POST", + "Integration": { + "Credentials": { + "Fn::GetAtt": [ + "testapigatewaykinesisdefaultapigatewayroleAD430BE2", + "Arn" + ] + }, + "IntegrationHttpMethod": "POST", + "IntegrationResponses": [ + { + "StatusCode": "200" + }, + { + "ResponseTemplates": { + "text/html": "Error" + }, + "SelectionPattern": "500", + "StatusCode": "500" + } + ], + "PassthroughBehavior": "NEVER", + "RequestParameters": { + "integration.request.header.Content-Type": "'x-amz-json-1.1'" + }, + "RequestTemplates": { + "application/json": { + "Fn::Join": [ + "", + [ + "{ \"StreamName\": \"", + { + "Ref": "KinesisStream46752A3E" + }, + "\", \"Data\": \"$util.base64Encode($input.json('$.data'))\", \"PartitionKey\": \"$input.path('$.partitionKey')\" }" + ] + ] + } + }, + "Type": "AWS", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":kinesis:action/PutRecord" + ] + ] + } + }, + "MethodResponses": [ + { + "StatusCode": "200" + }, + { + "StatusCode": "400" + }, + { + "StatusCode": "401" + }, + { + "StatusCode": "500" + } + ], + "RequestModels": { + "application/json": { + "Ref": "testapigatewaykinesisdefaultRestApiPutRecordModel06DC611F" + } + }, + "RequestValidatorId": { + "Ref": "testapigatewaykinesisdefaultRestApirequestvalidator5901C267" + }, + "ResourceId": { + "Ref": "testapigatewaykinesisdefaultRestApirecord500DDD57" + }, + "RestApiId": { + "Ref": "testapigatewaykinesisdefaultRestApi68CBA18C" + } + } + }, + "testapigatewaykinesisdefaultRestApirecords972EAFEA": { + "Type": "AWS::ApiGateway::Resource", + "Properties": { + "ParentId": { + "Fn::GetAtt": [ + "testapigatewaykinesisdefaultRestApi68CBA18C", + "RootResourceId" + ] + }, + "PathPart": "records", + "RestApiId": { + "Ref": "testapigatewaykinesisdefaultRestApi68CBA18C" + } + } + }, + "testapigatewaykinesisdefaultRestApirecordsPOST165BE933": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "AWS_IAM", + "HttpMethod": "POST", + "Integration": { + "Credentials": { + "Fn::GetAtt": [ + "testapigatewaykinesisdefaultapigatewayroleAD430BE2", + "Arn" + ] + }, + "IntegrationHttpMethod": "POST", + "IntegrationResponses": [ + { + "StatusCode": "200" + }, + { + "ResponseTemplates": { + "text/html": "Error" + }, + "SelectionPattern": "500", + "StatusCode": "500" + } + ], + "PassthroughBehavior": "NEVER", + "RequestParameters": { + "integration.request.header.Content-Type": "'x-amz-json-1.1'" + }, + "RequestTemplates": { + "application/json": { + "Fn::Join": [ + "", + [ + "{ \"StreamName\": \"", + { + "Ref": "KinesisStream46752A3E" + }, + "\", \"Records\": [ #foreach($elem in $input.path('$.records')) { \"Data\": \"$util.base64Encode($elem.data)\", \"PartitionKey\": \"$elem.partitionKey\"}#if($foreach.hasNext),#end #end ] }" + ] + ] + } + }, + "Type": "AWS", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":kinesis:action/PutRecords" + ] + ] + } + }, + "MethodResponses": [ + { + "StatusCode": "200" + }, + { + "StatusCode": "300" + }, + { + "StatusCode": "401" + } + ], + "RequestModels": { + "application/json": { + "Ref": "testapigatewaykinesisdefaultRestApiPutRecordsModelA7CA8D6D" + } + }, + "RequestValidatorId": { + "Ref": "testapigatewaykinesisdefaultRestApirequestvalidator5901C267" + }, + "ResourceId": { + "Ref": "testapigatewaykinesisdefaultRestApirecords972EAFEA" + }, + "RestApiId": { + "Ref": "testapigatewaykinesisdefaultRestApi68CBA18C" + } + } + }, + "testapigatewaykinesisdefaultRestApiUsagePlan9A725D0A": { + "Type": "AWS::ApiGateway::UsagePlan", + "Properties": { + "ApiStages": [ + { + "ApiId": { + "Ref": "testapigatewaykinesisdefaultRestApi68CBA18C" + }, + "Stage": { + "Ref": "testapigatewaykinesisdefaultRestApiDeploymentStageprodB6206494" + }, + "Throttle": {} + } + ] + } + }, + "testapigatewaykinesisdefaultRestApirequestvalidator5901C267": { + "Type": "AWS::ApiGateway::RequestValidator", + "Properties": { + "Name": "request-body-validator", + "RestApiId": { + "Ref": "testapigatewaykinesisdefaultRestApi68CBA18C" + }, + "ValidateRequestBody": true + } + }, + "testapigatewaykinesisdefaultRestApiPutRecordModel06DC611F": { + "Type": "AWS::ApiGateway::Model", + "Properties": { + "ContentType": "application/json", + "Description": "PutRecord proxy single-record payload", + "Name": "PutRecordModel", + "RestApiId": { + "Ref": "testapigatewaykinesisdefaultRestApi68CBA18C" + }, + "Schema": { + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "PutRecord proxy single-record payload", + "type": "object", + "required": [ + "data", + "partitionKey" + ], + "properties": { + "data": { + "type": "string" + }, + "partitionKey": { + "type": "string" + } + } + } + } + }, + "testapigatewaykinesisdefaultRestApiPutRecordsModelA7CA8D6D": { + "Type": "AWS::ApiGateway::Model", + "Properties": { + "ContentType": "application/json", + "Description": "PutRecords proxy payload data", + "Name": "PutRecordsModel", + "RestApiId": { + "Ref": "testapigatewaykinesisdefaultRestApi68CBA18C" + }, + "Schema": { + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "PutRecords proxy payload data", + "type": "object", + "required": [ + "records" + ], + "properties": { + "records": { + "type": "array", + "items": { + "type": "object", + "required": [ + "data", + "partitionKey" + ], + "properties": { + "data": { + "type": "string" + }, + "partitionKey": { + "type": "string" + } + } + } + } + } + } + } + }, + "testapigatewaykinesisdefaultLambdaRestApiCloudWatchRole319C8324": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "apigateway.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Policies": [ + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:DescribeLogGroups", + "logs:DescribeLogStreams", + "logs:FilterLogEvents", + "logs:GetLogEvents", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":*" + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "LambdaRestApiCloudWatchRolePolicy" + } + ] + } + }, + "testapigatewaykinesisdefaultLambdaRestApiAccountD40371B7": { + "Type": "AWS::ApiGateway::Account", + "Properties": { + "CloudWatchRoleArn": { + "Fn::GetAtt": [ + "testapigatewaykinesisdefaultLambdaRestApiCloudWatchRole319C8324", + "Arn" + ] + } + }, + "DependsOn": [ + "testapigatewaykinesisdefaultRestApi68CBA18C" + ] + }, + "testapigatewaykinesisdefaultapigatewayroleAD430BE2": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "apigateway.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "testapigatewaykinesisdefaultapigatewayroleDefaultPolicy65F728A5": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "kinesis:ListShards", + "kinesis:PutRecord", + "kinesis:PutRecords" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "KinesisStream46752A3E", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "testapigatewaykinesisdefaultapigatewayroleDefaultPolicy65F728A5", + "Roles": [ + { + "Ref": "testapigatewaykinesisdefaultapigatewayroleAD430BE2" + } + ] + } + }, + "testapigatewaykinesisdefaultKinesisStreamGetRecordsIteratorAgeAlarm0638BB32": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "AlarmDescription": "Consumer Record Processing Falling Behind, there is risk for data loss due to record expiration.", + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "EvaluationPeriods": 1, + "MetricName": "GetRecords.IteratorAgeMilliseconds", + "Namespace": "AWS/Kinesis", + "Period": 300, + "Statistic": "Maximum", + "Threshold": 43200000 + } + }, + "testapigatewaykinesisdefaultKinesisStreamReadProvisionedThroughputExceededAlarmE7251F6A": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "AlarmDescription": "Consumer Application is Reading at a Slower Rate Than Expected.", + "ComparisonOperator": "GreaterThanThreshold", + "EvaluationPeriods": 1, + "MetricName": "ReadProvisionedThroughputExceeded", + "Namespace": "AWS/Kinesis", + "Period": 300, + "Statistic": "Average", + "Threshold": 0 + } + }, + "KinesisStream46752A3E": { + "Type": "AWS::Kinesis::Stream", + "Properties": { + "RetentionPeriodHours": 24, + "ShardCount": 1, + "StreamEncryption": { + "EncryptionType": "KMS", + "KeyId": "alias/aws/kinesis" + } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + } + }, + "Outputs": { + "testapigatewaykinesisdefaultRestApiEndpoint70DAF21B": { + "Value": { + "Fn::Join": [ + "", + [ + "https://", + { + "Ref": "testapigatewaykinesisdefaultRestApi68CBA18C" + }, + ".execute-api.", + { + "Ref": "AWS::Region" + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "testapigatewaykinesisdefaultRestApiDeploymentStageprodB6206494" + }, + "/" + ] + ] + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-method-responses.js.snapshot/apikinmethodresponsesIntegDefaultTestDeployAssert45E8C7CC.assets.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-method-responses.js.snapshot/apikinmethodresponsesIntegDefaultTestDeployAssert45E8C7CC.assets.json new file mode 100644 index 000000000..2f214e919 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-method-responses.js.snapshot/apikinmethodresponsesIntegDefaultTestDeployAssert45E8C7CC.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "apikinmethodresponsesIntegDefaultTestDeployAssert45E8C7CC.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-method-responses.js.snapshot/apikinmethodresponsesIntegDefaultTestDeployAssert45E8C7CC.template.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-method-responses.js.snapshot/apikinmethodresponsesIntegDefaultTestDeployAssert45E8C7CC.template.json new file mode 100644 index 000000000..ad9d0fb73 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-method-responses.js.snapshot/apikinmethodresponsesIntegDefaultTestDeployAssert45E8C7CC.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-method-responses.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-method-responses.js.snapshot/cdk.out new file mode 100644 index 000000000..1f0068d32 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-method-responses.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"36.0.0"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-method-responses.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-method-responses.js.snapshot/integ.json new file mode 100644 index 000000000..a7eda20a2 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-method-responses.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "36.0.0", + "testCases": { + "apikin-method-responses/Integ/DefaultTest": { + "stacks": [ + "apikin-method-responses" + ], + "assertionStack": "apikin-method-responses/Integ/DefaultTest/DeployAssert", + "assertionStackName": "apikinmethodresponsesIntegDefaultTestDeployAssert45E8C7CC" + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-method-responses.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-method-responses.js.snapshot/manifest.json new file mode 100644 index 000000000..1b47dce6b --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-method-responses.js.snapshot/manifest.json @@ -0,0 +1,236 @@ +{ + "version": "36.0.0", + "artifacts": { + "apikinmethodresponsesIntegDefaultTestDeployAssert45E8C7CC.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "apikinmethodresponsesIntegDefaultTestDeployAssert45E8C7CC.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "apikinmethodresponsesIntegDefaultTestDeployAssert45E8C7CC": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "apikinmethodresponsesIntegDefaultTestDeployAssert45E8C7CC.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "apikinmethodresponsesIntegDefaultTestDeployAssert45E8C7CC.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "apikinmethodresponsesIntegDefaultTestDeployAssert45E8C7CC.assets" + ], + "metadata": { + "/apikin-method-responses/Integ/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/apikin-method-responses/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "apikin-method-responses/Integ/DefaultTest/DeployAssert" + }, + "apikin-method-responses.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "apikin-method-responses.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "apikin-method-responses": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "apikin-method-responses.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/42715264a3a3445003faaab6eaff07655fdab77730a1711c73b82494d6df6981.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "apikin-method-responses.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "apikin-method-responses.assets" + ], + "metadata": { + "/apikin-method-responses/test-apigateway-kinesis-default/ApiAccessLogGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaykinesisdefaultApiAccessLogGroup51BF9616" + } + ], + "/apikin-method-responses/test-apigateway-kinesis-default/RestApi/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaykinesisdefaultRestApi68CBA18C" + } + ], + "/apikin-method-responses/test-apigateway-kinesis-default/RestApi/Deployment/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaykinesisdefaultRestApiDeployment2852F1AAe11e785f0c835bae60935baac09fb799" + } + ], + "/apikin-method-responses/test-apigateway-kinesis-default/RestApi/DeploymentStage.prod/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaykinesisdefaultRestApiDeploymentStageprodB6206494" + } + ], + "/apikin-method-responses/test-apigateway-kinesis-default/RestApi/Endpoint": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaykinesisdefaultRestApiEndpoint70DAF21B" + } + ], + "/apikin-method-responses/test-apigateway-kinesis-default/RestApi/Default/record/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaykinesisdefaultRestApirecord500DDD57" + } + ], + "/apikin-method-responses/test-apigateway-kinesis-default/RestApi/Default/record/POST/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaykinesisdefaultRestApirecordPOST731165E8" + } + ], + "/apikin-method-responses/test-apigateway-kinesis-default/RestApi/Default/records/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaykinesisdefaultRestApirecords972EAFEA" + } + ], + "/apikin-method-responses/test-apigateway-kinesis-default/RestApi/Default/records/POST/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaykinesisdefaultRestApirecordsPOST165BE933" + } + ], + "/apikin-method-responses/test-apigateway-kinesis-default/RestApi/UsagePlan/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaykinesisdefaultRestApiUsagePlan9A725D0A" + } + ], + "/apikin-method-responses/test-apigateway-kinesis-default/RestApi/request-validator/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaykinesisdefaultRestApirequestvalidator5901C267" + } + ], + "/apikin-method-responses/test-apigateway-kinesis-default/RestApi/PutRecordModel/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaykinesisdefaultRestApiPutRecordModel06DC611F" + } + ], + "/apikin-method-responses/test-apigateway-kinesis-default/RestApi/PutRecordsModel/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaykinesisdefaultRestApiPutRecordsModelA7CA8D6D" + } + ], + "/apikin-method-responses/test-apigateway-kinesis-default/LambdaRestApiCloudWatchRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaykinesisdefaultLambdaRestApiCloudWatchRole319C8324" + } + ], + "/apikin-method-responses/test-apigateway-kinesis-default/LambdaRestApiAccount": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaykinesisdefaultLambdaRestApiAccountD40371B7" + } + ], + "/apikin-method-responses/test-apigateway-kinesis-default/api-gateway-role/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaykinesisdefaultapigatewayroleAD430BE2" + } + ], + "/apikin-method-responses/test-apigateway-kinesis-default/api-gateway-role/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaykinesisdefaultapigatewayroleDefaultPolicy65F728A5" + } + ], + "/apikin-method-responses/test-apigateway-kinesis-default/KinesisStreamGetRecordsIteratorAgeAlarm/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaykinesisdefaultKinesisStreamGetRecordsIteratorAgeAlarm0638BB32" + } + ], + "/apikin-method-responses/test-apigateway-kinesis-default/KinesisStreamReadProvisionedThroughputExceededAlarm/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaykinesisdefaultKinesisStreamReadProvisionedThroughputExceededAlarmE7251F6A" + } + ], + "/apikin-method-responses/KinesisStream/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "KinesisStream46752A3E" + } + ], + "/apikin-method-responses/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/apikin-method-responses/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ], + "testapigatewaykinesisdefaultRestApiDeployment2852F1AAdea1eee6eb398742be14d329909a39ef": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaykinesisdefaultRestApiDeployment2852F1AAdea1eee6eb398742be14d329909a39ef", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ] + }, + "displayName": "apikin-method-responses" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-method-responses.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-method-responses.js.snapshot/tree.json new file mode 100644 index 000000000..2fd6a4529 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-method-responses.js.snapshot/tree.json @@ -0,0 +1,987 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "apikin-method-responses": { + "id": "apikin-method-responses", + "path": "apikin-method-responses", + "children": { + "test-apigateway-kinesis-default": { + "id": "test-apigateway-kinesis-default", + "path": "apikin-method-responses/test-apigateway-kinesis-default", + "children": { + "ApiAccessLogGroup": { + "id": "ApiAccessLogGroup", + "path": "apikin-method-responses/test-apigateway-kinesis-default/ApiAccessLogGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "apikin-method-responses/test-apigateway-kinesis-default/ApiAccessLogGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", + "aws:cdk:cloudformation:props": {} + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.CfnLogGroup", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.LogGroup", + "version": "2.145.0" + } + }, + "RestApi": { + "id": "RestApi", + "path": "apikin-method-responses/test-apigateway-kinesis-default/RestApi", + "children": { + "Resource": { + "id": "Resource", + "path": "apikin-method-responses/test-apigateway-kinesis-default/RestApi/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::RestApi", + "aws:cdk:cloudformation:props": { + "endpointConfiguration": { + "types": [ + "EDGE" + ] + }, + "name": "RestApi" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnRestApi", + "version": "2.145.0" + } + }, + "Deployment": { + "id": "Deployment", + "path": "apikin-method-responses/test-apigateway-kinesis-default/RestApi/Deployment", + "children": { + "Resource": { + "id": "Resource", + "path": "apikin-method-responses/test-apigateway-kinesis-default/RestApi/Deployment/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Deployment", + "aws:cdk:cloudformation:props": { + "description": "Automatically created by the RestApi construct", + "restApiId": { + "Ref": "testapigatewaykinesisdefaultRestApi68CBA18C" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnDeployment", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.Deployment", + "version": "2.145.0" + } + }, + "DeploymentStage.prod": { + "id": "DeploymentStage.prod", + "path": "apikin-method-responses/test-apigateway-kinesis-default/RestApi/DeploymentStage.prod", + "children": { + "Resource": { + "id": "Resource", + "path": "apikin-method-responses/test-apigateway-kinesis-default/RestApi/DeploymentStage.prod/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Stage", + "aws:cdk:cloudformation:props": { + "accessLogSetting": { + "destinationArn": { + "Fn::GetAtt": [ + "testapigatewaykinesisdefaultApiAccessLogGroup51BF9616", + "Arn" + ] + }, + "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\"}" + }, + "deploymentId": { + "Ref": "testapigatewaykinesisdefaultRestApiDeployment2852F1AAe11e785f0c835bae60935baac09fb799" + }, + "methodSettings": [ + { + "httpMethod": "*", + "resourcePath": "/*", + "dataTraceEnabled": false, + "loggingLevel": "INFO" + } + ], + "restApiId": { + "Ref": "testapigatewaykinesisdefaultRestApi68CBA18C" + }, + "stageName": "prod", + "tracingEnabled": true + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnStage", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.Stage", + "version": "2.145.0" + } + }, + "Endpoint": { + "id": "Endpoint", + "path": "apikin-method-responses/test-apigateway-kinesis-default/RestApi/Endpoint", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnOutput", + "version": "2.145.0" + } + }, + "Default": { + "id": "Default", + "path": "apikin-method-responses/test-apigateway-kinesis-default/RestApi/Default", + "children": { + "record": { + "id": "record", + "path": "apikin-method-responses/test-apigateway-kinesis-default/RestApi/Default/record", + "children": { + "Resource": { + "id": "Resource", + "path": "apikin-method-responses/test-apigateway-kinesis-default/RestApi/Default/record/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Resource", + "aws:cdk:cloudformation:props": { + "parentId": { + "Fn::GetAtt": [ + "testapigatewaykinesisdefaultRestApi68CBA18C", + "RootResourceId" + ] + }, + "pathPart": "record", + "restApiId": { + "Ref": "testapigatewaykinesisdefaultRestApi68CBA18C" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnResource", + "version": "2.145.0" + } + }, + "POST": { + "id": "POST", + "path": "apikin-method-responses/test-apigateway-kinesis-default/RestApi/Default/record/POST", + "children": { + "Resource": { + "id": "Resource", + "path": "apikin-method-responses/test-apigateway-kinesis-default/RestApi/Default/record/POST/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Method", + "aws:cdk:cloudformation:props": { + "authorizationType": "AWS_IAM", + "httpMethod": "POST", + "integration": { + "type": "AWS", + "uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":kinesis:action/PutRecord" + ] + ] + }, + "integrationHttpMethod": "POST", + "requestParameters": { + "integration.request.header.Content-Type": "'x-amz-json-1.1'" + }, + "requestTemplates": { + "application/json": { + "Fn::Join": [ + "", + [ + "{ \"StreamName\": \"", + { + "Ref": "KinesisStream46752A3E" + }, + "\", \"Data\": \"$util.base64Encode($input.json('$.data'))\", \"PartitionKey\": \"$input.path('$.partitionKey')\" }" + ] + ] + } + }, + "passthroughBehavior": "NEVER", + "integrationResponses": [ + { + "statusCode": "200" + }, + { + "statusCode": "500", + "responseTemplates": { + "text/html": "Error" + }, + "selectionPattern": "500" + } + ], + "credentials": { + "Fn::GetAtt": [ + "testapigatewaykinesisdefaultapigatewayroleAD430BE2", + "Arn" + ] + } + }, + "methodResponses": [ + { + "statusCode": "200" + }, + { + "statusCode": "400" + }, + { + "statusCode": "401" + }, + { + "statusCode": "500" + } + ], + "requestModels": { + "application/json": { + "Ref": "testapigatewaykinesisdefaultRestApiPutRecordModel06DC611F" + } + }, + "requestValidatorId": { + "Ref": "testapigatewaykinesisdefaultRestApirequestvalidator5901C267" + }, + "resourceId": { + "Ref": "testapigatewaykinesisdefaultRestApirecord500DDD57" + }, + "restApiId": { + "Ref": "testapigatewaykinesisdefaultRestApi68CBA18C" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.Method", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.Resource", + "version": "2.145.0" + } + }, + "records": { + "id": "records", + "path": "apikin-method-responses/test-apigateway-kinesis-default/RestApi/Default/records", + "children": { + "Resource": { + "id": "Resource", + "path": "apikin-method-responses/test-apigateway-kinesis-default/RestApi/Default/records/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Resource", + "aws:cdk:cloudformation:props": { + "parentId": { + "Fn::GetAtt": [ + "testapigatewaykinesisdefaultRestApi68CBA18C", + "RootResourceId" + ] + }, + "pathPart": "records", + "restApiId": { + "Ref": "testapigatewaykinesisdefaultRestApi68CBA18C" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnResource", + "version": "2.145.0" + } + }, + "POST": { + "id": "POST", + "path": "apikin-method-responses/test-apigateway-kinesis-default/RestApi/Default/records/POST", + "children": { + "Resource": { + "id": "Resource", + "path": "apikin-method-responses/test-apigateway-kinesis-default/RestApi/Default/records/POST/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Method", + "aws:cdk:cloudformation:props": { + "authorizationType": "AWS_IAM", + "httpMethod": "POST", + "integration": { + "type": "AWS", + "uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":kinesis:action/PutRecords" + ] + ] + }, + "integrationHttpMethod": "POST", + "requestParameters": { + "integration.request.header.Content-Type": "'x-amz-json-1.1'" + }, + "requestTemplates": { + "application/json": { + "Fn::Join": [ + "", + [ + "{ \"StreamName\": \"", + { + "Ref": "KinesisStream46752A3E" + }, + "\", \"Records\": [ #foreach($elem in $input.path('$.records')) { \"Data\": \"$util.base64Encode($elem.data)\", \"PartitionKey\": \"$elem.partitionKey\"}#if($foreach.hasNext),#end #end ] }" + ] + ] + } + }, + "passthroughBehavior": "NEVER", + "integrationResponses": [ + { + "statusCode": "200" + }, + { + "statusCode": "500", + "responseTemplates": { + "text/html": "Error" + }, + "selectionPattern": "500" + } + ], + "credentials": { + "Fn::GetAtt": [ + "testapigatewaykinesisdefaultapigatewayroleAD430BE2", + "Arn" + ] + } + }, + "methodResponses": [ + { + "statusCode": "200" + }, + { + "statusCode": "300" + }, + { + "statusCode": "401" + } + ], + "requestModels": { + "application/json": { + "Ref": "testapigatewaykinesisdefaultRestApiPutRecordsModelA7CA8D6D" + } + }, + "requestValidatorId": { + "Ref": "testapigatewaykinesisdefaultRestApirequestvalidator5901C267" + }, + "resourceId": { + "Ref": "testapigatewaykinesisdefaultRestApirecords972EAFEA" + }, + "restApiId": { + "Ref": "testapigatewaykinesisdefaultRestApi68CBA18C" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.Method", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.Resource", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.ResourceBase", + "version": "2.145.0" + } + }, + "UsagePlan": { + "id": "UsagePlan", + "path": "apikin-method-responses/test-apigateway-kinesis-default/RestApi/UsagePlan", + "children": { + "Resource": { + "id": "Resource", + "path": "apikin-method-responses/test-apigateway-kinesis-default/RestApi/UsagePlan/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::UsagePlan", + "aws:cdk:cloudformation:props": { + "apiStages": [ + { + "apiId": { + "Ref": "testapigatewaykinesisdefaultRestApi68CBA18C" + }, + "stage": { + "Ref": "testapigatewaykinesisdefaultRestApiDeploymentStageprodB6206494" + }, + "throttle": {} + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnUsagePlan", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.UsagePlan", + "version": "2.145.0" + } + }, + "request-validator": { + "id": "request-validator", + "path": "apikin-method-responses/test-apigateway-kinesis-default/RestApi/request-validator", + "children": { + "Resource": { + "id": "Resource", + "path": "apikin-method-responses/test-apigateway-kinesis-default/RestApi/request-validator/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::RequestValidator", + "aws:cdk:cloudformation:props": { + "name": "request-body-validator", + "restApiId": { + "Ref": "testapigatewaykinesisdefaultRestApi68CBA18C" + }, + "validateRequestBody": true + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnRequestValidator", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.RequestValidator", + "version": "2.145.0" + } + }, + "PutRecordModel": { + "id": "PutRecordModel", + "path": "apikin-method-responses/test-apigateway-kinesis-default/RestApi/PutRecordModel", + "children": { + "Resource": { + "id": "Resource", + "path": "apikin-method-responses/test-apigateway-kinesis-default/RestApi/PutRecordModel/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Model", + "aws:cdk:cloudformation:props": { + "contentType": "application/json", + "description": "PutRecord proxy single-record payload", + "name": "PutRecordModel", + "restApiId": { + "Ref": "testapigatewaykinesisdefaultRestApi68CBA18C" + }, + "schema": { + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "PutRecord proxy single-record payload", + "type": "object", + "required": [ + "data", + "partitionKey" + ], + "properties": { + "data": { + "type": "string" + }, + "partitionKey": { + "type": "string" + } + } + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnModel", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.Model", + "version": "2.145.0" + } + }, + "PutRecordsModel": { + "id": "PutRecordsModel", + "path": "apikin-method-responses/test-apigateway-kinesis-default/RestApi/PutRecordsModel", + "children": { + "Resource": { + "id": "Resource", + "path": "apikin-method-responses/test-apigateway-kinesis-default/RestApi/PutRecordsModel/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Model", + "aws:cdk:cloudformation:props": { + "contentType": "application/json", + "description": "PutRecords proxy payload data", + "name": "PutRecordsModel", + "restApiId": { + "Ref": "testapigatewaykinesisdefaultRestApi68CBA18C" + }, + "schema": { + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "PutRecords proxy payload data", + "type": "object", + "required": [ + "records" + ], + "properties": { + "records": { + "type": "array", + "items": { + "type": "object", + "required": [ + "data", + "partitionKey" + ], + "properties": { + "data": { + "type": "string" + }, + "partitionKey": { + "type": "string" + } + } + } + } + } + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnModel", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.Model", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.RestApi", + "version": "2.145.0" + } + }, + "LambdaRestApiCloudWatchRole": { + "id": "LambdaRestApiCloudWatchRole", + "path": "apikin-method-responses/test-apigateway-kinesis-default/LambdaRestApiCloudWatchRole", + "children": { + "ImportLambdaRestApiCloudWatchRole": { + "id": "ImportLambdaRestApiCloudWatchRole", + "path": "apikin-method-responses/test-apigateway-kinesis-default/LambdaRestApiCloudWatchRole/ImportLambdaRestApiCloudWatchRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.145.0" + } + }, + "Resource": { + "id": "Resource", + "path": "apikin-method-responses/test-apigateway-kinesis-default/LambdaRestApiCloudWatchRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "apigateway.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "policies": [ + { + "policyName": "LambdaRestApiCloudWatchRolePolicy", + "policyDocument": { + "Statement": [ + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:DescribeLogGroups", + "logs:DescribeLogStreams", + "logs:FilterLogEvents", + "logs:GetLogEvents", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":*" + ] + ] + } + } + ], + "Version": "2012-10-17" + } + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.145.0" + } + }, + "LambdaRestApiAccount": { + "id": "LambdaRestApiAccount", + "path": "apikin-method-responses/test-apigateway-kinesis-default/LambdaRestApiAccount", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Account", + "aws:cdk:cloudformation:props": { + "cloudWatchRoleArn": { + "Fn::GetAtt": [ + "testapigatewaykinesisdefaultLambdaRestApiCloudWatchRole319C8324", + "Arn" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnAccount", + "version": "2.145.0" + } + }, + "api-gateway-role": { + "id": "api-gateway-role", + "path": "apikin-method-responses/test-apigateway-kinesis-default/api-gateway-role", + "children": { + "Importapi-gateway-role": { + "id": "Importapi-gateway-role", + "path": "apikin-method-responses/test-apigateway-kinesis-default/api-gateway-role/Importapi-gateway-role", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.145.0" + } + }, + "Resource": { + "id": "Resource", + "path": "apikin-method-responses/test-apigateway-kinesis-default/api-gateway-role/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "apigateway.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.145.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "apikin-method-responses/test-apigateway-kinesis-default/api-gateway-role/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "apikin-method-responses/test-apigateway-kinesis-default/api-gateway-role/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": [ + "kinesis:ListShards", + "kinesis:PutRecord", + "kinesis:PutRecords" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "KinesisStream46752A3E", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "policyName": "testapigatewaykinesisdefaultapigatewayroleDefaultPolicy65F728A5", + "roles": [ + { + "Ref": "testapigatewaykinesisdefaultapigatewayroleAD430BE2" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Policy", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.145.0" + } + }, + "KinesisStreamGetRecordsIteratorAgeAlarm": { + "id": "KinesisStreamGetRecordsIteratorAgeAlarm", + "path": "apikin-method-responses/test-apigateway-kinesis-default/KinesisStreamGetRecordsIteratorAgeAlarm", + "children": { + "Resource": { + "id": "Resource", + "path": "apikin-method-responses/test-apigateway-kinesis-default/KinesisStreamGetRecordsIteratorAgeAlarm/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "alarmDescription": "Consumer Record Processing Falling Behind, there is risk for data loss due to record expiration.", + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "evaluationPeriods": 1, + "metricName": "GetRecords.IteratorAgeMilliseconds", + "namespace": "AWS/Kinesis", + "period": 300, + "statistic": "Maximum", + "threshold": 43200000 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "2.145.0" + } + }, + "KinesisStreamReadProvisionedThroughputExceededAlarm": { + "id": "KinesisStreamReadProvisionedThroughputExceededAlarm", + "path": "apikin-method-responses/test-apigateway-kinesis-default/KinesisStreamReadProvisionedThroughputExceededAlarm", + "children": { + "Resource": { + "id": "Resource", + "path": "apikin-method-responses/test-apigateway-kinesis-default/KinesisStreamReadProvisionedThroughputExceededAlarm/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "alarmDescription": "Consumer Application is Reading at a Slower Rate Than Expected.", + "comparisonOperator": "GreaterThanThreshold", + "evaluationPeriods": 1, + "metricName": "ReadProvisionedThroughputExceeded", + "namespace": "AWS/Kinesis", + "period": 300, + "statistic": "Average", + "threshold": 0 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-solutions-constructs/aws-apigateway-kinesisstreams.ApiGatewayToKinesisStreams", + "version": "2.59.0" + } + }, + "KinesisStream": { + "id": "KinesisStream", + "path": "apikin-method-responses/KinesisStream", + "children": { + "Resource": { + "id": "Resource", + "path": "apikin-method-responses/KinesisStream/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Kinesis::Stream", + "aws:cdk:cloudformation:props": { + "retentionPeriodHours": 24, + "shardCount": 1, + "streamEncryption": { + "encryptionType": "KMS", + "keyId": "alias/aws/kinesis" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_kinesis.CfnStream", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_kinesis.Stream", + "version": "2.145.0" + } + }, + "Integ": { + "id": "Integ", + "path": "apikin-method-responses/Integ", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "apikin-method-responses/Integ/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "apikin-method-responses/Integ/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "apikin-method-responses/Integ/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "apikin-method-responses/Integ/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "2.145.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "apikin-method-responses/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "2.145.0-alpha.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "2.145.0-alpha.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "apikin-method-responses/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "2.145.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "apikin-method-responses/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "2.145.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.App", + "version": "2.145.0" + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-method-responses.ts b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-method-responses.ts new file mode 100644 index 000000000..923dae95c --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-method-responses.ts @@ -0,0 +1,61 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance + * with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES + * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +// Imports +import { App, Stack } from 'aws-cdk-lib'; +import { ApiGatewayToKinesisStreams, ApiGatewayToKinesisStreamsProps } from '../lib'; +import { generateIntegStackName } from '@aws-solutions-constructs/core'; +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; + +// Setup +const app = new App(); +const stack = new Stack(app, generateIntegStackName(__filename)); +stack.templateOptions.description = 'Integration Test for aws-apigateway-kinesis'; + +// Definitions +const props: ApiGatewayToKinesisStreamsProps = { + apiGatewayProps: {}, + kinesisStreamProps: {}, + putRecordMethodResponses: [ + { + statusCode: "200", + }, + { + statusCode: "400", + }, + { + statusCode: "401", + }, + { + statusCode: "500", + } + ], + putRecordsMethodResponses: [ + { + statusCode: "200", + }, + { + statusCode: "300", + }, + { + statusCode: "401", + } + ] +}; + +new ApiGatewayToKinesisStreams(stack, 'test-apigateway-kinesis-default', props); + +// Synth +new IntegTest(stack, 'Integ', { testCases: [ + stack +] }); diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-no-arguments.js.snapshot/apikin-no-arguments.assets.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-no-arguments.js.snapshot/apikin-no-arguments.assets.json index 3ee217947..eac600506 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-no-arguments.js.snapshot/apikin-no-arguments.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-no-arguments.js.snapshot/apikin-no-arguments.assets.json @@ -1,7 +1,7 @@ { "version": "36.0.0", "files": { - "d530d4fae0045c4d39f8b10efe8153b947cec73aa3f730f5762fbba1a30b8f65": { + "6370096b4deb761608bd18e0d11d5617688e5e380eee8c570360baa214ea42fd": { "source": { "path": "apikin-no-arguments.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "d530d4fae0045c4d39f8b10efe8153b947cec73aa3f730f5762fbba1a30b8f65.json", + "objectKey": "6370096b4deb761608bd18e0d11d5617688e5e380eee8c570360baa214ea42fd.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-no-arguments.js.snapshot/apikin-no-arguments.template.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-no-arguments.js.snapshot/apikin-no-arguments.template.json index 35c8d311e..338b4d82e 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-no-arguments.js.snapshot/apikin-no-arguments.template.json +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-no-arguments.js.snapshot/apikin-no-arguments.template.json @@ -31,7 +31,7 @@ "Name": "RestApi" } }, - "testapigatewaykinesisdefaultRestApiDeployment2852F1AA922824384d19fd27217710115cc2344f": { + "testapigatewaykinesisdefaultRestApiDeployment2852F1AA4ff693d376d46550825ad1d0025f9ef5": { "Type": "AWS::ApiGateway::Deployment", "Properties": { "Description": "Automatically created by the RestApi construct", @@ -72,7 +72,7 @@ "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\"}" }, "DeploymentId": { - "Ref": "testapigatewaykinesisdefaultRestApiDeployment2852F1AA922824384d19fd27217710115cc2344f" + "Ref": "testapigatewaykinesisdefaultRestApiDeployment2852F1AA4ff693d376d46550825ad1d0025f9ef5" }, "MethodSettings": [ { diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-no-arguments.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-no-arguments.js.snapshot/manifest.json index 1b9b33027..0bf58f720 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-no-arguments.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-no-arguments.js.snapshot/manifest.json @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/d530d4fae0045c4d39f8b10efe8153b947cec73aa3f730f5762fbba1a30b8f65.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/6370096b4deb761608bd18e0d11d5617688e5e380eee8c570360baa214ea42fd.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -97,7 +97,7 @@ "/apikin-no-arguments/test-apigateway-kinesis-default/RestApi/Deployment/Resource": [ { "type": "aws:cdk:logicalId", - "data": "testapigatewaykinesisdefaultRestApiDeployment2852F1AA922824384d19fd27217710115cc2344f" + "data": "testapigatewaykinesisdefaultRestApiDeployment2852F1AA4ff693d376d46550825ad1d0025f9ef5" } ], "/apikin-no-arguments/test-apigateway-kinesis-default/RestApi/DeploymentStage.prod/Resource": [ @@ -213,6 +213,15 @@ "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } + ], + "testapigatewaykinesisdefaultRestApiDeployment2852F1AA922824384d19fd27217710115cc2344f": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaykinesisdefaultRestApiDeployment2852F1AA922824384d19fd27217710115cc2344f", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } ] }, "displayName": "apikin-no-arguments" diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-no-arguments.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-no-arguments.js.snapshot/tree.json index beccf3c0f..da9d69e92 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-no-arguments.js.snapshot/tree.json +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apikin-no-arguments.js.snapshot/tree.json @@ -25,13 +25,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_logs.CfnLogGroup", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_logs.LogGroup", - "version": "2.143.0" + "version": "2.145.0" } }, "RestApi": { @@ -54,7 +54,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnRestApi", - "version": "2.143.0" + "version": "2.145.0" } }, "Deployment": { @@ -75,13 +75,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnDeployment", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Deployment", - "version": "2.143.0" + "version": "2.145.0" } }, "DeploymentStage.prod": { @@ -104,7 +104,7 @@ "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\"}" }, "deploymentId": { - "Ref": "testapigatewaykinesisdefaultRestApiDeployment2852F1AA922824384d19fd27217710115cc2344f" + "Ref": "testapigatewaykinesisdefaultRestApiDeployment2852F1AA4ff693d376d46550825ad1d0025f9ef5" }, "methodSettings": [ { @@ -123,13 +123,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnStage", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Stage", - "version": "2.143.0" + "version": "2.145.0" } }, "Endpoint": { @@ -137,7 +137,7 @@ "path": "apikin-no-arguments/test-apigateway-kinesis-default/RestApi/Endpoint", "constructInfo": { "fqn": "aws-cdk-lib.CfnOutput", - "version": "2.143.0" + "version": "2.145.0" } }, "Default": { @@ -168,7 +168,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnResource", - "version": "2.143.0" + "version": "2.145.0" } }, "POST": { @@ -271,19 +271,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Method", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Resource", - "version": "2.143.0" + "version": "2.145.0" } }, "records": { @@ -310,7 +310,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnResource", - "version": "2.143.0" + "version": "2.145.0" } }, "POST": { @@ -413,25 +413,25 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Method", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Resource", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.ResourceBase", - "version": "2.143.0" + "version": "2.145.0" } }, "UsagePlan": { @@ -459,13 +459,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnUsagePlan", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.UsagePlan", - "version": "2.143.0" + "version": "2.145.0" } }, "request-validator": { @@ -487,13 +487,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnRequestValidator", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.RequestValidator", - "version": "2.143.0" + "version": "2.145.0" } }, "PutRecordModel": { @@ -533,13 +533,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnModel", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Model", - "version": "2.143.0" + "version": "2.145.0" } }, "PutRecordsModel": { @@ -590,19 +590,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnModel", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.Model", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.RestApi", - "version": "2.143.0" + "version": "2.145.0" } }, "LambdaRestApiCloudWatchRole": { @@ -614,7 +614,7 @@ "path": "apikin-no-arguments/test-apigateway-kinesis-default/LambdaRestApiCloudWatchRole/ImportLambdaRestApiCloudWatchRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.143.0" + "version": "2.145.0" } }, "Resource": { @@ -681,13 +681,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.143.0" + "version": "2.145.0" } }, "LambdaRestApiAccount": { @@ -706,7 +706,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_apigateway.CfnAccount", - "version": "2.143.0" + "version": "2.145.0" } }, "api-gateway-role": { @@ -718,7 +718,7 @@ "path": "apikin-no-arguments/test-apigateway-kinesis-default/api-gateway-role/Importapi-gateway-role", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.143.0" + "version": "2.145.0" } }, "Resource": { @@ -743,7 +743,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.143.0" + "version": "2.145.0" } }, "DefaultPolicy": { @@ -785,19 +785,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.143.0" + "version": "2.145.0" } }, "KinesisStreamGetRecordsIteratorAgeAlarm": { @@ -822,13 +822,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", - "version": "2.143.0" + "version": "2.145.0" } }, "KinesisStreamReadProvisionedThroughputExceededAlarm": { @@ -853,19 +853,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "@aws-solutions-constructs/aws-apigateway-kinesisstreams.ApiGatewayToKinesisStreams", - "version": "2.57.0" + "version": "2.59.0" } }, "KinesisStream": { @@ -888,13 +888,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kinesis.CfnStream", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kinesis.Stream", - "version": "2.143.0" + "version": "2.145.0" } }, "Integ": { @@ -922,7 +922,7 @@ "path": "apikin-no-arguments/Integ/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.143.0" + "version": "2.145.0" } }, "CheckBootstrapVersion": { @@ -930,25 +930,25 @@ "path": "apikin-no-arguments/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", - "version": "2.143.0-alpha.0" + "version": "2.145.0-alpha.0" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", - "version": "2.143.0-alpha.0" + "version": "2.145.0-alpha.0" } }, "BootstrapVersion": { @@ -956,7 +956,7 @@ "path": "apikin-no-arguments/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.143.0" + "version": "2.145.0" } }, "CheckBootstrapVersion": { @@ -964,13 +964,13 @@ "path": "apikin-no-arguments/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.143.0" + "version": "2.145.0" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.143.0" + "version": "2.145.0" } }, "Tree": { @@ -984,7 +984,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.App", - "version": "2.143.0" + "version": "2.145.0" } } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-sagemakerendpoint/lib/index.ts b/source/patterns/@aws-solutions-constructs/aws-apigateway-sagemakerendpoint/lib/index.ts index 7d2324c18..7a9e8711c 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-sagemakerendpoint/lib/index.ts +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-sagemakerendpoint/lib/index.ts @@ -178,13 +178,15 @@ export class ApiGatewayToSageMakerEndpoint extends Construct { apiGatewayRole: this.apiGatewayRole, apiMethod: 'GET', apiResource, - requestValidator, requestTemplate: props.requestMappingTemplate, additionalRequestTemplates: props.additionalRequestTemplates, awsIntegrationProps: { options: { integrationResponses: integResponses } }, - methodOptions: { methodResponses } + methodOptions: { + methodResponses, + requestValidator, + } }); } } diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/README.md b/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/README.md index b6224d2e7..c69dd7bdd 100755 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/README.md +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/README.md @@ -66,14 +66,17 @@ new ApiGatewayToSqs(this, "ApiGatewayToSqsPattern", new ApiGatewayToSqsProps.Bui |createRequestTemplate?|`string`|API Gateway Request Template for the create method for the default `application/json` content-type. This property is required if the `allowCreateOperation` property is set to true.| |additionalCreateRequestTemplates?|`{ [contentType: string]: string; }`|Optional Create Request Templates for content-types other than `application/json`. Use the `createRequestTemplate` property to set the request template for the `application/json` content-type. This property can only be specified if the `allowCreateOperation` property is set to true.| |createIntegrationResponses?|[`api.IntegrationResponses[]`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.IntegrationResponse.html)|Optional, custom API Gateway Integration Response for the create method. This property can only be specified if the `allowCreateOperation` property is set to true.| +|createMethodResponses?|[`api.MethodResponses[]`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.MethodResponse.html)| Optional, custom API Gateway Method Responses for the create action. default: [{ statusCode: "200", responseParameters: { "method.response.header.Content-Type": true }},{ statusCode: "500", responseParameters: { "method.response.header.Content-Type": true } } ]| |allowReadOperation?|`boolean`|Whether to deploy an API Gateway Method for GET HTTP operations on the queue (i.e. sqs:ReceiveMessage).| |readRequestTemplate?|`string`|API Gateway Request Template for the read method for the default `application/json` content-type.| |additionalReadRequestTemplates?|`{ [contentType: string]: string; }`|Optional Read Request Templates for content-types other than `application/json`. Use the `readRequestTemplate` property to set the request template for the `application/json` content-type.| |readIntegrationResponses?|[`api.IntegrationResponses[]`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.IntegrationResponse.html)|Optional, custom API Gateway Integration Response for the read method.| +|readMethodResponses?|[`api.MethodResponses[]`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.MethodResponse.html)| Optional, custom API Gateway Method Responses for the read action. default: [{ statusCode: "200", responseParameters: { "method.response.header.Content-Type": true }},{ statusCode: "500", responseParameters: { "method.response.header.Content-Type": true } } ]| |allowDeleteOperation?|`boolean`|Whether to deploy an API Gateway Method for HTTP DELETE operations on the queue (i.e. sqs:DeleteMessage).| |deleteRequestTemplate?|`string`|API Gateway Request Template for THE delete method for the default `application/json` content-type. This property can only be specified if the `allowDeleteOperation` property is set to true.| |additionalDeleteRequestTemplates?|`{ [contentType: string]: string; }`|Optional Delete request templates for content-types other than `application/json`. Use the `deleteRequestTemplate` property to set the request template for the `application/json` content-type. This property can only be specified if the `allowDeleteOperation` property is set to true.| |deleteIntegrationResponses?|[`api.IntegrationResponses[]`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.IntegrationResponse.html)|Optional, custom API Gateway Integration Response for the delete method. This property can only be specified if the `allowDeleteOperation` property is set to true.| +|deleteMethodResponses?|[`api.MethodResponses[]`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.MethodResponse.html)| Optional, custom API Gateway Method Responses for the delete action. default: [{ statusCode: "200", responseParameters: { "method.response.header.Content-Type": true }},{ statusCode: "500", responseParameters: { "method.response.header.Content-Type": true } } ]| |logGroupProps?|[`logs.LogGroupProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_logs.LogGroupProps.html)|User provided props to override the default props for for the CloudWatchLogs LogGroup.| |enableEncryptionWithCustomerManagedKey?|`boolean`|If no key is provided, this flag determines whether the queue is encrypted with a new CMK or an AWS managed key. This flag is ignored if any of the following are defined: queueProps.encryptionMasterKey, encryptionKey or encryptionKeyProps.| |encryptionKey?|[`kms.Key`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms.Key.html)|An optional, imported encryption key to encrypt the SQS Queue with.| diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/lib/index.ts b/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/lib/index.ts index f9dbc2488..f3a6b54d8 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/lib/index.ts +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/lib/index.ts @@ -89,6 +89,25 @@ export interface ApiGatewayToSqsProps { * @default - [{statusCode:"200"},{statusCode:"500",responseTemplates:{"text/html":"Error"},selectionPattern:"500"}] */ readonly createIntegrationResponses?: api.IntegrationResponse[]; + /** + * Optional, custom API Gateway Method Responses for the create action. + * + * @default - [ + * { + * statusCode: "200", + * responseParameters: { + * "method.response.header.Content-Type": true + * } + * }, + * { + * statusCode: "500", + * responseParameters: { + * "method.response.header.Content-Type": true + * }, + * } + * ] + */ + readonly createMethodResponses?: api.MethodResponse[]; /** * Whether to deploy an API Gateway Method for GET HTTP operations on the queue (i.e. sqs:ReceiveMessage). * @@ -117,6 +136,25 @@ export interface ApiGatewayToSqsProps { * @default - [{statusCode:"200"},{statusCode:"500",responseTemplates:{"text/html":"Error"},selectionPattern:"500"}] */ readonly readIntegrationResponses?: api.IntegrationResponse[]; + /** + * Optional, custom API Gateway Method Responses for the create action. + * + * @default - [ + * { + * statusCode: "200", + * responseParameters: { + * "method.response.header.Content-Type": true + * } + * }, + * { + * statusCode: "500", + * responseParameters: { + * "method.response.header.Content-Type": true + * }, + * } + * ] + */ + readonly readMethodResponses?: api.MethodResponse[]; /** * Whether to deploy an API Gateway Method for HTTP DELETE operations on the queue (i.e. sqs:DeleteMessage). * @@ -144,6 +182,25 @@ export interface ApiGatewayToSqsProps { * @default - [{statusCode:"200"},{statusCode:"500",responseTemplates:{"text/html":"Error"},selectionPattern:"500"}] */ readonly deleteIntegrationResponses?: api.IntegrationResponse[]; + /** + * Optional, custom API Gateway Method Responses for the create action. + * + * @default - [ + * { + * statusCode: "200", + * responseParameters: { + * "method.response.header.Content-Type": true + * } + * }, + * { + * statusCode: "500", + * responseParameters: { + * "method.response.header.Content-Type": true + * }, + * } + * ] + */ + readonly deleteMethodResponses?: api.MethodResponse[]; /** * User provided props to override the default props for the CloudWatchLogs LogGroup. * @@ -239,6 +296,7 @@ export class ApiGatewayToSqs extends Construct { // Create const createRequestTemplate = props.createRequestTemplate ?? this.defaultCreateRequestTemplate; if (props.allowCreateOperation && props.allowCreateOperation === true) { + const createMethodOptions: api.MethodOptions = props.createMethodResponses ? { methodResponses: props.createMethodResponses } : {}; this.addActionToPolicy("sqs:SendMessage"); defaults.addProxyMethodToApiResource({ service: "sqs", @@ -249,12 +307,14 @@ export class ApiGatewayToSqs extends Construct { requestTemplate: createRequestTemplate, additionalRequestTemplates: props.additionalCreateRequestTemplates, contentType: "'application/x-www-form-urlencoded'", - integrationResponses: props.createIntegrationResponses + integrationResponses: props.createIntegrationResponses, + methodOptions: createMethodOptions }); } // Read const readRequestTemplate = props.readRequestTemplate ?? this.defaultReadRequestTemplate; + const readMethodOptions: api.MethodOptions = props.readMethodResponses ? { methodResponses: props.readMethodResponses } : {}; if (props.allowReadOperation === undefined || props.allowReadOperation === true) { this.addActionToPolicy("sqs:ReceiveMessage"); defaults.addProxyMethodToApiResource({ @@ -266,12 +326,14 @@ export class ApiGatewayToSqs extends Construct { requestTemplate: readRequestTemplate, additionalRequestTemplates: props.additionalReadRequestTemplates, contentType: "'application/x-www-form-urlencoded'", - integrationResponses: props.readIntegrationResponses + integrationResponses: props.readIntegrationResponses, + methodOptions: readMethodOptions }); } // Delete const deleteRequestTemplate = props.deleteRequestTemplate ?? this.defaultDeleteRequestTemplate; + const deleteMethodOptions: api.MethodOptions = props.deleteMethodResponses ? { methodResponses: props.deleteMethodResponses } : {}; if (props.allowDeleteOperation && props.allowDeleteOperation === true) { const apiGatewayResource = this.apiGateway.root.addResource('message'); this.addActionToPolicy("sqs:DeleteMessage"); @@ -284,7 +346,8 @@ export class ApiGatewayToSqs extends Construct { requestTemplate: deleteRequestTemplate, additionalRequestTemplates: props.additionalDeleteRequestTemplates, contentType: "'application/x-www-form-urlencoded'", - integrationResponses: props.deleteIntegrationResponses + integrationResponses: props.deleteIntegrationResponses, + methodOptions: deleteMethodOptions }); } } diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/apigateway-sqs.test.ts b/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/apigateway-sqs.test.ts index fb0485537..24f8640b5 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/apigateway-sqs.test.ts +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/apigateway-sqs.test.ts @@ -675,3 +675,115 @@ test('Confirm the CheckSqsProps is being called', () => { expect(app).toThrowError(/Error - Either provide queueProps or existingQueueObj, but not both.\n/); }); + +test('Construct uses custom createMethodResponses property', () => { + const stack = new Stack(); + new ApiGatewayToSqs(stack, 'api-gateway-sqs', { + allowCreateOperation: true, + createIntegrationResponses: [ + { + statusCode: '401', + responseTemplates: { + 'text/html': 'fingerprint' + } + } + ], + createMethodResponses: [{ + statusCode: "401" + }] + }); + + const template = Template.fromStack(stack); + template.hasResourceProperties('AWS::ApiGateway::Method', { + HttpMethod: 'POST', + MethodResponses: [{ + StatusCode: "401" + }], + Integration: { + IntegrationResponses: [ + { + ResponseTemplates: { + 'text/html': 'fingerprint' + }, + StatusCode: '401' + } + ] + } + }); +}); + +test.only('Construct uses custom deleteMethodResponses property', () => { + const stack = new Stack(); + new ApiGatewayToSqs(stack, 'api-gateway-sqs', { + allowCreateOperation: false, + allowReadOperation: false, + allowDeleteOperation: true, + deleteIntegrationResponses: [ + { + statusCode: '401', + responseTemplates: { + 'text/html': 'fingerprint' + } + } + ], + deleteMethodResponses: [{ + statusCode: "401" + }] + }); + + const template = Template.fromStack(stack); + template.hasResourceProperties('AWS::ApiGateway::Method', { + HttpMethod: 'DELETE', + MethodResponses: [{ + StatusCode: "401" + }], + Integration: { + IntegrationResponses: [ + { + ResponseTemplates: { + 'text/html': 'fingerprint' + }, + StatusCode: '401' + } + ] + } + }); +}); + +test.only('Construct uses custom readMethodResponses property', () => { + const stack = new Stack(); + new ApiGatewayToSqs(stack, 'api-gateway-sqs', { + allowCreateOperation: false, + allowDeleteOperation: false, + allowReadOperation: true, + readIntegrationResponses: [ + { + statusCode: '401', + responseTemplates: { + 'text/html': 'fingerprint' + } + } + ], + readMethodResponses: [{ + statusCode: "401" + }] + }); + + const template = Template.fromStack(stack); + template.hasResourceProperties('AWS::ApiGateway::Method', { + HttpMethod: 'GET', + MethodResponses: [{ + StatusCode: "401" + }], + Integration: { + IntegrationResponses: [ + { + ResponseTemplates: { + 'text/html': 'fingerprint' + }, + StatusCode: '401' + } + ] + } + }); +}); diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apisqs-custom-method-responses.js.snapshot/apisqs-custom-method-responses.assets.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apisqs-custom-method-responses.js.snapshot/apisqs-custom-method-responses.assets.json new file mode 100644 index 000000000..e10c78f9d --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apisqs-custom-method-responses.js.snapshot/apisqs-custom-method-responses.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.0", + "files": { + "f25b07b1d61fd0823b1b80d906c1aee13ecac76543e91622038c86121876aa31": { + "source": { + "path": "apisqs-custom-method-responses.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "f25b07b1d61fd0823b1b80d906c1aee13ecac76543e91622038c86121876aa31.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apisqs-custom-method-responses.js.snapshot/apisqs-custom-method-responses.template.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apisqs-custom-method-responses.js.snapshot/apisqs-custom-method-responses.template.json new file mode 100644 index 000000000..c6bee1537 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apisqs-custom-method-responses.js.snapshot/apisqs-custom-method-responses.template.json @@ -0,0 +1,523 @@ +{ + "Description": "Integration Test for aws-apigateway-sqs", + "Resources": { + "testapigatewaysqsintegrationresponsesqueuedlqD02C49B3": { + "Type": "AWS::SQS::Queue", + "Properties": { + "KmsMasterKeyId": "alias/aws/sqs" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "testapigatewaysqsintegrationresponsesqueuedlqPolicy65790213": { + "Type": "AWS::SQS::QueuePolicy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "sqs:AddPermission", + "sqs:DeleteMessage", + "sqs:GetQueueAttributes", + "sqs:ReceiveMessage", + "sqs:RemovePermission", + "sqs:SendMessage", + "sqs:SetQueueAttributes" + ], + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] + } + }, + "Resource": { + "Fn::GetAtt": [ + "testapigatewaysqsintegrationresponsesqueuedlqD02C49B3", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testapigatewaysqsintegrationresponsesqueuedlqD02C49B3", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "Queues": [ + { + "Ref": "testapigatewaysqsintegrationresponsesqueuedlqD02C49B3" + } + ] + } + }, + "testapigatewaysqsintegrationresponsesqueueF9FA04EF": { + "Type": "AWS::SQS::Queue", + "Properties": { + "KmsMasterKeyId": "alias/aws/sqs", + "RedrivePolicy": { + "deadLetterTargetArn": { + "Fn::GetAtt": [ + "testapigatewaysqsintegrationresponsesqueuedlqD02C49B3", + "Arn" + ] + }, + "maxReceiveCount": 15 + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "testapigatewaysqsintegrationresponsesqueuePolicy22D3DE99": { + "Type": "AWS::SQS::QueuePolicy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "sqs:AddPermission", + "sqs:DeleteMessage", + "sqs:GetQueueAttributes", + "sqs:ReceiveMessage", + "sqs:RemovePermission", + "sqs:SendMessage", + "sqs:SetQueueAttributes" + ], + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] + } + }, + "Resource": { + "Fn::GetAtt": [ + "testapigatewaysqsintegrationresponsesqueueF9FA04EF", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testapigatewaysqsintegrationresponsesqueueF9FA04EF", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "Queues": [ + { + "Ref": "testapigatewaysqsintegrationresponsesqueueF9FA04EF" + } + ] + } + }, + "testapigatewaysqsintegrationresponsesApiAccessLogGroup12574495": { + "Type": "AWS::Logs::LogGroup", + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain", + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W86", + "reason": "Retention period for CloudWatchLogs LogGroups are set to 'Never Expire' to preserve customer data indefinitely" + }, + { + "id": "W84", + "reason": "By default CloudWatchLogs LogGroups data is encrypted using the CloudWatch server-side encryption keys (AWS Managed Keys)" + } + ] + } + } + }, + "testapigatewaysqsintegrationresponsesRestApi3BE7E402": { + "Type": "AWS::ApiGateway::RestApi", + "Properties": { + "EndpointConfiguration": { + "Types": [ + "EDGE" + ] + }, + "Name": "RestApi" + } + }, + "testapigatewaysqsintegrationresponsesRestApiDeployment97492235ba12181676bc85f5ec834b0573595244": { + "Type": "AWS::ApiGateway::Deployment", + "Properties": { + "Description": "Automatically created by the RestApi construct", + "RestApiId": { + "Ref": "testapigatewaysqsintegrationresponsesRestApi3BE7E402" + } + }, + "DependsOn": [ + "testapigatewaysqsintegrationresponsesRestApiGETD105D1F1" + ], + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W45", + "reason": "ApiGateway has AccessLogging enabled in AWS::ApiGateway::Stage resource, but cfn_nag checks for it in AWS::ApiGateway::Deployment resource" + } + ] + } + } + }, + "testapigatewaysqsintegrationresponsesRestApiDeploymentStageprod07200D02": { + "Type": "AWS::ApiGateway::Stage", + "Properties": { + "AccessLogSetting": { + "DestinationArn": { + "Fn::GetAtt": [ + "testapigatewaysqsintegrationresponsesApiAccessLogGroup12574495", + "Arn" + ] + }, + "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\"}" + }, + "DeploymentId": { + "Ref": "testapigatewaysqsintegrationresponsesRestApiDeployment97492235ba12181676bc85f5ec834b0573595244" + }, + "MethodSettings": [ + { + "DataTraceEnabled": false, + "HttpMethod": "*", + "LoggingLevel": "INFO", + "ResourcePath": "/*" + } + ], + "RestApiId": { + "Ref": "testapigatewaysqsintegrationresponsesRestApi3BE7E402" + }, + "StageName": "prod", + "TracingEnabled": true + } + }, + "testapigatewaysqsintegrationresponsesRestApiGETD105D1F1": { + "Type": "AWS::ApiGateway::Method", + "Properties": { + "AuthorizationType": "AWS_IAM", + "HttpMethod": "GET", + "Integration": { + "Credentials": { + "Fn::GetAtt": [ + "testapigatewaysqsintegrationresponsesapigatewayrole6FC88B17", + "Arn" + ] + }, + "IntegrationHttpMethod": "POST", + "IntegrationResponses": [ + { + "ResponseTemplates": { + "text/html": "OK" + }, + "StatusCode": "200" + } + ], + "PassthroughBehavior": "NEVER", + "RequestParameters": { + "integration.request.header.Content-Type": "'application/x-www-form-urlencoded'" + }, + "RequestTemplates": { + "application/json": "Action=ReceiveMessage" + }, + "Type": "AWS", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":sqs:path/", + { + "Ref": "AWS::AccountId" + }, + "/", + { + "Fn::GetAtt": [ + "testapigatewaysqsintegrationresponsesqueueF9FA04EF", + "QueueName" + ] + } + ] + ] + } + }, + "MethodResponses": [ + { + "StatusCode": "200" + }, + { + "StatusCode": "403" + } + ], + "ResourceId": { + "Fn::GetAtt": [ + "testapigatewaysqsintegrationresponsesRestApi3BE7E402", + "RootResourceId" + ] + }, + "RestApiId": { + "Ref": "testapigatewaysqsintegrationresponsesRestApi3BE7E402" + } + } + }, + "testapigatewaysqsintegrationresponsesRestApiUsagePlan4172DBF8": { + "Type": "AWS::ApiGateway::UsagePlan", + "Properties": { + "ApiStages": [ + { + "ApiId": { + "Ref": "testapigatewaysqsintegrationresponsesRestApi3BE7E402" + }, + "Stage": { + "Ref": "testapigatewaysqsintegrationresponsesRestApiDeploymentStageprod07200D02" + }, + "Throttle": {} + } + ] + } + }, + "testapigatewaysqsintegrationresponsesLambdaRestApiCloudWatchRoleC95A1D3B": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "apigateway.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Policies": [ + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:DescribeLogGroups", + "logs:DescribeLogStreams", + "logs:FilterLogEvents", + "logs:GetLogEvents", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":*" + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "LambdaRestApiCloudWatchRolePolicy" + } + ] + } + }, + "testapigatewaysqsintegrationresponsesLambdaRestApiAccountEFC75D59": { + "Type": "AWS::ApiGateway::Account", + "Properties": { + "CloudWatchRoleArn": { + "Fn::GetAtt": [ + "testapigatewaysqsintegrationresponsesLambdaRestApiCloudWatchRoleC95A1D3B", + "Arn" + ] + } + }, + "DependsOn": [ + "testapigatewaysqsintegrationresponsesRestApi3BE7E402" + ] + }, + "testapigatewaysqsintegrationresponsesapigatewayrole6FC88B17": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "apigateway.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "testapigatewaysqsintegrationresponsesapigatewayroleDefaultPolicyB4D5EFE9": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "sqs:ReceiveMessage", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "testapigatewaysqsintegrationresponsesqueueF9FA04EF", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "testapigatewaysqsintegrationresponsesapigatewayroleDefaultPolicyB4D5EFE9", + "Roles": [ + { + "Ref": "testapigatewaysqsintegrationresponsesapigatewayrole6FC88B17" + } + ] + } + } + }, + "Outputs": { + "testapigatewaysqsintegrationresponsesRestApiEndpointEBC579CE": { + "Value": { + "Fn::Join": [ + "", + [ + "https://", + { + "Ref": "testapigatewaysqsintegrationresponsesRestApi3BE7E402" + }, + ".execute-api.", + { + "Ref": "AWS::Region" + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "testapigatewaysqsintegrationresponsesRestApiDeploymentStageprod07200D02" + }, + "/" + ] + ] + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apisqs-custom-method-responses.js.snapshot/apisqscustommethodresponsesIntegDefaultTestDeployAssert1077EBE4.assets.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apisqs-custom-method-responses.js.snapshot/apisqscustommethodresponsesIntegDefaultTestDeployAssert1077EBE4.assets.json new file mode 100644 index 000000000..786b0edea --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apisqs-custom-method-responses.js.snapshot/apisqscustommethodresponsesIntegDefaultTestDeployAssert1077EBE4.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "apisqscustommethodresponsesIntegDefaultTestDeployAssert1077EBE4.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apisqs-custom-method-responses.js.snapshot/apisqscustommethodresponsesIntegDefaultTestDeployAssert1077EBE4.template.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apisqs-custom-method-responses.js.snapshot/apisqscustommethodresponsesIntegDefaultTestDeployAssert1077EBE4.template.json new file mode 100644 index 000000000..ad9d0fb73 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apisqs-custom-method-responses.js.snapshot/apisqscustommethodresponsesIntegDefaultTestDeployAssert1077EBE4.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apisqs-custom-method-responses.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apisqs-custom-method-responses.js.snapshot/cdk.out new file mode 100644 index 000000000..1f0068d32 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apisqs-custom-method-responses.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"36.0.0"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apisqs-custom-method-responses.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apisqs-custom-method-responses.js.snapshot/integ.json new file mode 100644 index 000000000..846124056 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apisqs-custom-method-responses.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "36.0.0", + "testCases": { + "apisqs-custom-method-responses/Integ/DefaultTest": { + "stacks": [ + "apisqs-custom-method-responses" + ], + "assertionStack": "apisqs-custom-method-responses/Integ/DefaultTest/DeployAssert", + "assertionStackName": "apisqscustommethodresponsesIntegDefaultTestDeployAssert1077EBE4" + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apisqs-custom-method-responses.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apisqs-custom-method-responses.js.snapshot/manifest.json new file mode 100644 index 000000000..ffca0bc98 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apisqs-custom-method-responses.js.snapshot/manifest.json @@ -0,0 +1,197 @@ +{ + "version": "36.0.0", + "artifacts": { + "apisqscustommethodresponsesIntegDefaultTestDeployAssert1077EBE4.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "apisqscustommethodresponsesIntegDefaultTestDeployAssert1077EBE4.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "apisqscustommethodresponsesIntegDefaultTestDeployAssert1077EBE4": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "apisqscustommethodresponsesIntegDefaultTestDeployAssert1077EBE4.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "apisqscustommethodresponsesIntegDefaultTestDeployAssert1077EBE4.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "apisqscustommethodresponsesIntegDefaultTestDeployAssert1077EBE4.assets" + ], + "metadata": { + "/apisqs-custom-method-responses/Integ/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/apisqs-custom-method-responses/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "apisqs-custom-method-responses/Integ/DefaultTest/DeployAssert" + }, + "apisqs-custom-method-responses.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "apisqs-custom-method-responses.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "apisqs-custom-method-responses": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "apisqs-custom-method-responses.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/f25b07b1d61fd0823b1b80d906c1aee13ecac76543e91622038c86121876aa31.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "apisqs-custom-method-responses.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "apisqs-custom-method-responses.assets" + ], + "metadata": { + "/apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/queue-dlq/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaysqsintegrationresponsesqueuedlqD02C49B3" + } + ], + "/apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/queue-dlq/Policy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaysqsintegrationresponsesqueuedlqPolicy65790213" + } + ], + "/apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/queue/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaysqsintegrationresponsesqueueF9FA04EF" + } + ], + "/apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/queue/Policy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaysqsintegrationresponsesqueuePolicy22D3DE99" + } + ], + "/apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/ApiAccessLogGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaysqsintegrationresponsesApiAccessLogGroup12574495" + } + ], + "/apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/RestApi/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaysqsintegrationresponsesRestApi3BE7E402" + } + ], + "/apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/RestApi/Deployment/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaysqsintegrationresponsesRestApiDeployment97492235ba12181676bc85f5ec834b0573595244" + } + ], + "/apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/RestApi/DeploymentStage.prod/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaysqsintegrationresponsesRestApiDeploymentStageprod07200D02" + } + ], + "/apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/RestApi/Endpoint": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaysqsintegrationresponsesRestApiEndpointEBC579CE" + } + ], + "/apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/RestApi/Default/GET/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaysqsintegrationresponsesRestApiGETD105D1F1" + } + ], + "/apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/RestApi/UsagePlan/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaysqsintegrationresponsesRestApiUsagePlan4172DBF8" + } + ], + "/apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/LambdaRestApiCloudWatchRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaysqsintegrationresponsesLambdaRestApiCloudWatchRoleC95A1D3B" + } + ], + "/apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/LambdaRestApiAccount": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaysqsintegrationresponsesLambdaRestApiAccountEFC75D59" + } + ], + "/apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/api-gateway-role/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaysqsintegrationresponsesapigatewayrole6FC88B17" + } + ], + "/apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/api-gateway-role/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testapigatewaysqsintegrationresponsesapigatewayroleDefaultPolicyB4D5EFE9" + } + ], + "/apisqs-custom-method-responses/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/apisqs-custom-method-responses/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "apisqs-custom-method-responses" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apisqs-custom-method-responses.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apisqs-custom-method-responses.js.snapshot/tree.json new file mode 100644 index 000000000..1b2a568c7 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apisqs-custom-method-responses.js.snapshot/tree.json @@ -0,0 +1,808 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "apisqs-custom-method-responses": { + "id": "apisqs-custom-method-responses", + "path": "apisqs-custom-method-responses", + "children": { + "test-api-gateway-sqs-integration-responses": { + "id": "test-api-gateway-sqs-integration-responses", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses", + "children": { + "queue-dlq": { + "id": "queue-dlq", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/queue-dlq", + "children": { + "Resource": { + "id": "Resource", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/queue-dlq/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::Queue", + "aws:cdk:cloudformation:props": { + "kmsMasterKeyId": "alias/aws/sqs" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueue", + "version": "2.145.0" + } + }, + "Policy": { + "id": "Policy", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/queue-dlq/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/queue-dlq/Policy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::QueuePolicy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": [ + "sqs:AddPermission", + "sqs:DeleteMessage", + "sqs:GetQueueAttributes", + "sqs:ReceiveMessage", + "sqs:RemovePermission", + "sqs:SendMessage", + "sqs:SetQueueAttributes" + ], + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] + } + }, + "Resource": { + "Fn::GetAtt": [ + "testapigatewaysqsintegrationresponsesqueuedlqD02C49B3", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testapigatewaysqsintegrationresponsesqueuedlqD02C49B3", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "queues": [ + { + "Ref": "testapigatewaysqsintegrationresponsesqueuedlqD02C49B3" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.Queue", + "version": "2.145.0" + } + }, + "queue": { + "id": "queue", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/queue", + "children": { + "Resource": { + "id": "Resource", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/queue/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::Queue", + "aws:cdk:cloudformation:props": { + "kmsMasterKeyId": "alias/aws/sqs", + "redrivePolicy": { + "deadLetterTargetArn": { + "Fn::GetAtt": [ + "testapigatewaysqsintegrationresponsesqueuedlqD02C49B3", + "Arn" + ] + }, + "maxReceiveCount": 15 + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueue", + "version": "2.145.0" + } + }, + "Policy": { + "id": "Policy", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/queue/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/queue/Policy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::QueuePolicy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": [ + "sqs:AddPermission", + "sqs:DeleteMessage", + "sqs:GetQueueAttributes", + "sqs:ReceiveMessage", + "sqs:RemovePermission", + "sqs:SendMessage", + "sqs:SetQueueAttributes" + ], + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] + } + }, + "Resource": { + "Fn::GetAtt": [ + "testapigatewaysqsintegrationresponsesqueueF9FA04EF", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testapigatewaysqsintegrationresponsesqueueF9FA04EF", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "queues": [ + { + "Ref": "testapigatewaysqsintegrationresponsesqueueF9FA04EF" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.Queue", + "version": "2.145.0" + } + }, + "ApiAccessLogGroup": { + "id": "ApiAccessLogGroup", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/ApiAccessLogGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/ApiAccessLogGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", + "aws:cdk:cloudformation:props": {} + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.CfnLogGroup", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.LogGroup", + "version": "2.145.0" + } + }, + "RestApi": { + "id": "RestApi", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/RestApi", + "children": { + "Resource": { + "id": "Resource", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/RestApi/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::RestApi", + "aws:cdk:cloudformation:props": { + "endpointConfiguration": { + "types": [ + "EDGE" + ] + }, + "name": "RestApi" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnRestApi", + "version": "2.145.0" + } + }, + "Deployment": { + "id": "Deployment", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/RestApi/Deployment", + "children": { + "Resource": { + "id": "Resource", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/RestApi/Deployment/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Deployment", + "aws:cdk:cloudformation:props": { + "description": "Automatically created by the RestApi construct", + "restApiId": { + "Ref": "testapigatewaysqsintegrationresponsesRestApi3BE7E402" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnDeployment", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.Deployment", + "version": "2.145.0" + } + }, + "DeploymentStage.prod": { + "id": "DeploymentStage.prod", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/RestApi/DeploymentStage.prod", + "children": { + "Resource": { + "id": "Resource", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/RestApi/DeploymentStage.prod/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Stage", + "aws:cdk:cloudformation:props": { + "accessLogSetting": { + "destinationArn": { + "Fn::GetAtt": [ + "testapigatewaysqsintegrationresponsesApiAccessLogGroup12574495", + "Arn" + ] + }, + "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\"}" + }, + "deploymentId": { + "Ref": "testapigatewaysqsintegrationresponsesRestApiDeployment97492235ba12181676bc85f5ec834b0573595244" + }, + "methodSettings": [ + { + "httpMethod": "*", + "resourcePath": "/*", + "dataTraceEnabled": false, + "loggingLevel": "INFO" + } + ], + "restApiId": { + "Ref": "testapigatewaysqsintegrationresponsesRestApi3BE7E402" + }, + "stageName": "prod", + "tracingEnabled": true + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnStage", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.Stage", + "version": "2.145.0" + } + }, + "Endpoint": { + "id": "Endpoint", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/RestApi/Endpoint", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnOutput", + "version": "2.145.0" + } + }, + "Default": { + "id": "Default", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/RestApi/Default", + "children": { + "GET": { + "id": "GET", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/RestApi/Default/GET", + "children": { + "Resource": { + "id": "Resource", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/RestApi/Default/GET/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Method", + "aws:cdk:cloudformation:props": { + "authorizationType": "AWS_IAM", + "httpMethod": "GET", + "integration": { + "type": "AWS", + "uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":sqs:path/", + { + "Ref": "AWS::AccountId" + }, + "/", + { + "Fn::GetAtt": [ + "testapigatewaysqsintegrationresponsesqueueF9FA04EF", + "QueueName" + ] + } + ] + ] + }, + "integrationHttpMethod": "POST", + "requestParameters": { + "integration.request.header.Content-Type": "'application/x-www-form-urlencoded'" + }, + "requestTemplates": { + "application/json": "Action=ReceiveMessage" + }, + "passthroughBehavior": "NEVER", + "integrationResponses": [ + { + "statusCode": "200", + "responseTemplates": { + "text/html": "OK" + } + } + ], + "credentials": { + "Fn::GetAtt": [ + "testapigatewaysqsintegrationresponsesapigatewayrole6FC88B17", + "Arn" + ] + } + }, + "methodResponses": [ + { + "statusCode": "200" + }, + { + "statusCode": "403" + } + ], + "resourceId": { + "Fn::GetAtt": [ + "testapigatewaysqsintegrationresponsesRestApi3BE7E402", + "RootResourceId" + ] + }, + "restApiId": { + "Ref": "testapigatewaysqsintegrationresponsesRestApi3BE7E402" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.Method", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.ResourceBase", + "version": "2.145.0" + } + }, + "UsagePlan": { + "id": "UsagePlan", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/RestApi/UsagePlan", + "children": { + "Resource": { + "id": "Resource", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/RestApi/UsagePlan/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::UsagePlan", + "aws:cdk:cloudformation:props": { + "apiStages": [ + { + "apiId": { + "Ref": "testapigatewaysqsintegrationresponsesRestApi3BE7E402" + }, + "stage": { + "Ref": "testapigatewaysqsintegrationresponsesRestApiDeploymentStageprod07200D02" + }, + "throttle": {} + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnUsagePlan", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.UsagePlan", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.RestApi", + "version": "2.145.0" + } + }, + "LambdaRestApiCloudWatchRole": { + "id": "LambdaRestApiCloudWatchRole", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/LambdaRestApiCloudWatchRole", + "children": { + "ImportLambdaRestApiCloudWatchRole": { + "id": "ImportLambdaRestApiCloudWatchRole", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/LambdaRestApiCloudWatchRole/ImportLambdaRestApiCloudWatchRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.145.0" + } + }, + "Resource": { + "id": "Resource", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/LambdaRestApiCloudWatchRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "apigateway.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "policies": [ + { + "policyName": "LambdaRestApiCloudWatchRolePolicy", + "policyDocument": { + "Statement": [ + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:DescribeLogGroups", + "logs:DescribeLogStreams", + "logs:FilterLogEvents", + "logs:GetLogEvents", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":*" + ] + ] + } + } + ], + "Version": "2012-10-17" + } + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.145.0" + } + }, + "LambdaRestApiAccount": { + "id": "LambdaRestApiAccount", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/LambdaRestApiAccount", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Account", + "aws:cdk:cloudformation:props": { + "cloudWatchRoleArn": { + "Fn::GetAtt": [ + "testapigatewaysqsintegrationresponsesLambdaRestApiCloudWatchRoleC95A1D3B", + "Arn" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnAccount", + "version": "2.145.0" + } + }, + "api-gateway-role": { + "id": "api-gateway-role", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/api-gateway-role", + "children": { + "Importapi-gateway-role": { + "id": "Importapi-gateway-role", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/api-gateway-role/Importapi-gateway-role", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.145.0" + } + }, + "Resource": { + "id": "Resource", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/api-gateway-role/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "apigateway.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.145.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/api-gateway-role/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "apisqs-custom-method-responses/test-api-gateway-sqs-integration-responses/api-gateway-role/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "sqs:ReceiveMessage", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "testapigatewaysqsintegrationresponsesqueueF9FA04EF", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "policyName": "testapigatewaysqsintegrationresponsesapigatewayroleDefaultPolicyB4D5EFE9", + "roles": [ + { + "Ref": "testapigatewaysqsintegrationresponsesapigatewayrole6FC88B17" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Policy", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-solutions-constructs/aws-apigateway-sqs.ApiGatewayToSqs", + "version": "2.59.0" + } + }, + "Integ": { + "id": "Integ", + "path": "apisqs-custom-method-responses/Integ", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "apisqs-custom-method-responses/Integ/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "apisqs-custom-method-responses/Integ/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "apisqs-custom-method-responses/Integ/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "apisqs-custom-method-responses/Integ/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "2.145.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "apisqs-custom-method-responses/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "2.145.0-alpha.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "2.145.0-alpha.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "apisqs-custom-method-responses/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "2.145.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "apisqs-custom-method-responses/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "2.145.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "2.145.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.App", + "version": "2.145.0" + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apisqs-custom-method-responses.ts b/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apisqs-custom-method-responses.ts new file mode 100644 index 000000000..4f2a01be9 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apisqs-custom-method-responses.ts @@ -0,0 +1,46 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance + * with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES + * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +// Imports +import { App, Stack } from "aws-cdk-lib"; +import { ApiGatewayToSqs } from "../lib"; +import { generateIntegStackName } from '@aws-solutions-constructs/core'; +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; + +// Setup +const app = new App(); +const stack = new Stack(app, generateIntegStackName(__filename)); +stack.templateOptions.description = 'Integration Test for aws-apigateway-sqs'; + +new ApiGatewayToSqs(stack, 'test-api-gateway-sqs-integration-responses', { + allowReadOperation: true, + readIntegrationResponses: [ + { + statusCode: '200', + responseTemplates: { + 'text/html': 'OK' + } + } + ], + readMethodResponses: [{ + statusCode: '200' + }, + { + statusCode: '403' + }] +}); + +// Synth +new IntegTest(stack, 'Integ', { testCases: [ + stack +] }); diff --git a/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetExistingLambdaFunctions.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetExistingLambdaFunctions.js.snapshot/manifest.json index e37e079e3..255441227 100644 --- a/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetExistingLambdaFunctions.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetExistingLambdaFunctions.js.snapshot/manifest.json @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/cc472bbc9b3f388de29e5834aa43374fb2caf4fa98fdf07936cb76dc9f9697f2.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/4657e305aa94c87300b65d66b779b36f89e94a27a6cbec6f10fa032edb836a56.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetExistingLambdaFunctions.js.snapshot/opilam-apiFromAssetExistingLambdaFunctions.assets.json b/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetExistingLambdaFunctions.js.snapshot/opilam-apiFromAssetExistingLambdaFunctions.assets.json index 5287339fd..d0eea3824 100644 --- a/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetExistingLambdaFunctions.js.snapshot/opilam-apiFromAssetExistingLambdaFunctions.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetExistingLambdaFunctions.js.snapshot/opilam-apiFromAssetExistingLambdaFunctions.assets.json @@ -79,7 +79,7 @@ } } }, - "cc472bbc9b3f388de29e5834aa43374fb2caf4fa98fdf07936cb76dc9f9697f2": { + "4657e305aa94c87300b65d66b779b36f89e94a27a6cbec6f10fa032edb836a56": { "source": { "path": "opilam-apiFromAssetExistingLambdaFunctions.template.json", "packaging": "file" @@ -87,7 +87,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "cc472bbc9b3f388de29e5834aa43374fb2caf4fa98fdf07936cb76dc9f9697f2.json", + "objectKey": "4657e305aa94c87300b65d66b779b36f89e94a27a6cbec6f10fa032edb836a56.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetExistingLambdaFunctions.js.snapshot/opilam-apiFromAssetExistingLambdaFunctions.template.json b/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetExistingLambdaFunctions.js.snapshot/opilam-apiFromAssetExistingLambdaFunctions.template.json index 7f6e3008b..263b11450 100644 --- a/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetExistingLambdaFunctions.js.snapshot/opilam-apiFromAssetExistingLambdaFunctions.template.json +++ b/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetExistingLambdaFunctions.js.snapshot/opilam-apiFromAssetExistingLambdaFunctions.template.json @@ -737,6 +737,9 @@ "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" } }, + "DependsOn": [ + "OpenApiGatewayToLambdaApiTemplateWriterPolicy5B3085E5" + ], "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, diff --git a/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetExistingLambdaFunctions.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetExistingLambdaFunctions.js.snapshot/tree.json index c408047f9..1c1b8177a 100644 --- a/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetExistingLambdaFunctions.js.snapshot/tree.json +++ b/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetExistingLambdaFunctions.js.snapshot/tree.json @@ -1350,7 +1350,7 @@ }, "constructInfo": { "fqn": "@aws-solutions-constructs/aws-openapigateway-lambda.OpenApiGatewayToLambda", - "version": "2.60.0" + "version": "2.61.0" } }, "LatestNodeRuntimeMap": { diff --git a/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetNewLambdaFunctions.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetNewLambdaFunctions.js.snapshot/manifest.json index 4f9b0e83f..130bfbca7 100644 --- a/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetNewLambdaFunctions.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetNewLambdaFunctions.js.snapshot/manifest.json @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/b2c940c9e01aafc78df6b0ddb8102def3ff0a14f316d80e3d76921915a8a6b12.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/34e4475454df938a6455b7952b7d26f110717f4f3163067061885efdfba1c0c3.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetNewLambdaFunctions.js.snapshot/opilam-apiFromAssetNewLambdaFunctions.assets.json b/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetNewLambdaFunctions.js.snapshot/opilam-apiFromAssetNewLambdaFunctions.assets.json index ad21ccee9..a79175c5c 100644 --- a/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetNewLambdaFunctions.js.snapshot/opilam-apiFromAssetNewLambdaFunctions.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetNewLambdaFunctions.js.snapshot/opilam-apiFromAssetNewLambdaFunctions.assets.json @@ -79,7 +79,7 @@ } } }, - "b2c940c9e01aafc78df6b0ddb8102def3ff0a14f316d80e3d76921915a8a6b12": { + "34e4475454df938a6455b7952b7d26f110717f4f3163067061885efdfba1c0c3": { "source": { "path": "opilam-apiFromAssetNewLambdaFunctions.template.json", "packaging": "file" @@ -87,7 +87,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "b2c940c9e01aafc78df6b0ddb8102def3ff0a14f316d80e3d76921915a8a6b12.json", + "objectKey": "34e4475454df938a6455b7952b7d26f110717f4f3163067061885efdfba1c0c3.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetNewLambdaFunctions.js.snapshot/opilam-apiFromAssetNewLambdaFunctions.template.json b/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetNewLambdaFunctions.js.snapshot/opilam-apiFromAssetNewLambdaFunctions.template.json index e0a3f5407..dfd929d61 100644 --- a/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetNewLambdaFunctions.js.snapshot/opilam-apiFromAssetNewLambdaFunctions.template.json +++ b/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetNewLambdaFunctions.js.snapshot/opilam-apiFromAssetNewLambdaFunctions.template.json @@ -736,6 +736,9 @@ "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" } }, + "DependsOn": [ + "OpenApiGatewayToLambdaApiTemplateWriterPolicy5B3085E5" + ], "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, diff --git a/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetNewLambdaFunctions.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetNewLambdaFunctions.js.snapshot/tree.json index cfc02d7bb..dc8dd76c7 100644 --- a/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetNewLambdaFunctions.js.snapshot/tree.json +++ b/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetNewLambdaFunctions.js.snapshot/tree.json @@ -1349,7 +1349,7 @@ }, "constructInfo": { "fqn": "@aws-solutions-constructs/aws-openapigateway-lambda.OpenApiGatewayToLambda", - "version": "2.60.0" + "version": "2.61.0" } }, "LatestNodeRuntimeMap": { diff --git a/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetWithCognitoAuth.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetWithCognitoAuth.js.snapshot/manifest.json index 66eafb312..4666710f7 100644 --- a/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetWithCognitoAuth.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetWithCognitoAuth.js.snapshot/manifest.json @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/853470d1f0bc850f4dc49b30dde72ad23ca69dfaf079be46d6cf4c36d29094f1.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/0a7a6398c4b2441c2df95bebf2fa1bf0210be8ad13baa7b830bc7a3551f1e101.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetWithCognitoAuth.js.snapshot/opilam-apiFromAssetWithCognitoAuth.assets.json b/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetWithCognitoAuth.js.snapshot/opilam-apiFromAssetWithCognitoAuth.assets.json index 7d113db3f..98418e857 100644 --- a/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetWithCognitoAuth.js.snapshot/opilam-apiFromAssetWithCognitoAuth.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetWithCognitoAuth.js.snapshot/opilam-apiFromAssetWithCognitoAuth.assets.json @@ -79,7 +79,7 @@ } } }, - "853470d1f0bc850f4dc49b30dde72ad23ca69dfaf079be46d6cf4c36d29094f1": { + "0a7a6398c4b2441c2df95bebf2fa1bf0210be8ad13baa7b830bc7a3551f1e101": { "source": { "path": "opilam-apiFromAssetWithCognitoAuth.template.json", "packaging": "file" @@ -87,7 +87,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "853470d1f0bc850f4dc49b30dde72ad23ca69dfaf079be46d6cf4c36d29094f1.json", + "objectKey": "0a7a6398c4b2441c2df95bebf2fa1bf0210be8ad13baa7b830bc7a3551f1e101.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetWithCognitoAuth.js.snapshot/opilam-apiFromAssetWithCognitoAuth.template.json b/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetWithCognitoAuth.js.snapshot/opilam-apiFromAssetWithCognitoAuth.template.json index 1bdab4fc8..5ffcee76e 100644 --- a/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetWithCognitoAuth.js.snapshot/opilam-apiFromAssetWithCognitoAuth.template.json +++ b/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetWithCognitoAuth.js.snapshot/opilam-apiFromAssetWithCognitoAuth.template.json @@ -736,6 +736,9 @@ "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" } }, + "DependsOn": [ + "OpenApiGatewayToLambdaApiTemplateWriterPolicy5B3085E5" + ], "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, diff --git a/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetWithCognitoAuth.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetWithCognitoAuth.js.snapshot/tree.json index 931491cd6..b5fed9ab0 100644 --- a/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetWithCognitoAuth.js.snapshot/tree.json +++ b/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/test/integ.opilam-apiFromAssetWithCognitoAuth.js.snapshot/tree.json @@ -1349,7 +1349,7 @@ }, "constructInfo": { "fqn": "@aws-solutions-constructs/aws-openapigateway-lambda.OpenApiGatewayToLambda", - "version": "2.60.0" + "version": "2.61.0" } }, "LatestNodeRuntimeMap": { diff --git a/source/patterns/@aws-solutions-constructs/core/lib/apigateway-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/apigateway-helper.ts index ea26649a2..fb6ff164c 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/apigateway-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/apigateway-helper.ts @@ -320,8 +320,6 @@ export interface AddProxyMethodToApiResourceInputParams { readonly additionalRequestTemplates?: { [contentType: string]: string; }, readonly integrationResponses?: cdk.aws_apigateway.IntegrationResponse[], readonly contentType?: string, - readonly requestValidator?: apigateway.IRequestValidator, - readonly requestModel?: { [contentType: string]: apigateway.IModel; }, readonly awsIntegrationProps?: apigateway.AwsIntegrationProps | any, readonly methodOptions?: apigateway.MethodOptions } @@ -393,9 +391,7 @@ export function addProxyMethodToApiResource(params: AddProxyMethodToApiResourceI "method.response.header.Content-Type": true }, } - ], - requestValidator: params.requestValidator, - requestModels: params.requestModel + ] }; // Setup the API Gateway method diff --git a/source/patterns/@aws-solutions-constructs/core/test/apigateway-helper.test.ts b/source/patterns/@aws-solutions-constructs/core/test/apigateway-helper.test.ts index 6f3906735..631b69e9e 100644 --- a/source/patterns/@aws-solutions-constructs/core/test/apigateway-helper.test.ts +++ b/source/patterns/@aws-solutions-constructs/core/test/apigateway-helper.test.ts @@ -310,8 +310,10 @@ test('Test default RestApi w/ request model and validator', () => { apiResource: apiGatewayResource, requestTemplate: "{}", contentType: "'x-amz-json-1.1'", - requestValidator: validator, - requestModel: { "application/json": api.Model.EMPTY_MODEL } + methodOptions: { + requestValidator: validator, + requestModels: { "application/json": api.Model.EMPTY_MODEL } + } }); const template = Template.fromStack(stack); diff --git a/source/patterns/@aws-solutions-constructs/resources/lib/template-writer.ts b/source/patterns/@aws-solutions-constructs/resources/lib/template-writer.ts index 955641727..6af904b61 100644 --- a/source/patterns/@aws-solutions-constructs/resources/lib/template-writer.ts +++ b/source/patterns/@aws-solutions-constructs/resources/lib/template-writer.ts @@ -140,6 +140,8 @@ export function createTemplateWriterCustomResource( } }); + customResource.node.addDependency(templateWriterPolicy); + return { s3Bucket: outputAsset.bucket, s3Key: customResource.getAttString('TemplateOutputKey'), diff --git a/source/patterns/@aws-solutions-constructs/resources/test/integ.template-writer-from-asset.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/resources/test/integ.template-writer-from-asset.js.snapshot/manifest.json index 81c1deb94..91d747385 100644 --- a/source/patterns/@aws-solutions-constructs/resources/test/integ.template-writer-from-asset.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/resources/test/integ.template-writer-from-asset.js.snapshot/manifest.json @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/674ff8d03f3f67ae845dfc5bdba69f5d60210f5c4bc6eda2d950a379a7b3b668.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/bbc26051b499cb1d06bdf02dc0f0acd036f5577bb6e2f3a2dea1262ced2c6e20.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/source/patterns/@aws-solutions-constructs/resources/test/integ.template-writer-from-asset.js.snapshot/template-writer-from-asset.assets.json b/source/patterns/@aws-solutions-constructs/resources/test/integ.template-writer-from-asset.js.snapshot/template-writer-from-asset.assets.json index b26226f70..5bdbd42a5 100644 --- a/source/patterns/@aws-solutions-constructs/resources/test/integ.template-writer-from-asset.js.snapshot/template-writer-from-asset.assets.json +++ b/source/patterns/@aws-solutions-constructs/resources/test/integ.template-writer-from-asset.js.snapshot/template-writer-from-asset.assets.json @@ -53,7 +53,7 @@ } } }, - "674ff8d03f3f67ae845dfc5bdba69f5d60210f5c4bc6eda2d950a379a7b3b668": { + "bbc26051b499cb1d06bdf02dc0f0acd036f5577bb6e2f3a2dea1262ced2c6e20": { "source": { "path": "template-writer-from-asset.template.json", "packaging": "file" @@ -61,7 +61,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "674ff8d03f3f67ae845dfc5bdba69f5d60210f5c4bc6eda2d950a379a7b3b668.json", + "objectKey": "bbc26051b499cb1d06bdf02dc0f0acd036f5577bb6e2f3a2dea1262ced2c6e20.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/resources/test/integ.template-writer-from-asset.js.snapshot/template-writer-from-asset.template.json b/source/patterns/@aws-solutions-constructs/resources/test/integ.template-writer-from-asset.js.snapshot/template-writer-from-asset.template.json index 92fedf8c3..f15135a14 100644 --- a/source/patterns/@aws-solutions-constructs/resources/test/integ.template-writer-from-asset.js.snapshot/template-writer-from-asset.template.json +++ b/source/patterns/@aws-solutions-constructs/resources/test/integ.template-writer-from-asset.js.snapshot/template-writer-from-asset.template.json @@ -347,6 +347,9 @@ "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" } }, + "DependsOn": [ + "TestTemplateWriterPolicy8177DE02" + ], "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" } diff --git a/source/patterns/@aws-solutions-constructs/resources/test/integ.template-writer-from-large-asset.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/resources/test/integ.template-writer-from-large-asset.js.snapshot/manifest.json index 62d57f1d0..5bfcbd0cc 100644 --- a/source/patterns/@aws-solutions-constructs/resources/test/integ.template-writer-from-large-asset.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/resources/test/integ.template-writer-from-large-asset.js.snapshot/manifest.json @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/5dd2fd9947fca23c108771ba84b7f81fc023ffa9ed968daf7d893728adb871ed.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/25072d476c1c822407709a831d0a1e35d0ef566c9ebc838be4f3336e42077f0a.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/source/patterns/@aws-solutions-constructs/resources/test/integ.template-writer-from-large-asset.js.snapshot/template-writer-from-large-asset.assets.json b/source/patterns/@aws-solutions-constructs/resources/test/integ.template-writer-from-large-asset.js.snapshot/template-writer-from-large-asset.assets.json index f96026327..f17877169 100644 --- a/source/patterns/@aws-solutions-constructs/resources/test/integ.template-writer-from-large-asset.js.snapshot/template-writer-from-large-asset.assets.json +++ b/source/patterns/@aws-solutions-constructs/resources/test/integ.template-writer-from-large-asset.js.snapshot/template-writer-from-large-asset.assets.json @@ -53,7 +53,7 @@ } } }, - "5dd2fd9947fca23c108771ba84b7f81fc023ffa9ed968daf7d893728adb871ed": { + "25072d476c1c822407709a831d0a1e35d0ef566c9ebc838be4f3336e42077f0a": { "source": { "path": "template-writer-from-large-asset.template.json", "packaging": "file" @@ -61,7 +61,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "5dd2fd9947fca23c108771ba84b7f81fc023ffa9ed968daf7d893728adb871ed.json", + "objectKey": "25072d476c1c822407709a831d0a1e35d0ef566c9ebc838be4f3336e42077f0a.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/resources/test/integ.template-writer-from-large-asset.js.snapshot/template-writer-from-large-asset.template.json b/source/patterns/@aws-solutions-constructs/resources/test/integ.template-writer-from-large-asset.js.snapshot/template-writer-from-large-asset.template.json index ee16251f3..c8219a930 100644 --- a/source/patterns/@aws-solutions-constructs/resources/test/integ.template-writer-from-large-asset.js.snapshot/template-writer-from-large-asset.template.json +++ b/source/patterns/@aws-solutions-constructs/resources/test/integ.template-writer-from-large-asset.js.snapshot/template-writer-from-large-asset.template.json @@ -349,6 +349,9 @@ "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" } }, + "DependsOn": [ + "TestTemplateWriterPolicy8177DE02" + ], "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }