aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
21 lines (20 loc) • 825 B
TypeScript
import { Construct, IConstruct } from 'constructs';
import type { ResourceEnvironment } from '../environment';
/**
* Base class for detached constructs that throw UnscopedValidationError
* when accessing node, env, or with() methods.
*
* This is used by legacy APIs like ManagedPolicy.fromAwsManagedPolicyName() and
* CloudFront policy imports that return construct-like objects without requiring
* a scope parameter. These APIs predate modern CDK patterns and cannot be changed
* without breaking existing customer code.
*
* DO NOT USE for new code. New APIs should require a scope parameter.
*
* @internal
*/
export declare abstract class DetachedConstruct extends Construct implements IConstruct {
private readonly errorMessage;
constructor(errorMessage: string);
get env(): ResourceEnvironment;
}