question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(aws-cdk-lib): ConcreteDependable is not exported from aws-cdk-lib

See original GitHub issue

What is the problem?

Despite still existing in @aws-cdk/core, ConcreteDependable is not exported from aws-cdk-lib and we couldn’t find any documentation about this change.

As I understand it, we should no longer need to include or import directly from @aws-cdk/xxx modules

Reproduction Steps

import * as cdk from 'aws-cdk-lib';

new cdk.ConcreteDependable()

What did you expect to happen?

To be able to access ConcreteDependable on cdk.

What actually happened?

Error:

Property 'ConcreteDependable' does not exist on type 'typeof import("/Users/chrissargent/Sites/noah-main/packages/noah-infra/node_modules/aws-cdk-lib/index")'.ts(2339)

CDK CLI Version

2.1.0 (build f4f18b1)

Framework Version

No response

Node.js Version

14

OS

MacOS

Language

Typescript

Language Version

No response

Other information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
peterwoodworthcommented, Dec 27, 2021

The docs on migrating from v1 to v2 calls this out -

The Construct class has been extracted from the AWS CDK into a separate library, along with related types, to support efforts to apply the Construct Programming Model to other domains. If you are writing your own constructs or using related APIs, you must declare the construct module as a dependency and make minor changes to your imports. If you are using advanced features, such as hooking into the CDK app lifecycle, more changes may be needed. See the RFC for full details.

The link to the RFC is what contains the technical details. It’s nice that we link to this in the docs, but I think this could get pretty easily missed as it’s just a bullet point. I’ll let our docs team know that the distinction between constructs in v1 and v2 should be more visible

1reaction
kylelakercommented, Dec 22, 2021

I have found using DependencyGroup from constructs works in place of ConcreteDependable. It has mostly the same interface (though accepts a vararg of IDependables in the constructor).

Read more comments on GitHub >

github_iconTop Results From Across the Web

class ConcreteDependable · AWS CDK
This class can be used when a set of constructs which are disjoint in the construct tree needs to be combined to be...
Read more >
Many build errors while using aws cdk in combination with ...
I was running into the same issue with node-fetch in a CDK project and fixed it by adding "DOM" to the lib array...
Read more >
Sign in
I tried creating a demo for VueJS SSR using Lambda@Edge and using AWS CDK v2. The code is below ``` import { CfnOutput,...
Read more >
aws-cdk-lib Stack TypeScript Examples
export class GoLambdaStack extends Stack { constructor(scope: Construct, id: string, props?: StackProps) { super(scope, id, props); // The code that defines ...
Read more >
AWS CDK v2 Tutorial – How to Create a Three-Tier ...
Note that, unlike CDK v1 applications, there's no need to install ... import { RemovalPolicy, Stack, StackProps } from 'aws-cdk-lib'; ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found