LoginSignup
0
1

More than 3 years have passed since last update.

aws-cdkでエラー Argument of type ‘this’ is not assignable to parameter of type ‘Construct’

Posted at

aws-cdkでコードを書いていたところ、以下のthisの部分でエラーが起きました。

const table = new DynamoDb.Table(this, “hoge”, {
...
}
Argument of type ‘this’ is not assignable to parameter of type ‘Construct’

原因は、CDKのバージョンが合っていないときに起きるようです。
https://github.com/aws/aws-cdk/issues/542

例えば、CDKを導入後に新しくDynamoDBを使うことになったら、@aws-cdk/aws-dynamodbをインストールしますよね。この@aws-cdk/aws-dynamodbのバージョンと、以前にインストールした@aws-cdk/coreなどのバージョンは合わせておく必要があります。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1