diff --git a/typescript/api-gateway-lambda-token-authorizer/lib/lambdas/authorizer/index.ts b/typescript/api-gateway-lambda-token-authorizer/lib/lambdas/authorizer/index.ts index 85d00c3adf..6d709c6c5a 100644 --- a/typescript/api-gateway-lambda-token-authorizer/lib/lambdas/authorizer/index.ts +++ b/typescript/api-gateway-lambda-token-authorizer/lib/lambdas/authorizer/index.ts @@ -1,7 +1,7 @@ import { Context, APIGatewayTokenAuthorizerEvent, Callback } from "aws-lambda"; export const handler = function (event: APIGatewayTokenAuthorizerEvent, context: Context, callback: Callback) { - var token = event.authorizationToken; + let token = event.authorizationToken; switch (token) { case 'allow': callback(null, generatePolicy('user', 'Allow', event.methodArn)); @@ -17,7 +17,7 @@ export const handler = function (event: APIGatewayTokenAuthorizerEvent, context: } }; -var generatePolicy = function (principalId: string, effect: string, resource: string) { +let generatePolicy = function (principalId: string, effect: string, resource: string) { return { principalId: principalId, policyDocument: { diff --git a/typescript/api-gateway-lambda-token-authorizer/test/stack/__snapshots__/gateway-lambda-auth-stack.test.ts.snap b/typescript/api-gateway-lambda-token-authorizer/test/stack/__snapshots__/gateway-lambda-auth-stack.test.ts.snap index b9c251e70e..df86865987 100644 --- a/typescript/api-gateway-lambda-token-authorizer/test/stack/__snapshots__/gateway-lambda-auth-stack.test.ts.snap +++ b/typescript/api-gateway-lambda-token-authorizer/test/stack/__snapshots__/gateway-lambda-auth-stack.test.ts.snap @@ -190,7 +190,7 @@ exports[`Snapshot Stack 1`] = ` "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "a89b0c25113046ece0e7fb82e6d729811e22e9ed30e0d44feb9ffa39ef67b8a4.zip", + "S3Key": "a1deff17a695906f93c544b1deae2bf444210622f05330da961687eb8f4a51a7.zip", }, "Description": "Lambda Authorizer", "Environment": { diff --git a/typescript/lambda-api-ci/src/handler.ts b/typescript/lambda-api-ci/src/handler.ts index 88bd9393c9..54ecc458cf 100644 --- a/typescript/lambda-api-ci/src/handler.ts +++ b/typescript/lambda-api-ci/src/handler.ts @@ -7,12 +7,12 @@ const handler = async function (event: any, context: any) { const S3Client = new S3() try { - var method = event.httpMethod + let method = event.httpMethod if (method === "GET") { if (event.path === "/") { const data = await S3Client.listObjectsV2({ Bucket: bucketName }) - var body = { + let body = { widgets: data.Contents!.map(function (e) { return e.Key }), diff --git a/typescript/neptune-with-vpc/neptune-with-vpc-stack.ts b/typescript/neptune-with-vpc/neptune-with-vpc-stack.ts index 6971d3a5ee..7313d20ef4 100644 --- a/typescript/neptune-with-vpc/neptune-with-vpc-stack.ts +++ b/typescript/neptune-with-vpc/neptune-with-vpc-stack.ts @@ -41,9 +41,9 @@ export class NeptuneWithVpcStack extends cdk.Stack { }); // Get lists of Subnets by type - var neptunePublicSubnets = neptuneVpc.publicSubnets; - var neptunePrivateSubnets = neptuneVpc.privateSubnets; - var neptuneIsolatedSubnets = neptuneVpc.isolatedSubnets; + let neptunePublicSubnets = neptuneVpc.publicSubnets; + let neptunePrivateSubnets = neptuneVpc.privateSubnets; + let neptuneIsolatedSubnets = neptuneVpc.isolatedSubnets; // Create Subnet group list to be used with Neptune. const neptuneSubnets: ec2.SubnetSelection = { subnets: neptuneIsolatedSubnets }; diff --git a/typescript/rds/aurora/aurora.ts b/typescript/rds/aurora/aurora.ts index dc465827ec..9fab0d4ae3 100644 --- a/typescript/rds/aurora/aurora.ts +++ b/typescript/rds/aurora/aurora.ts @@ -144,7 +144,7 @@ export class Aurora extends Stack { let replicaInstances = props.replicaInstances ?? 1; let backupRetentionDays = props.backupRetentionDays ?? 14; - var ingressSources = []; + let ingressSources = []; if (typeof props.ingressSources !== 'undefined') { ingressSources = props.ingressSources; } diff --git a/typescript/rds/aurora/package.json b/typescript/rds/aurora/package.json index 65f7bdbabb..a857a1ff31 100644 --- a/typescript/rds/aurora/package.json +++ b/typescript/rds/aurora/package.json @@ -10,17 +10,17 @@ "cdk": "cdk" }, "devDependencies": { - "@types/jest": "^26.0.10", + "@types/jest": "^29.5.13", "@types/node": "*", - "jest": "^26.4.2", + "jest": "^29.7.0", "aws-cdk": "*", - "ts-jest": "^26.2.0", - "ts-node": "^10.9.1", - "typescript": "~5.1.6" + "ts-jest": "^29.2.5", + "ts-node": "^10.9.2", + "typescript": "~5.6.2" }, "dependencies": { - "aws-cdk-lib": "^2.0.0", - "constructs": "^10.0.0", - "source-map-support": "^0.5.16" + "aws-cdk-lib": "^2.158.0", + "constructs": "^10.3.0", + "source-map-support": "^0.5.21" } } diff --git a/typescript/rds/mysql/package.json b/typescript/rds/mysql/package.json index 34cf8397f2..c4c9e6d770 100644 --- a/typescript/rds/mysql/package.json +++ b/typescript/rds/mysql/package.json @@ -10,18 +10,18 @@ "cdk": "cdk" }, "devDependencies": { - "@types/jest": "^26.0.10", + "@types/jest": "^29.5.13", "@types/node": "*", - "jest": "29.6.4", - "ts-jest": "29.2.4", - "ts-node": "^10.9.1", + "jest": "29.7.0", + "ts-jest": "29.2.5", + "ts-node": "^10.9.2", "aws-cdk": "*", - "typescript": "~5.1.6" + "typescript": "~5.6.2" }, "esModuleInterop": true, "dependencies": { - "aws-cdk-lib": "^2.0.0", - "constructs": "^10.0.0", - "source-map-support": "^0.5.16" + "aws-cdk-lib": "^2.158.0", + "constructs": "^10.3.0", + "source-map-support": "^0.5.21" } -} \ No newline at end of file +} diff --git a/typescript/rds/oracle/oracle.ts b/typescript/rds/oracle/oracle.ts index b09947b0ec..722882e12e 100644 --- a/typescript/rds/oracle/oracle.ts +++ b/typescript/rds/oracle/oracle.ts @@ -103,15 +103,15 @@ export class Oracle extends Stack { super(scope, id); // default database username - var oracleUsername = "dbadmin"; + let oracleUsername = "dbadmin"; if (typeof props.oracleUsername !== 'undefined') { oracleUsername = "dbadmin"; } - var ingressSources = []; + let ingressSources = []; if (typeof props.ingressSources !== 'undefined') { ingressSources = props.ingressSources; } - var engineVersion = rds.OracleEngineVersion.VER_19_0_0_0_2021_04_R1; + let engineVersion = rds.OracleEngineVersion.VER_19_0_0_0_2021_04_R1; if (typeof props.engineVersion !== 'undefined') { engineVersion = props.engineVersion; } diff --git a/typescript/rds/oracle/package.json b/typescript/rds/oracle/package.json index 4dd3f29b95..332e905643 100644 --- a/typescript/rds/oracle/package.json +++ b/typescript/rds/oracle/package.json @@ -10,17 +10,17 @@ "cdk": "cdk" }, "devDependencies": { - "@types/jest": "^26.0.10", + "@types/jest": "^29.5.13", "@types/node": "*", - "jest": "^26.4.2", + "jest": "^29.7.0", "aws-cdk": "*", - "ts-jest": "^26.2.0", - "ts-node": "^10.9.1", - "typescript": "~5.1.6" + "ts-jest": "^29.2.5", + "ts-node": "^10.9.2", + "typescript": "~5.6.2" }, "dependencies": { - "aws-cdk-lib": "^2.0.0", - "constructs": "^10.0.0", - "source-map-support": "^0.5.16" + "aws-cdk-lib": "^2.158.0", + "constructs": "^10.3.0", + "source-map-support": "^0.5.21" } } diff --git a/typescript/waf/waf-cloudfront.ts b/typescript/waf/waf-cloudfront.ts index 51589f9b3b..6bb42f69ba 100644 --- a/typescript/waf/waf-cloudfront.ts +++ b/typescript/waf/waf-cloudfront.ts @@ -17,23 +17,23 @@ export class WafCloudFrontStack extends cdk.Stack { * Create output for use in WAF config */ protected makeRules(listOfRules: listOfRules[] = []) { - var rules: wafv2.CfnRuleGroup.RuleProperty[] = []; + let rules: wafv2.CfnRuleGroup.RuleProperty[] = []; listOfRules.forEach(function (r) { - var mrgsp: wafv2.CfnWebACL.ManagedRuleGroupStatementProperty = { + let mrgsp: wafv2.CfnWebACL.ManagedRuleGroupStatementProperty = { name: r['name'], vendorName: "AWS", excludedRules: [] }; - var stateProp: wafv2.CfnWebACL.StatementProperty = { + let stateProp: wafv2.CfnWebACL.StatementProperty = { managedRuleGroupStatement: { name: r['name'], vendorName: "AWS", } }; - var overrideAction: wafv2.CfnWebACL.OverrideActionProperty = { none: {} } + let overrideAction: wafv2.CfnWebACL.OverrideActionProperty = { none: {} } - var rule: wafv2.CfnWebACL.RuleProperty = { + let rule: wafv2.CfnWebACL.RuleProperty = { name: r['name'], priority: r['priority'], overrideAction: overrideAction, @@ -48,7 +48,7 @@ export class WafCloudFrontStack extends cdk.Stack { }); // forEach // Allowed country list - var ruleGeoMatch: wafv2.CfnWebACL.RuleProperty = { + let ruleGeoMatch: wafv2.CfnWebACL.RuleProperty = { name: 'GeoMatch', priority: 0, action: { @@ -95,7 +95,7 @@ export class WafCloudFrontStack extends cdk.Stack { * and requests will be blocked once this limit is reached. * The IP address is automatically unblocked after it falls below the limit. */ - var ruleLimitRequests100: wafv2.CfnWebACL.RuleProperty = { + let ruleLimitRequests100: wafv2.CfnWebACL.RuleProperty = { name: 'LimitRequests100', priority: 1, action: { diff --git a/typescript/waf/waf-regional.ts b/typescript/waf/waf-regional.ts index b3181b8901..56aa0ab4ec 100644 --- a/typescript/waf/waf-regional.ts +++ b/typescript/waf/waf-regional.ts @@ -17,18 +17,18 @@ export class WafRegionalStack extends cdk.Stack { * Create output for use in WAF config */ protected makeRules(listOfRules: listOfRules[] = []) { - var rules: wafv2.CfnRuleGroup.RuleProperty[] = []; + let rules: wafv2.CfnRuleGroup.RuleProperty[] = []; for (const r of listOfRules) { - var stateProp: wafv2.CfnWebACL.StatementProperty = { + let stateProp: wafv2.CfnWebACL.StatementProperty = { managedRuleGroupStatement: { name: r['name'], vendorName: "AWS", } }; - var overrideAction: wafv2.CfnWebACL.OverrideActionProperty = { none: {} } + let overrideAction: wafv2.CfnWebACL.OverrideActionProperty = { none: {} } - var rule: wafv2.CfnRuleGroup.RuleProperty = { + let rule: wafv2.CfnRuleGroup.RuleProperty = { name: r['name'], priority: r['priority'], // @ts-expect-error Property 'overrideAction' does not exist on type 'CfnRuleGroup.RuleProperty' @@ -44,7 +44,7 @@ export class WafRegionalStack extends cdk.Stack { }; // Allowed country list - var ruleGeoMatch: wafv2.CfnWebACL.RuleProperty = { + let ruleGeoMatch: wafv2.CfnWebACL.RuleProperty = { name: 'GeoMatch', priority: 0, action: { @@ -91,7 +91,7 @@ export class WafRegionalStack extends cdk.Stack { * and requests will be blocked once this limit is reached. * The IP address is automatically unblocked after it falls below the limit. */ - var ruleLimitRequests100: wafv2.CfnWebACL.RuleProperty = { + let ruleLimitRequests100: wafv2.CfnWebACL.RuleProperty = { name: 'LimitRequests100', priority: 1, action: {