Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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));
Expand All @@ -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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions typescript/lambda-api-ci/src/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}),
Expand Down
6 changes: 3 additions & 3 deletions typescript/neptune-with-vpc/neptune-with-vpc-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down
2 changes: 1 addition & 1 deletion typescript/rds/aurora/aurora.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
16 changes: 8 additions & 8 deletions typescript/rds/aurora/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
18 changes: 9 additions & 9 deletions typescript/rds/mysql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
6 changes: 3 additions & 3 deletions typescript/rds/oracle/oracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
16 changes: 8 additions & 8 deletions typescript/rds/oracle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
14 changes: 7 additions & 7 deletions typescript/waf/waf-cloudfront.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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: {
Expand Down Expand Up @@ -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: {
Expand Down
12 changes: 6 additions & 6 deletions typescript/waf/waf-regional.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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: {
Expand Down Expand Up @@ -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: {
Expand Down