Skip to content

Commit 5f27e0b

Browse files
authored
chore(deps-dev): bump to cdk 2.0.0 (aws-samples#62)
1 parent 6904c16 commit 5f27e0b

File tree

5 files changed

+204
-864
lines changed

5 files changed

+204
-864
lines changed

packages/infra/cdk/aws-sdk-js-notes-app-stack.ts

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
import * as cdk from "@aws-cdk/core";
2-
import * as dynamodb from "@aws-cdk/aws-dynamodb";
3-
import * as apigw from "@aws-cdk/aws-apigateway";
4-
import * as s3 from "@aws-cdk/aws-s3";
5-
import * as cognito from "@aws-cdk/aws-cognito";
6-
import * as iam from "@aws-cdk/aws-iam";
1+
import {
2+
Stack,
3+
StackProps,
4+
CfnOutput,
5+
aws_apigateway as apigw,
6+
aws_cognito as cognito,
7+
aws_dynamodb as dynamodb,
8+
aws_iam as iam,
9+
aws_s3 as s3,
10+
} from "aws-cdk-lib";
11+
import { Construct } from "constructs";
712
import { NotesApi } from "./notes-api";
813

9-
export class AwsSdkJsNotesAppStack extends cdk.Stack {
10-
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
14+
export class AwsSdkJsNotesAppStack extends Stack {
15+
constructor(scope: Construct, id: string, props?: StackProps) {
1116
super(scope, id, props);
1217

1318
const table = new dynamodb.Table(this, "notes", {
@@ -123,9 +128,9 @@ export class AwsSdkJsNotesAppStack extends cdk.Stack {
123128
},
124129
});
125130

126-
new cdk.CfnOutput(this, "FilesBucket", { value: filesBucket.bucketName });
127-
new cdk.CfnOutput(this, "GatewayUrl", { value: api.url });
128-
new cdk.CfnOutput(this, "IdentityPoolId", { value: identityPool.ref });
129-
new cdk.CfnOutput(this, "Region", { value: this.region });
131+
new CfnOutput(this, "FilesBucket", { value: filesBucket.bucketName });
132+
new CfnOutput(this, "GatewayUrl", { value: api.url });
133+
new CfnOutput(this, "IdentityPoolId", { value: identityPool.ref });
134+
new CfnOutput(this, "Region", { value: this.region });
130135
}
131136
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import * as cdk from "@aws-cdk/core";
1+
import { App } from "aws-cdk-lib";
22
import { AwsSdkJsNotesAppStack } from "./aws-sdk-js-notes-app-stack";
33

4-
const app = new cdk.App();
4+
const app = new App();
55
new AwsSdkJsNotesAppStack(app, "aws-sdk-js-notes-app");

packages/infra/cdk/notes-api.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
import * as cdk from "@aws-cdk/core";
2-
import * as lambda from "@aws-cdk/aws-lambda";
3-
import { Table } from "@aws-cdk/aws-dynamodb";
1+
import { aws_dynamodb as dynamodb, aws_lambda as lambda } from "aws-cdk-lib";
2+
import { Construct } from "constructs";
43

54
export interface NotesApiProps {
65
/** the dynamodb table to be passed to lambda function **/
7-
table: Table;
6+
table: dynamodb.Table;
87
/** the actions which should be granted on the table */
98
grantActions: string[];
109
}
1110

12-
export class NotesApi extends cdk.Construct {
11+
export class NotesApi extends Construct {
1312
/** allows accessing the counter function */
1413
public readonly handler: lambda.Function;
1514

16-
constructor(scope: cdk.Construct, id: string, props: NotesApiProps) {
15+
constructor(scope: Construct, id: string, props: NotesApiProps) {
1716
super(scope, id);
1817

1918
const { table, grantActions } = props;

packages/infra/package.json

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,12 @@
88
"cdk": "tsc && cdk"
99
},
1010
"devDependencies": {
11-
"@aws-cdk/aws-apigateway": "1.132.0",
12-
"@aws-cdk/aws-cognito": "1.132.0",
13-
"@aws-cdk/aws-dynamodb": "1.132.0",
14-
"@aws-cdk/aws-iam": "1.132.0",
15-
"@aws-cdk/aws-lambda": "1.132.0",
16-
"@aws-cdk/aws-s3": "1.132.0",
17-
"@aws-cdk/core": "1.132.0",
1811
"@types/node": "^14.14.2",
19-
"aws-cdk": "1.132.0",
12+
"aws-cdk": "2.0.0",
2013
"typescript": "~4.4.4"
14+
},
15+
"dependencies": {
16+
"aws-cdk-lib": "2.0.0",
17+
"constructs": "10.0.9"
2118
}
2219
}

0 commit comments

Comments
 (0)