Skip to content

Commit

Permalink
Merge pull request #1032 from awslabs/bump/2.47.0
Browse files Browse the repository at this point in the history
chore(release): 2.47.0
  • Loading branch information
biffgaut authored Dec 1, 2023
2 parents e9db892 + 8410e6f commit 498ea12
Show file tree
Hide file tree
Showing 108 changed files with 4,218 additions and 1,006 deletions.
21 changes: 10 additions & 11 deletions .viperlightignore
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,17 @@ source/patterns/@aws-solutions-constructs/aws-alb-lambda/README.md:35
source/patterns/@aws-solutions-constructs/aws-alb-lambda/test/alb-lambda.test.ts:27
source/patterns/@aws-solutions-constructs/aws-alb-lambda/test/alb-lambda.test.ts:680
# These are references to the us-east-1 ELBV2 account (publicly known)
source/patterns/@aws-solutions-constructs/aws-route53-alb/test/integ.r53alb-deployPrivateApi.expected.json:236
source/patterns/@aws-solutions-constructs/aws-route53-alb/test/integ.r53alb-deployPrivateApiExistingZone.expected.json:905
source/patterns/@aws-solutions-constructs/aws-route53-alb/test/integ.r53alb-deployPublicApiNewAlb.expected.json:234
source/patterns/@aws-solutions-constructs/aws-alb-lambda/test/integ.alblam-privateApiNewResources.expected.json:239
source/patterns/@aws-solutions-constructs/aws-alb-lambda/test/integ.alblam-publicApiNewResources.expected.json:245
source/patterns/@aws-solutions-constructs/aws-alb-lambda/test/integ.alblam-twoTargets.expected.json:245
source/patterns/@aws-solutions-constructs/aws-alb-lambda/test/integ.alblam-privateApiExistingResources.expected.json:1133
source/patterns/@aws-solutions-constructs/aws-alb-lambda/test/integ.alblam-publicApiExistingResources.expected.json:1133
source/patterns/@aws-solutions-constructs/aws-alb-fargate/test/integ.albfar-all-new-two-targets.expected.json:1034
source/patterns/@aws-solutions-constructs/aws-alb-fargate/test/integ.albfar-all-new-public-http.expected.json:1063
source/patterns/@aws-solutions-constructs/aws-route53-alb/test/integ.r53alb-deployPrivateApi.expected.json:229
source/patterns/@aws-solutions-constructs/aws-route53-alb/test/integ.r53alb-deployPrivateApiExistingZone.expected.json:898
source/patterns/@aws-solutions-constructs/aws-route53-alb/test/integ.r53alb-deployPublicApiNewAlb.expected.json:227
source/patterns/@aws-solutions-constructs/aws-alb-lambda/test/integ.alblam-privateApiNewResources.expected.json:232
source/patterns/@aws-solutions-constructs/aws-alb-lambda/test/integ.alblam-publicApiNewResources.expected.json:238
source/patterns/@aws-solutions-constructs/aws-alb-lambda/test/integ.alblam-twoTargets.expected.json:238
source/patterns/@aws-solutions-constructs/aws-alb-lambda/test/integ.alblam-privateApiExistingResources.expected.json:1126
source/patterns/@aws-solutions-constructs/aws-alb-lambda/test/integ.alblam-publicApiExistingResources.expected.json:1126
source/patterns/@aws-solutions-constructs/aws-alb-fargate/test/integ.albfar-all-new-two-targets.expected.json:1078
source/patterns/@aws-solutions-constructs/aws-alb-fargate/test/integ.albfar-all-new-public-http.expected.json:1051
source/patterns/@aws-solutions-constructs/aws-route53-alb/test/integ.r53alb-deployPublicApiNewAlb.expected.json:237
source/patterns/@aws-solutions-constructs/aws-alb-fargate/test/integ.albfar-all-new-two-targets.expected.json:1090
source/patterns/@aws-solutions-constructs/aws-alb-fargate/README.md:79
source/patterns/@aws-solutions-constructs/aws-alb-lambda/README.md:85
source/patterns/@aws-solutions-constructs/aws-route53-alb/README.md:60
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

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.47.0](https://github.com/awslabs/aws-solutions-constructs/compare/v2.46.0...v2.47.0) (2023-12-01)

Built on CDK v2.111.0

### Bug Fixes

* **aws-apigateway-sqs:** Remove /message path when delete method is not allowed ([#1030](https://github.com/awslabs/aws-solutions-constructs/issues/1030)) ([f772200](https://github.com/awslabs/aws-solutions-constructs/commit/f772200d6885cf0e0030239ce6f7511cdb2814d6))

## [2.46.0](https://github.com/awslabs/aws-solutions-constructs/compare/v2.45.0...v2.46.0) (2023-11-09)

Built on CDK v2.105.0
Expand Down
2 changes: 1 addition & 1 deletion deployment/v2/align-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const findVersion = process.argv[2];
const replaceVersion = process.argv[3];

// these versions need to be sourced from a config file
const awsCdkLibVersion = '2.105.0';
const awsCdkLibVersion = '2.111.0';
const constructsVersion = '10.0.0';
const MODULE_EXEMPTIONS = new Set([
'@aws-cdk/cloudformation-diff',
Expand Down
2 changes: 1 addition & 1 deletion source/lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"./patterns/@aws-solutions-constructs/*"
],
"rejectCycles": "true",
"version": "2.46.0"
"version": "2.47.0"
}
4 changes: 2 additions & 2 deletions source/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"eslint-plugin-license-header": "^0.2.0",
"fs-extra": "^8.1.0",
"jest": "^27.4.0",
"jsii": "^1.49.0",
"jsii-pacmak": "^1.49.0",
"jsii": "^1.92.0",
"jsii-pacmak": "^1.92.0",
"tslint": "^5.20.1",
"typescript": "4.7.4",
"aws-cdk-migration": "^1.135.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -848,9 +848,7 @@
"Type": "application"
},
"DependsOn": [
"testconstructlbAutoDeleteObjectsCustomResource581A2B9F",
"testconstructlbPolicy3FF14C4B",
"testconstructlb40BC0490",
"VpcPublicSubnet1DefaultRoute3DA9E72A",
"VpcPublicSubnet1RouteTableAssociation97140677",
"VpcPublicSubnet2DefaultRoute97F91067",
Expand All @@ -876,11 +874,6 @@
"Ref": "Vpc8378EB38"
}
},
"DependsOn": [
"testconstructlbAutoDeleteObjectsCustomResource581A2B9F",
"testconstructlbPolicy3FF14C4B",
"testconstructlb40BC0490"
],
"Metadata": {
"cfn_nag": {
"rules_to_suppress": [
Expand Down Expand Up @@ -919,12 +912,7 @@
},
"IpProtocol": "tcp",
"ToPort": 8080
},
"DependsOn": [
"testconstructlbAutoDeleteObjectsCustomResource581A2B9F",
"testconstructlbPolicy3FF14C4B",
"testconstructlb40BC0490"
]
}
},
"testconstructlb40BC0490": {
"Type": "AWS::S3::Bucket",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -875,9 +875,7 @@
"Type": "application"
},
"DependsOn": [
"testconstructlbAutoDeleteObjectsCustomResource581A2B9F",
"testconstructlbPolicy3FF14C4B",
"testconstructlb40BC0490",
"VpcPublicSubnet1DefaultRoute3DA9E72A",
"VpcPublicSubnet1RouteTableAssociation97140677",
"VpcPublicSubnet2DefaultRoute97F91067",
Expand All @@ -903,11 +901,6 @@
"Ref": "Vpc8378EB38"
}
},
"DependsOn": [
"testconstructlbAutoDeleteObjectsCustomResource581A2B9F",
"testconstructlbPolicy3FF14C4B",
"testconstructlb40BC0490"
],
"Metadata": {
"cfn_nag": {
"rules_to_suppress": [
Expand Down Expand Up @@ -946,12 +939,7 @@
},
"IpProtocol": "tcp",
"ToPort": 8080
},
"DependsOn": [
"testconstructlbAutoDeleteObjectsCustomResource581A2B9F",
"testconstructlbPolicy3FF14C4B",
"testconstructlb40BC0490"
]
}
},
"testconstructlb40BC0490": {
"Type": "AWS::S3::Bucket",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -941,9 +941,7 @@
"Type": "application"
},
"DependsOn": [
"existingalbAutoDeleteObjectsCustomResource67152080",
"existingalbPolicy6C7AF240",
"existingalb0F60CC48"
"existingalbPolicy6C7AF240"
]
},
"existingalbalbSecurityGroupC8DD2920": {
Expand Down Expand Up @@ -972,11 +970,6 @@
"Ref": "Vpc8378EB38"
}
},
"DependsOn": [
"existingalbAutoDeleteObjectsCustomResource67152080",
"existingalbPolicy6C7AF240",
"existingalb0F60CC48"
],
"Metadata": {
"cfn_nag": {
"rules_to_suppress": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@
"Type": "application"
},
"DependsOn": [
"testoneAutoDeleteObjectsCustomResourceEDE3D2FC",
"testonePolicyE30853FE",
"testoneE6ACFBB6"
"testonePolicyE30853FE"
]
},
"testonetestonealbSecurityGroup4DED9E2A": {
Expand Down Expand Up @@ -78,11 +76,6 @@
"Ref": "Vpc8378EB38"
}
},
"DependsOn": [
"testoneAutoDeleteObjectsCustomResourceEDE3D2FC",
"testonePolicyE30853FE",
"testoneE6ACFBB6"
],
"Metadata": {
"cfn_nag": {
"rules_to_suppress": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -941,9 +941,7 @@
"Type": "application"
},
"DependsOn": [
"existingalbAutoDeleteObjectsCustomResource67152080",
"existingalbPolicy6C7AF240",
"existingalb0F60CC48"
"existingalbPolicy6C7AF240"
]
},
"existingalbalbSecurityGroupC8DD2920": {
Expand Down Expand Up @@ -972,11 +970,6 @@
"Ref": "Vpc8378EB38"
}
},
"DependsOn": [
"existingalbAutoDeleteObjectsCustomResource67152080",
"existingalbPolicy6C7AF240",
"existingalb0F60CC48"
],
"Metadata": {
"cfn_nag": {
"rules_to_suppress": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@
"Type": "application"
},
"DependsOn": [
"testoneAutoDeleteObjectsCustomResourceEDE3D2FC",
"testonePolicyE30853FE",
"testoneE6ACFBB6",
"VpcPublicSubnet1DefaultRoute3DA9E72A",
"VpcPublicSubnet1RouteTableAssociation97140677",
"VpcPublicSubnet2DefaultRoute97F91067",
Expand Down Expand Up @@ -84,11 +82,6 @@
"Ref": "Vpc8378EB38"
}
},
"DependsOn": [
"testoneAutoDeleteObjectsCustomResourceEDE3D2FC",
"testonePolicyE30853FE",
"testoneE6ACFBB6"
],
"Metadata": {
"cfn_nag": {
"rules_to_suppress": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@
"Type": "application"
},
"DependsOn": [
"testoneAutoDeleteObjectsCustomResourceEDE3D2FC",
"testonePolicyE30853FE",
"testoneE6ACFBB6",
"VpcPublicSubnet1DefaultRoute3DA9E72A",
"VpcPublicSubnet1RouteTableAssociation97140677",
"VpcPublicSubnet2DefaultRoute97F91067",
Expand Down Expand Up @@ -84,11 +82,6 @@
"Ref": "Vpc8378EB38"
}
},
"DependsOn": [
"testoneAutoDeleteObjectsCustomResourceEDE3D2FC",
"testonePolicyE30853FE",
"testoneE6ACFBB6"
],
"Metadata": {
"cfn_nag": {
"rules_to_suppress": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,6 @@ export class ApiGatewayToSqs extends Construct {
assumedBy: new iam.ServicePrincipal('apigateway.amazonaws.com')
});

// Setup the API Gateway resource
const apiGatewayResource = this.apiGateway.root.addResource('message');

// Create
const createRequestTemplate = props.createRequestTemplate ?? this.defaultCreateRequestTemplate;
if (props.allowCreateOperation && props.allowCreateOperation === true) {
Expand Down Expand Up @@ -281,6 +278,7 @@ export class ApiGatewayToSqs extends Construct {
// Delete
const deleteRequestTemplate = props.deleteRequestTemplate ?? this.defaultDeleteRequestTemplate;
if (props.allowDeleteOperation && props.allowDeleteOperation === true) {
const apiGatewayResource = this.apiGateway.root.addResource('message');
this.addActionToPolicy("sqs:DeleteMessage");
defaults.addProxyMethodToApiResource({
service: "sqs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,31 @@ test('Test deployment for override ApiGateway deleteRequestTemplate', () => {
});
});

test('Test deployment for disallow delete operation', () => {
const stack = new Stack();

new ApiGatewayToSqs(stack, 'api-gateway-sqs', {
allowDeleteOperation: false
});
const template = Template.fromStack(stack);
const resources = template.findResources('AWS::ApiGateway::Resource', {
PathPart: "message"
});
expect(Object.keys(resources).length).toBe(0);
});

test('Test deployment for allow delete operation', () => {
const stack = new Stack();

new ApiGatewayToSqs(stack, 'api-gateway-sqs', {
allowDeleteOperation: true
});
const template = Template.fromStack(stack);
template.hasResourceProperties('AWS::ApiGateway::Resource', {
PathPart: "message"
});
});

test('Test deployment with existing queue object', () => {
const stack = new Stack();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
"Name": "RestApi"
}
},
"testapigatewaysqsdefaultRestApiDeploymentFB9688F5aa398c65c945d66dd485b50d59cc7a25": {
"testapigatewaysqsdefaultRestApiDeploymentFB9688F5ba8a42d07caa9db068377b2cabf4da74": {
"Type": "AWS::ApiGateway::Deployment",
"Properties": {
"Description": "Automatically created by the RestApi construct",
Expand All @@ -208,7 +208,6 @@
},
"DependsOn": [
"testapigatewaysqsdefaultRestApiGET733E6394",
"testapigatewaysqsdefaultRestApimessage41073D7F",
"testapigatewaysqsdefaultRestApiPOSTD8ACD1CB"
],
"Metadata": {
Expand All @@ -235,7 +234,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": "testapigatewaysqsdefaultRestApiDeploymentFB9688F5aa398c65c945d66dd485b50d59cc7a25"
"Ref": "testapigatewaysqsdefaultRestApiDeploymentFB9688F5ba8a42d07caa9db068377b2cabf4da74"
},
"MethodSettings": [
{
Expand All @@ -252,21 +251,6 @@
"TracingEnabled": true
}
},
"testapigatewaysqsdefaultRestApimessage41073D7F": {
"Type": "AWS::ApiGateway::Resource",
"Properties": {
"ParentId": {
"Fn::GetAtt": [
"testapigatewaysqsdefaultRestApi554243C3",
"RootResourceId"
]
},
"PathPart": "message",
"RestApiId": {
"Ref": "testapigatewaysqsdefaultRestApi554243C3"
}
}
},
"testapigatewaysqsdefaultRestApiPOSTD8ACD1CB": {
"Type": "AWS::ApiGateway::Method",
"Properties": {
Expand Down
Loading

0 comments on commit 498ea12

Please sign in to comment.