diff --git a/CHANGELOG.v2.md b/CHANGELOG.v2.md new file mode 100644 index 0000000000000..9dd4bffa9047c --- /dev/null +++ b/CHANGELOG.v2.md @@ -0,0 +1,423 @@ +# Changelog + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [2.0.0-alpha.8](https://github.com/aws/aws-cdk/compare/v2.0.0-alpha.6...v2.0.0-alpha.8) (2021-03-17) + + +### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES + +* **apigatewayv2:** `HttpApiMapping` (and related interfaces for `Attributed` and `Props`) has been renamed to `ApiMapping` +* **apigatewayv2:** `CommonStageOptions` has been renamed to `StageOptions` +* **apigatewayv2:** `HttpStage.fromStageName` has been removed in favour of `HttpStage.fromHttpStageAttributes` +* **apigatewayv2:** `DefaultDomainMappingOptions` has been removed in favour of `DomainMappingOptions` +* **apigatewayv2:** `HttpApiProps.defaultDomainMapping` has been changed from `DefaultDomainMappingOptions` to `DomainMappingOptions` +* **apigatewayv2:** `HttpApi.defaultStage` has been changed from `HttpStage` to `IStage` +* **apigatewayv2:** `IHttpApi.defaultStage` has been removed + +### Features + +* **apigatewayv2:** websocket api ([#13031](https://github.com/aws/aws-cdk/issues/13031)) ([fe1c839](https://github.com/aws/aws-cdk/commit/fe1c8393e0840fb273c4a5f325cb3cebc784bf4b)), closes [#2872](https://github.com/aws/aws-cdk/issues/2872) +* **aws-events:** Event Bus target ([#12926](https://github.com/aws/aws-cdk/issues/12926)) ([ea91aa3](https://github.com/aws/aws-cdk/commit/ea91aa31db9e2f31c734ad6d7e1f64d5d432dfd4)), closes [#9473](https://github.com/aws/aws-cdk/issues/9473) +* **aws-route53-targets:** add global accelerator target to route53 alias targets ([#13407](https://github.com/aws/aws-cdk/issues/13407)) ([2672a55](https://github.com/aws/aws-cdk/commit/2672a55c393e5ce7dd9a230d921ec1be1a23e32a)), closes [#12839](https://github.com/aws/aws-cdk/issues/12839) +* **cfnspec:** cloudformation spec v30.0.0 ([#13365](https://github.com/aws/aws-cdk/issues/13365)) ([ae0185d](https://github.com/aws/aws-cdk/commit/ae0185dd089e3bb7c5639ebc1bce3f95e126f71c)) +* **cloudwatch:** EC2 actions ([#13281](https://github.com/aws/aws-cdk/issues/13281)) ([319cfcd](https://github.com/aws/aws-cdk/commit/319cfcdaaf92e4e6edb8c2388d04dce0971aaf86)), closes [#13228](https://github.com/aws/aws-cdk/issues/13228) +* **codebuild:** allow setting queued timeout ([#13467](https://github.com/aws/aws-cdk/issues/13467)) ([e09250b](https://github.com/aws/aws-cdk/commit/e09250bc92c62cb8ee0a8706ce90d0e82faf2d84)), closes [#11364](https://github.com/aws/aws-cdk/issues/11364) +* **cognito:** user pools - sign in with apple ([#13160](https://github.com/aws/aws-cdk/issues/13160)) ([b965589](https://github.com/aws/aws-cdk/commit/b965589358f4c281aea36404276f08128e6ff3db)) +* **core:** `description` parameter in the CustomResourceProvider ([#13275](https://github.com/aws/aws-cdk/issues/13275)) ([78831cf](https://github.com/aws/aws-cdk/commit/78831cf9dec0407e7d827711183ac47be070f480)), closes [#13277](https://github.com/aws/aws-cdk/issues/13277) [#13276](https://github.com/aws/aws-cdk/issues/13276) +* **core:** customize bundling output packaging ([#13152](https://github.com/aws/aws-cdk/issues/13152)) ([6eca979](https://github.com/aws/aws-cdk/commit/6eca979f65542f3e44461588d8220e8c0bf76a6e)) +* **dynamodb:** custom timeout for replication operation ([#13354](https://github.com/aws/aws-cdk/issues/13354)) ([6a5a4f2](https://github.com/aws/aws-cdk/commit/6a5a4f2d9bb6b09ad0d10066200fe53bb45f0737)), closes [#10249](https://github.com/aws/aws-cdk/issues/10249) +* **ec2:** Add VPC endpoint for RDS ([#12497](https://github.com/aws/aws-cdk/issues/12497)) ([fc87574](https://github.com/aws/aws-cdk/commit/fc8757437c37a0947cced720ff363b8858850f72)), closes [#12402](https://github.com/aws/aws-cdk/issues/12402) +* **ec2:** ESP and AH IPsec protocols for Security Groups ([#13471](https://github.com/aws/aws-cdk/issues/13471)) ([f5a6647](https://github.com/aws/aws-cdk/commit/f5a6647bbe1885ba86029d10550a3ffaf80b6561)), closes [#13403](https://github.com/aws/aws-cdk/issues/13403) +* **ec2:** multipart user data ([#11843](https://github.com/aws/aws-cdk/issues/11843)) ([ed94c5e](https://github.com/aws/aws-cdk/commit/ed94c5ef1b9dd3042128b0e0c5bb14b3d9c7d497)), closes [#8315](https://github.com/aws/aws-cdk/issues/8315) +* **ecr:** add imageTagMutability prop ([#10557](https://github.com/aws/aws-cdk/issues/10557)) ([c4dc3bc](https://github.com/aws/aws-cdk/commit/c4dc3bce02790903593d80b070fca81fe7b7f08c)), closes [#4640](https://github.com/aws/aws-cdk/issues/4640) +* **ecs:** ability to access tag parameter value of TagParameterContainerImage ([#13340](https://github.com/aws/aws-cdk/issues/13340)) ([e567a41](https://github.com/aws/aws-cdk/commit/e567a410d47366855ee3e6011aa096ba987b8099)), closes [#13202](https://github.com/aws/aws-cdk/issues/13202) +* **ecs:** add port mappings to containers with props ([#13262](https://github.com/aws/aws-cdk/issues/13262)) ([f511639](https://github.com/aws/aws-cdk/commit/f511639bba156f6edd15896a4dd8e27b07671ea1)), closes [#13261](https://github.com/aws/aws-cdk/issues/13261) +* **ecs:** allow selection of container and port for SRV service discovery records ([#12798](https://github.com/aws/aws-cdk/issues/12798)) ([a452bc3](https://github.com/aws/aws-cdk/commit/a452bc385640762a043392a717d49de29abcc64e)), closes [#12796](https://github.com/aws/aws-cdk/issues/12796) +* **ecs:** allow users to provide a CloudMap service to associate with an ECS service ([#13192](https://github.com/aws/aws-cdk/issues/13192)) ([a7d314c](https://github.com/aws/aws-cdk/commit/a7d314c73b9473208d94bac29ad9bd8018e00204)), closes [#10057](https://github.com/aws/aws-cdk/issues/10057) +* **elbv2:** allow control of ingress rules on redirect listener ([#12768](https://github.com/aws/aws-cdk/issues/12768)) ([b7b441f](https://github.com/aws/aws-cdk/commit/b7b441f74a07d26fd8de23df84e7ab4663c89c0c)), closes [#12766](https://github.com/aws/aws-cdk/issues/12766) +* **events:** `EventBus.grantPutEventsTo` method for granular grants ([#13429](https://github.com/aws/aws-cdk/issues/13429)) ([122a232](https://github.com/aws/aws-cdk/commit/122a232343699304d8f206d3024fcddfb2a94bc8)), closes [#11228](https://github.com/aws/aws-cdk/issues/11228) +* **events:** archive events ([#12060](https://github.com/aws/aws-cdk/issues/12060)) ([465cd9c](https://github.com/aws/aws-cdk/commit/465cd9c434acff74070ca6d33891e1481e253128)), closes [#11531](https://github.com/aws/aws-cdk/issues/11531) +* **events:** dead letter queue for Lambda Targets ([#11617](https://github.com/aws/aws-cdk/issues/11617)) ([1bb3650](https://github.com/aws/aws-cdk/commit/1bb3650c5dd2087b05793a5e903cdfb80fc5c1ad)), closes [#11612](https://github.com/aws/aws-cdk/issues/11612) +* **events:** dead-letter queue support for CodeBuild ([#13448](https://github.com/aws/aws-cdk/issues/13448)) ([abfc0ea](https://github.com/aws/aws-cdk/commit/abfc0ea63c10d8033a529b7497cf093e318fdf12)), closes [#13447](https://github.com/aws/aws-cdk/issues/13447) +* **events:** dead-letter queue support for StepFunctions ([#13450](https://github.com/aws/aws-cdk/issues/13450)) ([0ebcb41](https://github.com/aws/aws-cdk/commit/0ebcb4160ee16f0f7ff1072a40c8951f9a983048)), closes [#13449](https://github.com/aws/aws-cdk/issues/13449) +* **events,applicationautoscaling:** schedule can be a token ([#13064](https://github.com/aws/aws-cdk/issues/13064)) ([b1449a1](https://github.com/aws/aws-cdk/commit/b1449a178b0f9a8a951c2546428f8d75c6431f0f)) +* **iam:** SAML identity provider ([#13393](https://github.com/aws/aws-cdk/issues/13393)) ([faa0c06](https://github.com/aws/aws-cdk/commit/faa0c060dad9a5045495707e28fc85f223d4db5d)), closes [#5320](https://github.com/aws/aws-cdk/issues/5320) +* **lambda:** Code.fromDockerBuild ([#13318](https://github.com/aws/aws-cdk/issues/13318)) ([ad01099](https://github.com/aws/aws-cdk/commit/ad01099d5b8f835c3b87d7d20fd2dc1a5df2fd6f)), closes [#13273](https://github.com/aws/aws-cdk/issues/13273) +* **neptune:** high level constructs for db clusters and instances ([#12763](https://github.com/aws/aws-cdk/issues/12763)) ([c366837](https://github.com/aws/aws-cdk/commit/c36683701d88eb0c53fdd2add66b10c47c05f56b)), closes [aws#12762](https://github.com/aws/aws/issues/12762) +* **neptune:** Support IAM authentication ([#13462](https://github.com/aws/aws-cdk/issues/13462)) ([6c5b1f4](https://github.com/aws/aws-cdk/commit/6c5b1f42fb73a132d47945b529bab73557f2b9d8)), closes [#13461](https://github.com/aws/aws-cdk/issues/13461) +* **region-info:** added AppMesh ECR account for af-south-1 region ([#12814](https://github.com/aws/aws-cdk/issues/12814)) ([b3fba43](https://github.com/aws/aws-cdk/commit/b3fba43a047df61e713e8d2271d6deee7e07b716)) + + +### Bug Fixes + +* **cfn-include:** allow boolean values for string-typed properties ([#13508](https://github.com/aws/aws-cdk/issues/13508)) ([e5dab7c](https://github.com/aws/aws-cdk/commit/e5dab7cbc67c234d191c38a8b8b84b634070b15b)) +* **cfn-include:** allow dynamic mappings to be used in Fn::FindInMap ([#13428](https://github.com/aws/aws-cdk/issues/13428)) ([623675d](https://github.com/aws/aws-cdk/commit/623675d2f8fb2786f23beb87994e687e8a7c6612)) +* **cloudfront:** cannot add two EdgeFunctions with same aliases ([#13324](https://github.com/aws/aws-cdk/issues/13324)) ([1f35351](https://github.com/aws/aws-cdk/commit/1f3535145d22b2b13ebbcbfe31a3bfd73519352d)), closes [#13237](https://github.com/aws/aws-cdk/issues/13237) +* **cloudwatch:** MathExpression period of <5 minutes is not respected ([#13078](https://github.com/aws/aws-cdk/issues/13078)) ([d9ee914](https://github.com/aws/aws-cdk/commit/d9ee91432918aa113f728abdd61295096ed1512f)), closes [#9156](https://github.com/aws/aws-cdk/issues/9156) +* **cloudwatch:** metric `label` not rendered into Alarms ([#13070](https://github.com/aws/aws-cdk/issues/13070)) ([cbcc712](https://github.com/aws/aws-cdk/commit/cbcc712e0c4c44c83c7f4d1e8a544bccfa26bb56)) +* **codebuild:** allow FILE_PATH webhook filter for BitBucket ([#13186](https://github.com/aws/aws-cdk/issues/13186)) ([cbed348](https://github.com/aws/aws-cdk/commit/cbed3488f03bdfba16f3950bda653535c8999db1)), closes [#13175](https://github.com/aws/aws-cdk/issues/13175) +* **core:** custom resource provider NODEJS_12 now looks like Lambda's NODEJS_12_X, add Node 14 ([#13301](https://github.com/aws/aws-cdk/issues/13301)) ([3413b2f](https://github.com/aws/aws-cdk/commit/3413b2f887596d11dfb53c0e99c2a1788095a2ad)) +* **dynamodb:** replicas not created on table replacement ([#13300](https://github.com/aws/aws-cdk/issues/13300)) ([c7c424f](https://github.com/aws/aws-cdk/commit/c7c424fec42f1f14ab8bdc3011f5bdb602918aa3)), closes [#12332](https://github.com/aws/aws-cdk/issues/12332) +* **ec2:** fix typo's in WindowsImage constants ([#13446](https://github.com/aws/aws-cdk/issues/13446)) ([781aa97](https://github.com/aws/aws-cdk/commit/781aa97d53fdb7511c34ddde884fdcd84c3f68a6)) +* **ec2:** NAT provider's default outbound rules cannot be disabled ([#12674](https://github.com/aws/aws-cdk/issues/12674)) ([664133a](https://github.com/aws/aws-cdk/commit/664133a35da2bd096a237971ce662f3dd38b297f)), closes [#12673](https://github.com/aws/aws-cdk/issues/12673) +* **ec2:** readme grammar ([#13180](https://github.com/aws/aws-cdk/issues/13180)) ([fe4f056](https://github.com/aws/aws-cdk/commit/fe4f05678c06d634d3fe9e1b608e444a57f67b9c)) +* **ec2:** Throw error on empty InitFile content ([#13009](https://github.com/aws/aws-cdk/issues/13009)) ([#13119](https://github.com/aws/aws-cdk/issues/13119)) ([81a78a3](https://github.com/aws/aws-cdk/commit/81a78a31408276ebb020e45b15ddca7a2c57ae50)) +* **ecr:** Allow referencing an EcrImage by digest instead of tag ([#13299](https://github.com/aws/aws-cdk/issues/13299)) ([266a621](https://github.com/aws/aws-cdk/commit/266a621abfc34c62ff1e26de9cb8cf0687588f89)), closes [#5082](https://github.com/aws/aws-cdk/issues/5082) +* **ecr:** Generate valid CloudFormation for imageScanOnPush ([#13420](https://github.com/aws/aws-cdk/issues/13420)) ([278fba5](https://github.com/aws/aws-cdk/commit/278fba5df4a3d785e49bdb57ccf88fd34bacacbb)), closes [#13418](https://github.com/aws/aws-cdk/issues/13418) +* **ecs:** services essential container exceptions thrown too soon ([#13240](https://github.com/aws/aws-cdk/issues/13240)) ([c174f6c](https://github.com/aws/aws-cdk/commit/c174f6c2f4dd909e07be34b66bd6b3a92d5e8484)), closes [#13239](https://github.com/aws/aws-cdk/issues/13239) +* **elasticloadbalancingv2:** should allow more than 2 certificates ([#13332](https://github.com/aws/aws-cdk/issues/13332)) ([d3155e9](https://github.com/aws/aws-cdk/commit/d3155e97fd9331a4732396941ce4ad20613fe81c)), closes [#13150](https://github.com/aws/aws-cdk/issues/13150) +* **elasticloadbalancingv2:** upgrade to v1.92.0 drops certificates on ALB if more than 2 certificates exist ([#13490](https://github.com/aws/aws-cdk/issues/13490)) ([01b94f8](https://github.com/aws/aws-cdk/commit/01b94f8aa6c88b5e676c784aec4c879acddc042f)), closes [#13332](https://github.com/aws/aws-cdk/issues/13332) [#13437](https://github.com/aws/aws-cdk/issues/13437) +* **events:** cannot trigger multiple Lambdas from the same Rule ([#13260](https://github.com/aws/aws-cdk/issues/13260)) ([c8c1762](https://github.com/aws/aws-cdk/commit/c8c1762c213aad1062c3a0bc48b22b05c3a0a185)), closes [#13231](https://github.com/aws/aws-cdk/issues/13231) +* **events:** imported ECS Task Definition cannot be used as target ([#13293](https://github.com/aws/aws-cdk/issues/13293)) ([6f7cebd](https://github.com/aws/aws-cdk/commit/6f7cebdf61073cc1fb358fcac5f5b2156389cb81)), closes [#12811](https://github.com/aws/aws-cdk/issues/12811) +* **events:** imported EventBus does not correctly register source account ([#13481](https://github.com/aws/aws-cdk/issues/13481)) ([57e5404](https://github.com/aws/aws-cdk/commit/57e540432c1446f2233a9b0c0f4caba4e9e155d9)), closes [#13469](https://github.com/aws/aws-cdk/issues/13469) +* **iam:** oidc-provider can't pull from hosts requiring SNI ([#13397](https://github.com/aws/aws-cdk/issues/13397)) ([90dbfb5](https://github.com/aws/aws-cdk/commit/90dbfb5eec19559717ac6b30f25451461027e731)) +* **init:** Python init template's stack ID doesn't match other languages ([#13480](https://github.com/aws/aws-cdk/issues/13480)) ([3f1c02d](https://github.com/aws/aws-cdk/commit/3f1c02dac7a50ce7caebce1e7f8953f6e4937e6b)) +* **lambda-nodejs:** paths with spaces break esbuild ([#13312](https://github.com/aws/aws-cdk/issues/13312)) ([f983fbb](https://github.com/aws/aws-cdk/commit/f983fbb474ecd6727b0c5a35333718cc55d78bf1)), closes [#13311](https://github.com/aws/aws-cdk/issues/13311) +* **python:** change Python namespace to `aws_cdk` ([#13489](https://github.com/aws/aws-cdk/issues/13489)) ([90f5311](https://github.com/aws/aws-cdk/commit/90f5311b8bfd32d3b2fb348264cdcb026a5975f5)) +* **stepfunctions:** `SageMakeUpdateEndpoint` adds insufficient permissions ([#13170](https://github.com/aws/aws-cdk/issues/13170)) ([6126e49](https://github.com/aws/aws-cdk/commit/6126e499e5ca22b5f751af4f4f05d74f696829f1)), closes [#11594](https://github.com/aws/aws-cdk/issues/11594) +* **stepfunctions:** no validation on state machine name ([#13387](https://github.com/aws/aws-cdk/issues/13387)) ([6c3d407](https://github.com/aws/aws-cdk/commit/6c3d4071746179dde30f615602592c2523daa56e)), closes [#13289](https://github.com/aws/aws-cdk/issues/13289) + +## [2.0.0-alpha.7](https://github.com/aws/aws-cdk/compare/v2.0.0-alpha.6...v2.0.0-alpha.7) (2021-03-10) + + +### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES + +* **apigatewayv2:** `HttpApiMapping` (and related interfaces for `Attributed` and `Props`) has been renamed to `ApiMapping` +* **apigatewayv2:** `CommonStageOptions` has been renamed to `StageOptions` +* **apigatewayv2:** `HttpStage.fromStageName` has been removed in favour of `HttpStage.fromHttpStageAttributes` +* **apigatewayv2:** `DefaultDomainMappingOptions` has been removed in favour of `DomainMappingOptions` +* **apigatewayv2:** `HttpApiProps.defaultDomainMapping` has been changed from `DefaultDomainMappingOptions` to `DomainMappingOptions` +* **apigatewayv2:** `HttpApi.defaultStage` has been changed from `HttpStage` to `IStage` +* **apigatewayv2:** `IHttpApi.defaultStage` has been removed + +### Features + +* **apigatewayv2:** websocket api ([#13031](https://github.com/aws/aws-cdk/issues/13031)) ([fe1c839](https://github.com/aws/aws-cdk/commit/fe1c8393e0840fb273c4a5f325cb3cebc784bf4b)), closes [#2872](https://github.com/aws/aws-cdk/issues/2872) +* **aws-events:** Event Bus target ([#12926](https://github.com/aws/aws-cdk/issues/12926)) ([ea91aa3](https://github.com/aws/aws-cdk/commit/ea91aa31db9e2f31c734ad6d7e1f64d5d432dfd4)), closes [#9473](https://github.com/aws/aws-cdk/issues/9473) +* **aws-route53-targets:** add global accelerator target to route53 alias targets ([#13407](https://github.com/aws/aws-cdk/issues/13407)) ([2672a55](https://github.com/aws/aws-cdk/commit/2672a55c393e5ce7dd9a230d921ec1be1a23e32a)), closes [#12839](https://github.com/aws/aws-cdk/issues/12839) +* **cfnspec:** cloudformation spec v30.0.0 ([#13365](https://github.com/aws/aws-cdk/issues/13365)) ([ae0185d](https://github.com/aws/aws-cdk/commit/ae0185dd089e3bb7c5639ebc1bce3f95e126f71c)) +* **cloudwatch:** EC2 actions ([#13281](https://github.com/aws/aws-cdk/issues/13281)) ([319cfcd](https://github.com/aws/aws-cdk/commit/319cfcdaaf92e4e6edb8c2388d04dce0971aaf86)), closes [#13228](https://github.com/aws/aws-cdk/issues/13228) +* **codebuild:** allow setting queued timeout ([#13467](https://github.com/aws/aws-cdk/issues/13467)) ([e09250b](https://github.com/aws/aws-cdk/commit/e09250bc92c62cb8ee0a8706ce90d0e82faf2d84)), closes [#11364](https://github.com/aws/aws-cdk/issues/11364) +* **cognito:** user pools - sign in with apple ([#13160](https://github.com/aws/aws-cdk/issues/13160)) ([b965589](https://github.com/aws/aws-cdk/commit/b965589358f4c281aea36404276f08128e6ff3db)) +* **core:** `description` parameter in the CustomResourceProvider ([#13275](https://github.com/aws/aws-cdk/issues/13275)) ([78831cf](https://github.com/aws/aws-cdk/commit/78831cf9dec0407e7d827711183ac47be070f480)), closes [#13277](https://github.com/aws/aws-cdk/issues/13277) [#13276](https://github.com/aws/aws-cdk/issues/13276) +* **core:** customize bundling output packaging ([#13152](https://github.com/aws/aws-cdk/issues/13152)) ([6eca979](https://github.com/aws/aws-cdk/commit/6eca979f65542f3e44461588d8220e8c0bf76a6e)) +* **dynamodb:** custom timeout for replication operation ([#13354](https://github.com/aws/aws-cdk/issues/13354)) ([6a5a4f2](https://github.com/aws/aws-cdk/commit/6a5a4f2d9bb6b09ad0d10066200fe53bb45f0737)), closes [#10249](https://github.com/aws/aws-cdk/issues/10249) +* **ec2:** Add VPC endpoint for RDS ([#12497](https://github.com/aws/aws-cdk/issues/12497)) ([fc87574](https://github.com/aws/aws-cdk/commit/fc8757437c37a0947cced720ff363b8858850f72)), closes [#12402](https://github.com/aws/aws-cdk/issues/12402) +* **ec2:** multipart user data ([#11843](https://github.com/aws/aws-cdk/issues/11843)) ([ed94c5e](https://github.com/aws/aws-cdk/commit/ed94c5ef1b9dd3042128b0e0c5bb14b3d9c7d497)), closes [#8315](https://github.com/aws/aws-cdk/issues/8315) +* **ecs:** ability to access tag parameter value of TagParameterContainerImage ([#13340](https://github.com/aws/aws-cdk/issues/13340)) ([e567a41](https://github.com/aws/aws-cdk/commit/e567a410d47366855ee3e6011aa096ba987b8099)), closes [#13202](https://github.com/aws/aws-cdk/issues/13202) +* **ecs:** add port mappings to containers with props ([#13262](https://github.com/aws/aws-cdk/issues/13262)) ([f511639](https://github.com/aws/aws-cdk/commit/f511639bba156f6edd15896a4dd8e27b07671ea1)), closes [#13261](https://github.com/aws/aws-cdk/issues/13261) +* **ecs:** allow selection of container and port for SRV service discovery records ([#12798](https://github.com/aws/aws-cdk/issues/12798)) ([a452bc3](https://github.com/aws/aws-cdk/commit/a452bc385640762a043392a717d49de29abcc64e)), closes [#12796](https://github.com/aws/aws-cdk/issues/12796) +* **elbv2:** allow control of ingress rules on redirect listener ([#12768](https://github.com/aws/aws-cdk/issues/12768)) ([b7b441f](https://github.com/aws/aws-cdk/commit/b7b441f74a07d26fd8de23df84e7ab4663c89c0c)), closes [#12766](https://github.com/aws/aws-cdk/issues/12766) +* **events:** archive events ([#12060](https://github.com/aws/aws-cdk/issues/12060)) ([465cd9c](https://github.com/aws/aws-cdk/commit/465cd9c434acff74070ca6d33891e1481e253128)), closes [#11531](https://github.com/aws/aws-cdk/issues/11531) +* **events:** dead letter queue for Lambda Targets ([#11617](https://github.com/aws/aws-cdk/issues/11617)) ([1bb3650](https://github.com/aws/aws-cdk/commit/1bb3650c5dd2087b05793a5e903cdfb80fc5c1ad)), closes [#11612](https://github.com/aws/aws-cdk/issues/11612) +* **events:** dead-letter queue support for StepFunctions ([#13450](https://github.com/aws/aws-cdk/issues/13450)) ([0ebcb41](https://github.com/aws/aws-cdk/commit/0ebcb4160ee16f0f7ff1072a40c8951f9a983048)), closes [#13449](https://github.com/aws/aws-cdk/issues/13449) +* **iam:** SAML identity provider ([#13393](https://github.com/aws/aws-cdk/issues/13393)) ([faa0c06](https://github.com/aws/aws-cdk/commit/faa0c060dad9a5045495707e28fc85f223d4db5d)), closes [#5320](https://github.com/aws/aws-cdk/issues/5320) +* **lambda:** Code.fromDockerBuild ([#13318](https://github.com/aws/aws-cdk/issues/13318)) ([ad01099](https://github.com/aws/aws-cdk/commit/ad01099d5b8f835c3b87d7d20fd2dc1a5df2fd6f)), closes [#13273](https://github.com/aws/aws-cdk/issues/13273) +* **neptune:** high level constructs for db clusters and instances ([#12763](https://github.com/aws/aws-cdk/issues/12763)) ([c366837](https://github.com/aws/aws-cdk/commit/c36683701d88eb0c53fdd2add66b10c47c05f56b)), closes [aws#12762](https://github.com/aws/aws/issues/12762) +* **neptune:** Support IAM authentication ([#13462](https://github.com/aws/aws-cdk/issues/13462)) ([6c5b1f4](https://github.com/aws/aws-cdk/commit/6c5b1f42fb73a132d47945b529bab73557f2b9d8)), closes [#13461](https://github.com/aws/aws-cdk/issues/13461) +* **region-info:** added AppMesh ECR account for af-south-1 region ([#12814](https://github.com/aws/aws-cdk/issues/12814)) ([b3fba43](https://github.com/aws/aws-cdk/commit/b3fba43a047df61e713e8d2271d6deee7e07b716)) + + +### Bug Fixes + +* **cfn-include:** allow dynamic mappings to be used in Fn::FindInMap ([#13428](https://github.com/aws/aws-cdk/issues/13428)) ([623675d](https://github.com/aws/aws-cdk/commit/623675d2f8fb2786f23beb87994e687e8a7c6612)) +* **cloudfront:** cannot add two EdgeFunctions with same aliases ([#13324](https://github.com/aws/aws-cdk/issues/13324)) ([1f35351](https://github.com/aws/aws-cdk/commit/1f3535145d22b2b13ebbcbfe31a3bfd73519352d)), closes [#13237](https://github.com/aws/aws-cdk/issues/13237) +* **cloudwatch:** MathExpression period of <5 minutes is not respected ([#13078](https://github.com/aws/aws-cdk/issues/13078)) ([d9ee914](https://github.com/aws/aws-cdk/commit/d9ee91432918aa113f728abdd61295096ed1512f)), closes [#9156](https://github.com/aws/aws-cdk/issues/9156) +* **cloudwatch:** metric `label` not rendered into Alarms ([#13070](https://github.com/aws/aws-cdk/issues/13070)) ([cbcc712](https://github.com/aws/aws-cdk/commit/cbcc712e0c4c44c83c7f4d1e8a544bccfa26bb56)) +* **codebuild:** allow FILE_PATH webhook filter for BitBucket ([#13186](https://github.com/aws/aws-cdk/issues/13186)) ([cbed348](https://github.com/aws/aws-cdk/commit/cbed3488f03bdfba16f3950bda653535c8999db1)), closes [#13175](https://github.com/aws/aws-cdk/issues/13175) +* **core:** custom resource provider NODEJS_12 now looks like Lambda's NODEJS_12_X, add Node 14 ([#13301](https://github.com/aws/aws-cdk/issues/13301)) ([3413b2f](https://github.com/aws/aws-cdk/commit/3413b2f887596d11dfb53c0e99c2a1788095a2ad)) +* **dynamodb:** replicas not created on table replacement ([#13300](https://github.com/aws/aws-cdk/issues/13300)) ([c7c424f](https://github.com/aws/aws-cdk/commit/c7c424fec42f1f14ab8bdc3011f5bdb602918aa3)), closes [#12332](https://github.com/aws/aws-cdk/issues/12332) +* **ec2:** NAT provider's default outbound rules cannot be disabled ([#12674](https://github.com/aws/aws-cdk/issues/12674)) ([664133a](https://github.com/aws/aws-cdk/commit/664133a35da2bd096a237971ce662f3dd38b297f)), closes [#12673](https://github.com/aws/aws-cdk/issues/12673) +* **ec2:** readme grammar ([#13180](https://github.com/aws/aws-cdk/issues/13180)) ([fe4f056](https://github.com/aws/aws-cdk/commit/fe4f05678c06d634d3fe9e1b608e444a57f67b9c)) +* **ec2:** Throw error on empty InitFile content ([#13009](https://github.com/aws/aws-cdk/issues/13009)) ([#13119](https://github.com/aws/aws-cdk/issues/13119)) ([81a78a3](https://github.com/aws/aws-cdk/commit/81a78a31408276ebb020e45b15ddca7a2c57ae50)) +* **ecr:** Allow referencing an EcrImage by digest instead of tag ([#13299](https://github.com/aws/aws-cdk/issues/13299)) ([266a621](https://github.com/aws/aws-cdk/commit/266a621abfc34c62ff1e26de9cb8cf0687588f89)), closes [#5082](https://github.com/aws/aws-cdk/issues/5082) +* **ecr:** Generate valid CloudFormation for imageScanOnPush ([#13420](https://github.com/aws/aws-cdk/issues/13420)) ([278fba5](https://github.com/aws/aws-cdk/commit/278fba5df4a3d785e49bdb57ccf88fd34bacacbb)), closes [#13418](https://github.com/aws/aws-cdk/issues/13418) +* **ecs:** services essential container exceptions thrown too soon ([#13240](https://github.com/aws/aws-cdk/issues/13240)) ([c174f6c](https://github.com/aws/aws-cdk/commit/c174f6c2f4dd909e07be34b66bd6b3a92d5e8484)), closes [#13239](https://github.com/aws/aws-cdk/issues/13239) +* **elasticloadbalancingv2:** should allow more than 2 certificates ([#13332](https://github.com/aws/aws-cdk/issues/13332)) ([d3155e9](https://github.com/aws/aws-cdk/commit/d3155e97fd9331a4732396941ce4ad20613fe81c)), closes [#13150](https://github.com/aws/aws-cdk/issues/13150) +* **events:** cannot trigger multiple Lambdas from the same Rule ([#13260](https://github.com/aws/aws-cdk/issues/13260)) ([c8c1762](https://github.com/aws/aws-cdk/commit/c8c1762c213aad1062c3a0bc48b22b05c3a0a185)), closes [#13231](https://github.com/aws/aws-cdk/issues/13231) +* **events:** imported ECS Task Definition cannot be used as target ([#13293](https://github.com/aws/aws-cdk/issues/13293)) ([6f7cebd](https://github.com/aws/aws-cdk/commit/6f7cebdf61073cc1fb358fcac5f5b2156389cb81)), closes [#12811](https://github.com/aws/aws-cdk/issues/12811) +* **iam:** oidc-provider can't pull from hosts requiring SNI ([#13397](https://github.com/aws/aws-cdk/issues/13397)) ([90dbfb5](https://github.com/aws/aws-cdk/commit/90dbfb5eec19559717ac6b30f25451461027e731)) +* **lambda-nodejs:** paths with spaces break esbuild ([#13312](https://github.com/aws/aws-cdk/issues/13312)) ([f983fbb](https://github.com/aws/aws-cdk/commit/f983fbb474ecd6727b0c5a35333718cc55d78bf1)), closes [#13311](https://github.com/aws/aws-cdk/issues/13311) +* **python:** change Python namespace to `aws_cdk` ([#13489](https://github.com/aws/aws-cdk/issues/13489)) ([90f5311](https://github.com/aws/aws-cdk/commit/90f5311b8bfd32d3b2fb348264cdcb026a5975f5)) +* **stepfunctions:** `SageMakeUpdateEndpoint` adds insufficient permissions ([#13170](https://github.com/aws/aws-cdk/issues/13170)) ([6126e49](https://github.com/aws/aws-cdk/commit/6126e499e5ca22b5f751af4f4f05d74f696829f1)), closes [#11594](https://github.com/aws/aws-cdk/issues/11594) + +## [2.0.0-alpha.6](https://github.com/aws/aws-cdk/compare/v2.0.0-alpha.5...v2.0.0-alpha.6) (2021-03-03) + + +### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES + +* **ecs-patterns:** ** the desiredCount property stored on the above constructs will be optional, allowing them to be undefined. This is enabled through the `@aws-cdk/aws-ecs-patterns:removeDefaultDesiredCount` feature flag. We would recommend all aws-cdk users to set the `REMOVE_DEFAULT_DESIRED_COUNT` flag to true for all of their existing applications. + +Fixes: https://github.com/aws/aws-cdk/issues/12990 +* **aws-appsync:** RdsDataSource now takes a ServerlessCluster instead of a DatabaseCluster + +### Features + +* **apigateway:** integrate with aws services in a different region ([#13251](https://github.com/aws/aws-cdk/issues/13251)) ([d942699](https://github.com/aws/aws-cdk/commit/d9426996c07ff909993594ed91cfcf2b5761414b)), closes [#7009](https://github.com/aws/aws-cdk/issues/7009) +* **aws-s3:** adds s3 bucket AWS FSBP option ([#12804](https://github.com/aws/aws-cdk/issues/12804)) ([b9cdd52](https://github.com/aws/aws-cdk/commit/b9cdd52274eca55940c65b830939132d0e074365)), closes [#10969](https://github.com/aws/aws-cdk/issues/10969) +* **cfnspec:** cloudformation spec v29.0.0 ([#13249](https://github.com/aws/aws-cdk/issues/13249)) ([6318e26](https://github.com/aws/aws-cdk/commit/6318e2632297783bc8b5b2609bba096dd83a1113)) +* **cli:** Configurable --change-set-name CLI flag ([#13024](https://github.com/aws/aws-cdk/issues/13024)) ([18184df](https://github.com/aws/aws-cdk/commit/18184df05f5b8478ef9cae1285e45e61a0833822)), closes [#11075](https://github.com/aws/aws-cdk/issues/11075) [/github.com/aws/aws-cdk/pull/12683#issuecomment-778465771](https://github.com/aws//github.com/aws/aws-cdk/pull/12683/issues/issuecomment-778465771) +* **ecs-patterns:** remove default desiredCount to align with cfn behaviour (under feature flag) ([#13130](https://github.com/aws/aws-cdk/issues/13130)) ([a9caa45](https://github.com/aws/aws-cdk/commit/a9caa455b708e08f1cf2d366ac32892d4faa59b4)) +* **elasticloadbalancingv2:** Add support for application cookies ([#13142](https://github.com/aws/aws-cdk/issues/13142)) ([23385dd](https://github.com/aws/aws-cdk/commit/23385ddeb0decd227a0104d7b0aff06939acaad9)) +* **lambda:** code signing config ([#12656](https://github.com/aws/aws-cdk/issues/12656)) ([778ea27](https://github.com/aws/aws-cdk/commit/778ea2759a8a4504dc232eb6b1d77a38f8ee7aef)), closes [#12216](https://github.com/aws/aws-cdk/issues/12216) +* **stepfunctions-tasks:** add EKS call to SFN-tasks ([#12779](https://github.com/aws/aws-cdk/issues/12779)) ([296a10d](https://github.com/aws/aws-cdk/commit/296a10d76a9f6fc2a374d1a6461c460bcc3eeb79)) +* **synthetics:** Update CloudWatch Synthetics NodeJS runtimes ([#12907](https://github.com/aws/aws-cdk/issues/12907)) ([6aac3b6](https://github.com/aws/aws-cdk/commit/6aac3b6a9bb1586ee16e7a85ca657b544d0f8304)), closes [#12906](https://github.com/aws/aws-cdk/issues/12906) + + +### Bug Fixes + +* **appsync:** revert to allow resolver creation from data source ([#12973](https://github.com/aws/aws-cdk/issues/12973)) ([d35f032](https://github.com/aws/aws-cdk/commit/d35f03226d6d7fb5be246b4d3584ee9205b0ef2d)), closes [#12635](https://github.com/aws/aws-cdk/issues/12635) [#11522](https://github.com/aws/aws-cdk/issues/11522) +* **aws-appsync:** use serverlessCluster on rdsDataSource ([#13206](https://github.com/aws/aws-cdk/issues/13206)) ([45cf387](https://github.com/aws/aws-cdk/commit/45cf3873fb48d4043e7a22284d36695ea6bde6ef)), closes [#12567](https://github.com/aws/aws-cdk/issues/12567) +* **custom-resources:** unable to use a resource attributes as dictionary keys in AwsCustomResource ([#13074](https://github.com/aws/aws-cdk/issues/13074)) ([3cb3104](https://github.com/aws/aws-cdk/commit/3cb31043a42b035f6dcd2a318836d4bfc4973151)), closes [#13063](https://github.com/aws/aws-cdk/issues/13063) +* **eks:** `KubectlProvider` creates un-necessary security group ([#13178](https://github.com/aws/aws-cdk/issues/13178)) ([c5e8b6d](https://github.com/aws/aws-cdk/commit/c5e8b6df1e5f0359d51d025edcc68508ab5daef1)) +* **lambda-nodejs:** 'must use "outdir"' error with spaces in paths ([#13268](https://github.com/aws/aws-cdk/issues/13268)) ([09723f5](https://github.com/aws/aws-cdk/commit/09723f58ed3034fc2cb46316e6d798cb8f2bf96e)), closes [#13210](https://github.com/aws/aws-cdk/issues/13210) +* **lambda-nodejs:** invalid sample in documentation ([#12404](https://github.com/aws/aws-cdk/issues/12404)) ([520c263](https://github.com/aws/aws-cdk/commit/520c263ca3c6b0ea7d9c09c23e509a3373ee2b8a)) +* **lambda-python:** asset hash is non-deterministic ([#12984](https://github.com/aws/aws-cdk/issues/12984)) ([37debc0](https://github.com/aws/aws-cdk/commit/37debc0513c5174ca3d918fce94a138d5d34b586)), closes [#12770](https://github.com/aws/aws-cdk/issues/12770) [#12684](https://github.com/aws/aws-cdk/issues/12684) +* incorrect peerDependency on "constructs" ([#13255](https://github.com/aws/aws-cdk/issues/13255)) ([17244af](https://github.com/aws/aws-cdk/commit/17244af0d181a28b908fa161250c5a3285521c53)) +* UserPool, Volume, ElasticSearch, FSx are now RETAIN by default ([#12920](https://github.com/aws/aws-cdk/issues/12920)) ([5a54741](https://github.com/aws/aws-cdk/commit/5a54741a414d3f8b7913163f4785759b984b41d8)), closes [#12563](https://github.com/aws/aws-cdk/issues/12563) + +## [2.0.0-alpha.5](https://github.com/aws/aws-cdk/compare/v2.0.0-alpha.4...v2.0.0-alpha.5) (2021-02-17) + + +### Features + +* **apigatewayv2:** http api - jwt and cognito user pool authorizers ([#10972](https://github.com/aws/aws-cdk/issues/10972)) ([dd90e54](https://github.com/aws/aws-cdk/commit/dd90e5464b24e097a3e41a81556924018a422181)), closes [#10534](https://github.com/aws/aws-cdk/issues/10534) +* **aws-kinesisanalyticsv2:** L2 construct for Flink applications ([#12464](https://github.com/aws/aws-cdk/issues/12464)) ([94279f3](https://github.com/aws/aws-cdk/commit/94279f35e4f5ef961e0ba8528e34a8fccb9ef3fe)), closes [/github.com/aws-samples/amazon-kinesis-analytics-streaming-etl/blob/master/cdk/lib/streaming-etl.ts#L100](https://github.com/aws//github.com/aws-samples/amazon-kinesis-analytics-streaming-etl/blob/master/cdk/lib/streaming-etl.ts/issues/L100) +* **cfnspec:** cloudformation spec v27.0.0 ([#12960](https://github.com/aws/aws-cdk/issues/12960)) ([7730ac8](https://github.com/aws/aws-cdk/commit/7730ac8c6c7aedb233a24c665666b9651b2401a5)) +* **cli:** change set name is now a constant, and --no-execute will always produce one (even if empty) ([#12683](https://github.com/aws/aws-cdk/issues/12683)) ([00cdd2a](https://github.com/aws/aws-cdk/commit/00cdd2a2188d146af8b8df998e97da91c77dc270)), closes [#11075](https://github.com/aws/aws-cdk/issues/11075) +* **core:** configure bundling docker entrypoint ([#12660](https://github.com/aws/aws-cdk/issues/12660)) ([6597a09](https://github.com/aws/aws-cdk/commit/6597a09310fbc13d43389eca91b0e4b26f8ca680)), closes [#11984](https://github.com/aws/aws-cdk/issues/11984) +* **elasticsearch:** add custom endpoint options ([#12904](https://github.com/aws/aws-cdk/issues/12904)) ([f67ab86](https://github.com/aws/aws-cdk/commit/f67ab8689dc38803253067c4f9632b9bc5ea653f)), closes [#12261](https://github.com/aws/aws-cdk/issues/12261) +* **redshift:** add missing current generation RA3 NodeTypes ([#12784](https://github.com/aws/aws-cdk/issues/12784)) ([f91a3f1](https://github.com/aws/aws-cdk/commit/f91a3f1302c395e8c7ffe9d6164e8f3b252f9a27)), closes [#12783](https://github.com/aws/aws-cdk/issues/12783) +* **stepfunctions:** Implement IGrantable ([#12830](https://github.com/aws/aws-cdk/issues/12830)) ([3b5ff05](https://github.com/aws/aws-cdk/commit/3b5ff0562090059f3a94140161acce53e484776c)), closes [#12829](https://github.com/aws/aws-cdk/issues/12829) +* future flags 'core:enableStackNameDuplicates', 'aws-secretsmanager:parseOwnedSecretName' and 'aws-kms:defaultKeyPolicies' are no longer supported ([#12644](https://github.com/aws/aws-cdk/issues/12644)) ([7554246](https://github.com/aws/aws-cdk/commit/7554246ab6d0819bc57d5e67cd9e4e10a3b7e742)) + + +### Bug Fixes + +* **cfn-diff:** correctly handle version strings like '0.0.0' ([#13022](https://github.com/aws/aws-cdk/issues/13022)) ([34a921b](https://github.com/aws/aws-cdk/commit/34a921b9667402b6d90731f1fd9e3de1ef27f8bf)), closes [#13016](https://github.com/aws/aws-cdk/issues/13016) +* **cfn2ts:** correctly choose between string and object without required properties in a union ([#12954](https://github.com/aws/aws-cdk/issues/12954)) ([b7137c5](https://github.com/aws/aws-cdk/commit/b7137c59d04f14a6ad890bff1faf0f36cae131b0)), closes [#12854](https://github.com/aws/aws-cdk/issues/12854) +* **codedeploy:** allow the install agent script's commands to exit with errors ([#12782](https://github.com/aws/aws-cdk/issues/12782)) ([23d52a5](https://github.com/aws/aws-cdk/commit/23d52a570b591f080eebfbd9dc679a9ef2daeebf)), closes [#12764](https://github.com/aws/aws-cdk/issues/12764) +* **codepipeline-actions:** use BatchGetBuildBatches permission for batch builds ([#13018](https://github.com/aws/aws-cdk/issues/13018)) ([09ba573](https://github.com/aws/aws-cdk/commit/09ba573a816cc4fa9898c1700136bb332801721c)) +* **ec2:** MachineImage.genericLinux/Windows don't work in environment-agnostic stacks ([#12546](https://github.com/aws/aws-cdk/issues/12546)) ([fbe7e89](https://github.com/aws/aws-cdk/commit/fbe7e89ba764093ddec9caa7de3ca921f3dc68ac)), closes [#8759](https://github.com/aws/aws-cdk/issues/8759) +* **ec2:** Subnet cidr missing for Vpc.from_lookup() ([#12878](https://github.com/aws/aws-cdk/issues/12878)) ([9028269](https://github.com/aws/aws-cdk/commit/90282693999efdc43330b9526b9d7f4cd0fa5736)), closes [#11821](https://github.com/aws/aws-cdk/issues/11821) +* **ec2:** volume props validations are incorrect ([#12821](https://github.com/aws/aws-cdk/issues/12821)) ([12cddff](https://github.com/aws/aws-cdk/commit/12cddffcfa38cc0522e4c36327f193e6a605f441)), closes [#12816](https://github.com/aws/aws-cdk/issues/12816) [#12816](https://github.com/aws/aws-cdk/issues/12816) [#12074](https://github.com/aws/aws-cdk/issues/12074) +* **ec2:** VpnConnection fails if `ip` is a Token ([#12923](https://github.com/aws/aws-cdk/issues/12923)) ([953957a](https://github.com/aws/aws-cdk/commit/953957a2c3e630b5ad2196e113f943e27ee21067)), closes [#11633](https://github.com/aws/aws-cdk/issues/11633) +* **kms:** cross-environment usage fails when trustAccountIdentities is set ([#12925](https://github.com/aws/aws-cdk/issues/12925)) ([2b917ec](https://github.com/aws/aws-cdk/commit/2b917eceb598b3365123781445df7e2bd8a80b74)), closes [#12921](https://github.com/aws/aws-cdk/issues/12921) [#12741](https://github.com/aws/aws-cdk/issues/12741) +* **lambda-python:** cryptography >= 3.4 is not supported by older pip version ([#12934](https://github.com/aws/aws-cdk/issues/12934)) ([b68acf8](https://github.com/aws/aws-cdk/commit/b68acf828e04841dd7e62b30fe80db8c25e5d96e)), closes [/cryptography.io/en/3.4/changelog.html#v3-4](https://github.com/aws//cryptography.io/en/3.4/changelog.html/issues/v3-4) +* **tools:** doc block links not clickable in VS Code ([#12336](https://github.com/aws/aws-cdk/issues/12336)) ([4f17f92](https://github.com/aws/aws-cdk/commit/4f17f923edc5e55b0977dcb250c9908027297d1b)) + +## [2.0.0-alpha.4](https://github.com/aws/aws-cdk/compare/v2.0.0-alpha.3...v2.0.0-alpha.4) (2021-02-10) + + +### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES + +* **appmesh:** the properties virtualRouter and virtualNode of VirtualServiceProps have been replaced with the union-like class VirtualServiceProvider +* **appmesh**: the method `addVirtualService` has been removed from `IMesh` +* **cloudfront:** experimental EdgeFunction stack names have changed from 'edge-lambda-stack-${region}' to 'edge-lambda-stack-${stackid}' to support multiple independent CloudFront distributions with EdgeFunctions. + +### Features + +* **apigateway:** cognito user pool authorizer ([#12786](https://github.com/aws/aws-cdk/issues/12786)) ([ff1e5b3](https://github.com/aws/aws-cdk/commit/ff1e5b3c580119c107fe26c67fe3cc220f9ee7c9)), closes [#5618](https://github.com/aws/aws-cdk/issues/5618) +* **apigateway:** import an existing Resource ([#12785](https://github.com/aws/aws-cdk/issues/12785)) ([8a1a9b8](https://github.com/aws/aws-cdk/commit/8a1a9b82a36e681334fd45be595f6ecdf904ad34)), closes [#4432](https://github.com/aws/aws-cdk/issues/4432) +* **appmesh:** change VirtualService provider to a union-like class ([#11978](https://github.com/aws/aws-cdk/issues/11978)) ([dfc765a](https://github.com/aws/aws-cdk/commit/dfc765af44c755f10be8f6c1c2eae55f62e2aa08)), closes [#9490](https://github.com/aws/aws-cdk/issues/9490) +* **aws-route53:** cross account DNS delegations ([#12680](https://github.com/aws/aws-cdk/issues/12680)) ([126a693](https://github.com/aws/aws-cdk/commit/126a6935cacc1f68b1d1155e484912d4ed6978f2)), closes [#8776](https://github.com/aws/aws-cdk/issues/8776) +* **cfnspec:** cloudformation spec v26.0.0 ([#12841](https://github.com/aws/aws-cdk/issues/12841)) ([f959b3a](https://github.com/aws/aws-cdk/commit/f959b3a2eeb5a9a9e44ea3f88622f77f7667bfa4)) +* **cloudfront:** add PublicKey and KeyGroup L2 constructs ([#12743](https://github.com/aws/aws-cdk/issues/12743)) ([59cb6d0](https://github.com/aws/aws-cdk/commit/59cb6d032a55515ec5e9903f899de588d18d4cb5)) +* **cloudfront:** add support for TrustedKeyGroups in Distribution and CloudFrontWebDistribution ([#12847](https://github.com/aws/aws-cdk/issues/12847)) ([349a6e2](https://github.com/aws/aws-cdk/commit/349a6e2bfaa72440deb3767fb1e28e38cc4d73ef)), closes [#11791](https://github.com/aws/aws-cdk/issues/11791) +* **core:** `stack.exportValue()` can be used to solve "deadly embrace" ([#12778](https://github.com/aws/aws-cdk/issues/12778)) ([3b66088](https://github.com/aws/aws-cdk/commit/3b66088010b6f2315a215e92505d5279680f16d4)), closes [#7602](https://github.com/aws/aws-cdk/issues/7602) [#2036](https://github.com/aws/aws-cdk/issues/2036) +* **ec2:** can define Launch Templates (not use them yet) ([#12385](https://github.com/aws/aws-cdk/issues/12385)) ([32c0de7](https://github.com/aws/aws-cdk/commit/32c0de74cf40f08a291c8589fd85f3dd636749ea)) +* **ecr:** Public Gallery authorization token ([#12775](https://github.com/aws/aws-cdk/issues/12775)) ([8434294](https://github.com/aws/aws-cdk/commit/84342943ad9f2ea8a83773f00816a0b8117c4d17)) +* **ecs-patterns:** Add PlatformVersion option to ScheduledFargateTask props ([#12676](https://github.com/aws/aws-cdk/issues/12676)) ([3cbf38b](https://github.com/aws/aws-cdk/commit/3cbf38b09a9e66a6c009f833481fb25b8c5fc26c)), closes [#12623](https://github.com/aws/aws-cdk/issues/12623) +* **elbv2:** support for 2020 SSL policy ([#12710](https://github.com/aws/aws-cdk/issues/12710)) ([1dd3d05](https://github.com/aws/aws-cdk/commit/1dd3d0518dc2a70c725f87dd5d4377338389125c)), closes [#12595](https://github.com/aws/aws-cdk/issues/12595) +* **iam:** Permissions Boundaries ([#12777](https://github.com/aws/aws-cdk/issues/12777)) ([415eb86](https://github.com/aws/aws-cdk/commit/415eb861c65829cc53eabbbb8706f83f08c74570)), closes [aws/aws-cdk-rfcs#5](https://github.com/aws/aws-cdk-rfcs/issues/5) [#3242](https://github.com/aws/aws-cdk/issues/3242) +* **lambda:** inline code for Python 3.8 ([#12788](https://github.com/aws/aws-cdk/issues/12788)) ([8d3aaba](https://github.com/aws/aws-cdk/commit/8d3aabaffe436e6a3eebc0a58fe361c5b4b93f08)), closes [#6503](https://github.com/aws/aws-cdk/issues/6503) +* **lambda:** layer version removal policy ([#12792](https://github.com/aws/aws-cdk/issues/12792)) ([5664480](https://github.com/aws/aws-cdk/commit/5664480a97958263ee7cb903c2aff0276e738dc3)), closes [#12718](https://github.com/aws/aws-cdk/issues/12718) +* **lambda:** nodejs14.x runtime ([#12861](https://github.com/aws/aws-cdk/issues/12861)) ([12c224a](https://github.com/aws/aws-cdk/commit/12c224a0f54230b6226de8defa527f7b53f9bc65)) + + +### Bug Fixes + +* **apigateway:** stack update fails to replace api key ([38cbe62](https://github.com/aws/aws-cdk/commit/38cbe620859d6efabda95dbdd3185a480ab43894)), closes [#12698](https://github.com/aws/aws-cdk/issues/12698) +* **apigateway:** stack update fails to replace api key ([#12745](https://github.com/aws/aws-cdk/issues/12745)) ([ffe7e42](https://github.com/aws/aws-cdk/commit/ffe7e425e605144a465cea9befa68d4fe19f9d8c)), closes [#12698](https://github.com/aws/aws-cdk/issues/12698) +* **cfn-include:** AWS::CloudFormation resources fail in monocdk ([#12758](https://github.com/aws/aws-cdk/issues/12758)) ([5060782](https://github.com/aws/aws-cdk/commit/5060782b00e17bdf44e225f8f5ef03344be238c7)), closes [#11595](https://github.com/aws/aws-cdk/issues/11595) +* **cli, codepipeline:** renamed bootstrap stack still not supported ([#12771](https://github.com/aws/aws-cdk/issues/12771)) ([40b32bb](https://github.com/aws/aws-cdk/commit/40b32bbda272b6e2f92fd5dd8de7ca5bf405ce52)), closes [#12594](https://github.com/aws/aws-cdk/issues/12594) [#12732](https://github.com/aws/aws-cdk/issues/12732) +* **cloudfront:** use node addr for edgeStackId name ([#12702](https://github.com/aws/aws-cdk/issues/12702)) ([c429bb7](https://github.com/aws/aws-cdk/commit/c429bb7df2406346426dce22d716cabc484ec7e6)), closes [#12323](https://github.com/aws/aws-cdk/issues/12323) +* **codedeploy:** wrong syntax on Windows 'installAgent' flag ([#12736](https://github.com/aws/aws-cdk/issues/12736)) ([238742e](https://github.com/aws/aws-cdk/commit/238742e4323310ce850d8edc70abe4b0e9f53186)), closes [#12734](https://github.com/aws/aws-cdk/issues/12734) +* **codepipeline:** permission denied for Action-level environment variables ([#12761](https://github.com/aws/aws-cdk/issues/12761)) ([99fd074](https://github.com/aws/aws-cdk/commit/99fd074a07ead624f64d3fe64685ba67c798976e)), closes [#12742](https://github.com/aws/aws-cdk/issues/12742) +* **core:** append file extension to s3 asset key in new style synthesizer ([#12765](https://github.com/aws/aws-cdk/issues/12765)) ([77b9d39](https://github.com/aws/aws-cdk/commit/77b9d3930ec722be3a40e4013cd9335f90b0d945)), closes [#12740](https://github.com/aws/aws-cdk/issues/12740) +* **core:** incorrect GetParameter permissions in nonstandard partitions ([#12813](https://github.com/aws/aws-cdk/issues/12813)) ([be7202f](https://github.com/aws/aws-cdk/commit/be7202fa229435607e81d480726e9ce7f625b85a)) +* **ec2:** ARM-backed bastion hosts try to run x86-based Amazon Linux AMI ([#12280](https://github.com/aws/aws-cdk/issues/12280)) ([1a73d76](https://github.com/aws/aws-cdk/commit/1a73d761ad2363842567a1b6e0488ceb093e70b2)), closes [#12279](https://github.com/aws/aws-cdk/issues/12279) +* **efs:** EFS fails to create when using a VPC with multiple subnets per availability zone ([#12097](https://github.com/aws/aws-cdk/issues/12097)) ([889d673](https://github.com/aws/aws-cdk/commit/889d6734c10174f2661e45057c345cd112a44187)), closes [#10170](https://github.com/aws/aws-cdk/issues/10170) +* **iam:** cannot use the same Role for multiple Config Rules ([#12724](https://github.com/aws/aws-cdk/issues/12724)) ([2f6521a](https://github.com/aws/aws-cdk/commit/2f6521a1d8670b2653f7dee281309351181cf918)), closes [#12714](https://github.com/aws/aws-cdk/issues/12714) +* **lambda:** codeguru profiler not set up for Node runtime ([#12712](https://github.com/aws/aws-cdk/issues/12712)) ([59db763](https://github.com/aws/aws-cdk/commit/59db763e7d05d68fd85b6fd37246d69d4670d7d5)), closes [#12624](https://github.com/aws/aws-cdk/issues/12624) + +## [2.0.0-alpha.3](https://github.com/aws/aws-cdk/compare/v2.0.0-alpha.2...v2.0.0-alpha.3) (2021-02-03) + + +### Features + +* **aws-codebuild:** add `enableBatchBuilds()` to Project ([#12531](https://github.com/aws/aws-cdk/issues/12531)) ([0568390](https://github.com/aws/aws-cdk/commit/05683907d6ffc9ab12b6744c1b59b0df096789e1)) +* **batch:** Compute Resources placement group ([#12203](https://github.com/aws/aws-cdk/issues/12203)) ([fe37174](https://github.com/aws/aws-cdk/commit/fe37174ec29b7d3b60b252df08ceecf1aa057098)) + +## [2.0.0-alpha.2](https://github.com/aws/aws-cdk/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2021-01-27) + + +### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES + +* **s3-deployment:** User metadata keys of bucket objects will change from `x-amz-meta-x-amz-meta-x-amzn-meta-mykey` to `x-amz-meta-mykey`. +* **core:** users of modern synthesis (`DefaultSynthesizer`, +used by CDK Pipelines) must upgrade their bootstrap stacks. Run `cdk bootstrap`. + +### Features + +* **aws-codepipeline-actions:** Add Full Clone support for CodeCommit ([#12558](https://github.com/aws/aws-cdk/issues/12558)) ([d169688](https://github.com/aws/aws-cdk/commit/d169688f35bc78c88c44ff9a7d8fa0dfea71f904)), closes [#12236](https://github.com/aws/aws-cdk/issues/12236) +* **cfnspec:** cloudformation spec v24.0.0 ([#12615](https://github.com/aws/aws-cdk/issues/12615)) ([98ebe96](https://github.com/aws/aws-cdk/commit/98ebe964fcd1f528fc4796bf39dc574b222b0014)), closes [#12474](https://github.com/aws/aws-cdk/issues/12474) +* **cognito:** allow to set read and write attributes in Cognito UserPoolClient ([#7607](https://github.com/aws/aws-cdk/issues/7607)) ([552e1e9](https://github.com/aws/aws-cdk/commit/552e1e9d649528875680a8a1cb2aad8f0a0ebcea)), closes [#7407](https://github.com/aws/aws-cdk/issues/7407) +* **ec2:** Support for new EBS types ([#12074](https://github.com/aws/aws-cdk/issues/12074)) ([6a2ce55](https://github.com/aws/aws-cdk/commit/6a2ce55e7213bb8356f2f37dbd02f1a3d52883be)), closes [#12071](https://github.com/aws/aws-cdk/issues/12071) +* **eks:** Graduate to stable ([#12640](https://github.com/aws/aws-cdk/issues/12640)) ([b5ba7cd](https://github.com/aws/aws-cdk/commit/b5ba7cdd61714bcfbf2135240790340a77ee1a8b)) +* **s3:** Bucket keys ([#12376](https://github.com/aws/aws-cdk/issues/12376)) ([d126fcc](https://github.com/aws/aws-cdk/commit/d126fcca685346c0607babfbbf4d341f669a9e81)), closes [#11828](https://github.com/aws/aws-cdk/issues/11828) +* **stepfunctions-tasks:** EcsRunTask now uses taskDefinition family instead of ARN ([#12436](https://github.com/aws/aws-cdk/issues/12436)) ([abde96b](https://github.com/aws/aws-cdk/commit/abde96b046358fc5435545692eba4fd63d503914)), closes [#12080](https://github.com/aws/aws-cdk/issues/12080) +* **stepfunctions-tasks:** support databrew startJobRun task ([#12532](https://github.com/aws/aws-cdk/issues/12532)) ([eacd2f7](https://github.com/aws/aws-cdk/commit/eacd2f7ea67c83d50c839acf29fbe953ae49d987)) + + +### Bug Fixes + +* **apigateway:** cannot remove first api key from usage plan ([#12505](https://github.com/aws/aws-cdk/issues/12505)) ([96cbe32](https://github.com/aws/aws-cdk/commit/96cbe32d2399d82a2ad6c3bf6dc1fd65396882d4)), closes [#11876](https://github.com/aws/aws-cdk/issues/11876) +* **apigatewayv2:** multiple http integrations are created for each route ([#12528](https://github.com/aws/aws-cdk/issues/12528)) ([855ce59](https://github.com/aws/aws-cdk/commit/855ce59039a577d142d68720e86d81610edffc64)), closes [40aws-cdk/aws-apigatewayv2/lib/http/route.ts#L128](https://github.com/40aws-cdk/aws-apigatewayv2/lib/http/route.ts/issues/L128) +* **aws-ecs:** Invalid user data defined for windows autoscaling groups ([#12585](https://github.com/aws/aws-cdk/issues/12585)) ([638b995](https://github.com/aws/aws-cdk/commit/638b995cb72b0819a1965a7ccf451b6ed9034a1b)), closes [#12583](https://github.com/aws/aws-cdk/issues/12583) +* **core:** modern deployments fail if bootstrap stack is renamed ([#12594](https://github.com/aws/aws-cdk/issues/12594)) ([e5c616f](https://github.com/aws/aws-cdk/commit/e5c616f73eac395492636341f57fb6a716d1ea69)), closes [#11952](https://github.com/aws/aws-cdk/issues/11952) [#11420](https://github.com/aws/aws-cdk/issues/11420) [#9053](https://github.com/aws/aws-cdk/issues/9053) +* **pipelines:** assets broken in Pipelines synthesized from Windows ([#12573](https://github.com/aws/aws-cdk/issues/12573)) ([5c3dce5](https://github.com/aws/aws-cdk/commit/5c3dce56c71083321069a31213aaa5bce40f51d3)), closes [#12540](https://github.com/aws/aws-cdk/issues/12540) +* **pipelines:** can't use CodePipeline variables in Synth environment variables ([#12602](https://github.com/aws/aws-cdk/issues/12602)) ([736b260](https://github.com/aws/aws-cdk/commit/736b260db7f21d89e220591007580f62b22fea3a)), closes [#12061](https://github.com/aws/aws-cdk/issues/12061) [#11178](https://github.com/aws/aws-cdk/issues/11178) +* **pipelines:** unable to publish assets inside VPC ([#12331](https://github.com/aws/aws-cdk/issues/12331)) ([a16f09c](https://github.com/aws/aws-cdk/commit/a16f09c9ea675caf5b1e50a4e1cc288e5afd1237)), closes [#11815](https://github.com/aws/aws-cdk/issues/11815) +* **s3-deployment:** User metadata keys have redundant triple `x-amz` prefix ([#12414](https://github.com/aws/aws-cdk/issues/12414)) ([6716181](https://github.com/aws/aws-cdk/commit/671618152dc585ef0703f6c3501f6ee5a366b4a9)), closes [#8459](https://github.com/aws/aws-cdk/issues/8459) +* **secretsmanager:** fromSecretPartialArn() has incorrect grant policies ([#12665](https://github.com/aws/aws-cdk/issues/12665)) ([560915e](https://github.com/aws/aws-cdk/commit/560915ece87a919f499a64452b919a0b291394ee)), closes [#12411](https://github.com/aws/aws-cdk/issues/12411) +* **synthetics:** default execution role breaks in non aws partitions ([#12096](https://github.com/aws/aws-cdk/issues/12096)) ([c01272c](https://github.com/aws/aws-cdk/commit/c01272c14be9b7ff635281952f3cfeed971a352e)), closes [#12094](https://github.com/aws/aws-cdk/issues/12094) + +## [2.0.0-alpha.1](https://github.com/aws/aws-cdk/compare/v2.0.0-alpha.0...v2.0.0-alpha.1) (2021-01-21) + + +### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES + +* **apigatewayv2:** `subnets` prop in `VpcLink` resource now takes `SubnetSelection` instead of `ISubnet[]` +* **eks:** Existing self managed nodes may loose the ability to host additional services of type `LoadBalancer` . See https://github.com/aws/aws-cdk/pull/12269#issuecomment-752161190 for possible mitigations. +* **eks:** the `@aws-cdk/eks.KubectlLayer` layer class has been moved to `@aws-cdk/lambda-layer-kubectl.KubectlLayer`. +* **eks:** `LegacyCluster` was removed since it existed only for a transition period to allow gradual migration to the current cluster class. + +- eks: `kubectlEnabled` property was removed, all clusters now support `kubectl`. +* **core:** Creation stack traces for `Lazy` values are no longer +captured by default in order to speed up tests. Run with +`CDK_DEBUG=true` (or `cdk --debug`) to capture stack traces. +* **apigatewayv2:** `HttpApi.fromApiId()` has been replaced with +`HttpApi.fromHttpApiAttributes()`. +* **elasticsearch:** ES Domain LogGroup LogicalId will change, which will trigger new log group resources to be created +* **cloudfront-origins:** Default minimum origin SSL protocol for `HttpOrigin` and `LoadBalancerOrigin` changed from SSLv3 to TLSv1.2. + +### Features + +* **apigatewayv2:** http api - disable execute api endpoint ([#12426](https://github.com/aws/aws-cdk/issues/12426)) ([1724da7](https://github.com/aws/aws-cdk/commit/1724da758666ec92f7b923c899d2f2f439083ba2)), closes [#12241](https://github.com/aws/aws-cdk/issues/12241) +* **appmesh:** add listener TLS certificates for VirtualNodes and VirtualGateways ([#11863](https://github.com/aws/aws-cdk/issues/11863)) ([175a257](https://github.com/aws/aws-cdk/commit/175a2570465d484aa0a73a7bded34e686da493ed)), closes [#10051](https://github.com/aws/aws-cdk/issues/10051) +* **appmesh:** add timeout support to Routes ([#11973](https://github.com/aws/aws-cdk/issues/11973)) ([78c185d](https://github.com/aws/aws-cdk/commit/78c185d15e64e81ee86ee71cd6430cd80fdbb8fe)) +* **aws-cloudfront:** support minimum security protocol ([#12231](https://github.com/aws/aws-cdk/issues/12231)) ([40976d9](https://github.com/aws/aws-cdk/commit/40976d9d71bb5c77d6dd9962f67129c4a7e91d0b)), closes [#12199](https://github.com/aws/aws-cdk/issues/12199) +* **aws-kms:** support waiting period ([#12224](https://github.com/aws/aws-cdk/issues/12224)) ([9f451bd](https://github.com/aws/aws-cdk/commit/9f451bda33ae83e41e395799d9bb3f07ce4e100d)), closes [#12218](https://github.com/aws/aws-cdk/issues/12218) +* **aws-lambda-nodejs:** add esbuild `define` bundling option ([#12424](https://github.com/aws/aws-cdk/issues/12424)) ([581f6af](https://github.com/aws/aws-cdk/commit/581f6af3d1f71737ca93b6ecb9b004bdade149a8)), closes [#12423](https://github.com/aws/aws-cdk/issues/12423) +* **cdk-assets:** add external asset support ([#12259](https://github.com/aws/aws-cdk/issues/12259)) ([05a9980](https://github.com/aws/aws-cdk/commit/05a998065b3333854715c456b20b7cc5d5daac67)) +* **cfnspec:** CloudFormation resource specification update to v23.0.0 ([#12490](https://github.com/aws/aws-cdk/issues/12490)) ([a7a2236](https://github.com/aws/aws-cdk/commit/a7a2236367f8f01b00b6d90f1d3fe7bf674b1aee)) +* **cfnspec:** cloudformation spec v22.0.0 ([#12204](https://github.com/aws/aws-cdk/issues/12204)) ([a5be2e9](https://github.com/aws/aws-cdk/commit/a5be2e9d57862a5cc9a108d9fdedd1398e492645)), closes [#12170](https://github.com/aws/aws-cdk/issues/12170) [#11974](https://github.com/aws/aws-cdk/issues/11974) [#12114](https://github.com/aws/aws-cdk/issues/12114) [#12028](https://github.com/aws/aws-cdk/issues/12028) +* **cli:** `--quiet` does not print template in `cdk synth` ([#12178](https://github.com/aws/aws-cdk/issues/12178)) ([74458a0](https://github.com/aws/aws-cdk/commit/74458a0e9eebce4ee254673aad8933d39588d843)), closes [#11970](https://github.com/aws/aws-cdk/issues/11970) +* **cloudfront:** allow to specify stack ID for Lambda@Edge ([#12163](https://github.com/aws/aws-cdk/issues/12163)) ([049e70c](https://github.com/aws/aws-cdk/commit/049e70c3fc32c2287623a5f7bd3ae2c38ce29409)), closes [#12136](https://github.com/aws/aws-cdk/issues/12136) +* **cloudfront-origins:** ability to specify minimum origin SSL protocol ([#11997](https://github.com/aws/aws-cdk/issues/11997)) ([a0aa61d](https://github.com/aws/aws-cdk/commit/a0aa61d5bc1134accef7bab2707edb497fce2c57)), closes [#11994](https://github.com/aws/aws-cdk/issues/11994) +* **cloudfront-origins:** CloudFront Origins is now Generally Available ([#12011](https://github.com/aws/aws-cdk/issues/12011)) ([daace16](https://github.com/aws/aws-cdk/commit/daace1684638b8fb8b89b60bf39b24c65a769d64)), closes [#11919](https://github.com/aws/aws-cdk/issues/11919) +* **cloudwatch:** full precision for SingleValueWidgets ([#12274](https://github.com/aws/aws-cdk/issues/12274)) ([45d78f0](https://github.com/aws/aws-cdk/commit/45d78f0b132380e95a585ea7bec96f08f2069edc)), closes [#8940](https://github.com/aws/aws-cdk/issues/8940) [#12066](https://github.com/aws/aws-cdk/issues/12066) +* **codebuild:** add `startBatchBuild` option ([#11743](https://github.com/aws/aws-cdk/issues/11743)) ([d9353b7](https://github.com/aws/aws-cdk/commit/d9353b7625420595401620709828de2f44c66597)), closes [/github.com/aws-cloudformation/aws-cloudformation-coverage-roadmap/issues/621#issuecomment-732336650](https://github.com/aws//github.com/aws-cloudformation/aws-cloudformation-coverage-roadmap/issues/621/issues/issuecomment-732336650) [#11663](https://github.com/aws/aws-cdk/issues/11663) +* **codebuild:** prevent using Secrets in plain-text environment variables ([#12150](https://github.com/aws/aws-cdk/issues/12150)) ([998af8f](https://github.com/aws/aws-cdk/commit/998af8f0e574b7b07083f0f347dc4934a6da1966)) +* **codebuild:** support Standard 5.0 ([#12434](https://github.com/aws/aws-cdk/issues/12434)) ([422dc8e](https://github.com/aws/aws-cdk/commit/422dc8e9d50105af4e710d409a4f301079d43f3f)), closes [#12433](https://github.com/aws/aws-cdk/issues/12433) +* **codecommit:** HTTPS GRC clone URL ([#12312](https://github.com/aws/aws-cdk/issues/12312)) ([36b081e](https://github.com/aws/aws-cdk/commit/36b081e470674005b54c190b50da9b2ed3d9ad9c)) +* **core:** expose custom resource provider's role ([#11923](https://github.com/aws/aws-cdk/issues/11923)) ([06f26d3](https://github.com/aws/aws-cdk/commit/06f26d390707b0e2a4e05e36405a4751c907a234)), closes [/github.com/aws/aws-cdk/pull/9751#issuecomment-723554595](https://github.com/aws//github.com/aws/aws-cdk/pull/9751/issues/issuecomment-723554595) +* **core:** validate maximum amount of resources in a stack ([#12193](https://github.com/aws/aws-cdk/issues/12193)) ([26121c8](https://github.com/aws/aws-cdk/commit/26121c81abf0fb92de97567c758a1ecf60f85f63)), closes [#276](https://github.com/aws/aws-cdk/issues/276) +* **ec2:** add m6gd and r6gd metadata ([#12302](https://github.com/aws/aws-cdk/issues/12302)) ([ce4eb20](https://github.com/aws/aws-cdk/commit/ce4eb2037f40148062784addb82ee8cf9881d129)), closes [#12301](https://github.com/aws/aws-cdk/issues/12301) +* **ec2:** add r5b instance type to instance class ([#12027](https://github.com/aws/aws-cdk/issues/12027)) ([d276b02](https://github.com/aws/aws-cdk/commit/d276b020e61ee4455c7ed9f093436d1aab319e76)), closes [#12025](https://github.com/aws/aws-cdk/issues/12025) +* **ec2:** Add VPC endpoints for Athena and Glue ([#12073](https://github.com/aws/aws-cdk/issues/12073)) ([73ef6b1](https://github.com/aws/aws-cdk/commit/73ef6b180c8a7c3d8e984b308149eeb9eb78b40b)), closes [#12072](https://github.com/aws/aws-cdk/issues/12072) +* **ecs:** deployment circuit breaker support ([#12168](https://github.com/aws/aws-cdk/issues/12168)) ([e8801a0](https://github.com/aws/aws-cdk/commit/e8801a0ddb04e75de87ba34f3a58b1adebae5301)) +* **ecs-patterns:** Add DeploymentController option to Fargate services ([#10452](https://github.com/aws/aws-cdk/issues/10452)) ([2cd233a](https://github.com/aws/aws-cdk/commit/2cd233a94fc2f3cb06211157738e59e8c7ee85e5)), closes [aws/containers-roadmap#130](https://github.com/aws/containers-roadmap/issues/130) [#10971](https://github.com/aws/aws-cdk/issues/10971) +* **ecs-patterns:** add ruleName optional parameter for ScheduledTask constructs ([#12190](https://github.com/aws/aws-cdk/issues/12190)) ([b1318bd](https://github.com/aws/aws-cdk/commit/b1318bda54d1c0955a371eccce76b748d312b570)) +* **ecs-patterns:** containerName for QueueProcessingEc2Service ([88d4149](https://github.com/aws/aws-cdk/commit/88d4149432d55e65b23448fd58d8ec3e96f3e72c)), closes [#10517](https://github.com/aws/aws-cdk/issues/10517) +* **eks:** attach cluster security group to self-managed nodes ([#12042](https://github.com/aws/aws-cdk/issues/12042)) ([1078bea](https://github.com/aws/aws-cdk/commit/1078bea4c90afaac76a5e81328a9d6ec44a79e9a)) +* **eks:** aws-node-termination-handler for spot instances now pulls the image from public ECR ([#12141](https://github.com/aws/aws-cdk/issues/12141)) ([c752fab](https://github.com/aws/aws-cdk/commit/c752fabf2022b5e697b6bf900e7878076f28b31a)), closes [#12134](https://github.com/aws/aws-cdk/issues/12134) +* **eks:** bundle kubectl, helm and awscli instead of SAR app ([#12129](https://github.com/aws/aws-cdk/issues/12129)) ([63bc98f](https://github.com/aws/aws-cdk/commit/63bc98f0d4a85b1c544d78420fd44579ce46a806)), closes [#11874](https://github.com/aws/aws-cdk/issues/11874) +* **eks:** connect all custom resources to the cluster VPC ([#10200](https://github.com/aws/aws-cdk/issues/10200)) ([eaa8222](https://github.com/aws/aws-cdk/commit/eaa82222349fcce1ef4b80e873a35002d6f036e5)) +* **eks:** option to disable manifest validation ([#12012](https://github.com/aws/aws-cdk/issues/12012)) ([579b923](https://github.com/aws/aws-cdk/commit/579b9235706d6848847a258bbb607a9bff6a9e11)), closes [#11763](https://github.com/aws/aws-cdk/issues/11763) +* **eks:** spot interruption handler can be disabled for self managed nodes ([#12453](https://github.com/aws/aws-cdk/issues/12453)) ([6ac1f4f](https://github.com/aws/aws-cdk/commit/6ac1f4fdef5853785d8e57652ec4c4e1d770844d)), closes [#12451](https://github.com/aws/aws-cdk/issues/12451) +* **eks:** spot support for managed nodegroups ([#11962](https://github.com/aws/aws-cdk/issues/11962)) ([6ccd00f](https://github.com/aws/aws-cdk/commit/6ccd00fc7641f3696559367d65733b66df707fa7)), closes [#11827](https://github.com/aws/aws-cdk/issues/11827) +* **elasticsearch:** add support for version 7_8 and 7_9 ([#12222](https://github.com/aws/aws-cdk/issues/12222)) ([09d1f6c](https://github.com/aws/aws-cdk/commit/09d1f6cae610477c17234eab4a02fc731e34e2cf)), closes [#12202](https://github.com/aws/aws-cdk/issues/12202) +* **elasticsearch:** Support `EnableVersionUpgrade` update policy ([#12239](https://github.com/aws/aws-cdk/issues/12239)) ([14f8b06](https://github.com/aws/aws-cdk/commit/14f8b06686368da15211dbd528928ad4000d9eb8)), closes [#12210](https://github.com/aws/aws-cdk/issues/12210) +* **elasticsearch:** support audit logs ([#12106](https://github.com/aws/aws-cdk/issues/12106)) ([d10ea63](https://github.com/aws/aws-cdk/commit/d10ea631f8699385cadf61d6e0a067b68da37df6)), closes [#12105](https://github.com/aws/aws-cdk/issues/12105) +* **elasticsearch:** UltraWarm nodes ([#12265](https://github.com/aws/aws-cdk/issues/12265)) ([3a9056d](https://github.com/aws/aws-cdk/commit/3a9056d87b0c739247013fc74678ab54fd3eb382)), closes [#6462](https://github.com/aws/aws-cdk/issues/6462) +* **ivs:** add IVS L2 Constructs ([#11454](https://github.com/aws/aws-cdk/issues/11454)) ([f813bff](https://github.com/aws/aws-cdk/commit/f813bff2da4792cfa7bfce6f572a7d2bb5c4759d)) +* **lambda:** encryption key for environment variables ([#11893](https://github.com/aws/aws-cdk/issues/11893)) ([ccbaf83](https://github.com/aws/aws-cdk/commit/ccbaf8399c3a9f3ff6e60758e0b713d82f37420b)), closes [#10837](https://github.com/aws/aws-cdk/issues/10837) +* **lambda-nodejs:** expose more esbuild options ([#12063](https://github.com/aws/aws-cdk/issues/12063)) ([bab21b3](https://github.com/aws/aws-cdk/commit/bab21b377593b7475b047d05a54914344352c054)), closes [#12046](https://github.com/aws/aws-cdk/issues/12046) +* **lambda-nodejs:** Expose optional props for advanced usage of esbuild ([#12123](https://github.com/aws/aws-cdk/issues/12123)) ([ecc98ac](https://github.com/aws/aws-cdk/commit/ecc98ac75acb1adbb4f5e66f853dc3226e490c98)) +* **rds:** add grantConnect for RDS Proxy ([#12243](https://github.com/aws/aws-cdk/issues/12243)) ([eb45ca8](https://github.com/aws/aws-cdk/commit/eb45ca816626b243daacbd3a8916ac1e5db202ea)), closes [#10133](https://github.com/aws/aws-cdk/issues/10133) +* **rds:** add support for setting public accessibility ([#12164](https://github.com/aws/aws-cdk/issues/12164)) ([b8f48e5](https://github.com/aws/aws-cdk/commit/b8f48e514c09d2f46d8bbae27171877df61e7f2a)), closes [#12093](https://github.com/aws/aws-cdk/issues/12093) +* **route53:** Vpc endpoint service private dns ([#10780](https://github.com/aws/aws-cdk/issues/10780)) ([8f6f9a8](https://github.com/aws/aws-cdk/commit/8f6f9a8678496e131a43ca4c76e561d50a0a0de8)) +* **s3:** option to auto delete objects upon bucket removal ([#12090](https://github.com/aws/aws-cdk/issues/12090)) ([32e9c23](https://github.com/aws/aws-cdk/commit/32e9c23be2852cfca79a57c90e52b9301b1c7081)), closes [#3297](https://github.com/aws/aws-cdk/issues/3297) [#9751](https://github.com/aws/aws-cdk/issues/9751) +* **s3-deployment:** support vpc in BucketDeploymentProps ([#12035](https://github.com/aws/aws-cdk/issues/12035)) ([6caf72f](https://github.com/aws/aws-cdk/commit/6caf72f67d6d3373186e57f32671369c2cc8b56e)), closes [#11734](https://github.com/aws/aws-cdk/issues/11734) +* **sns:** fifo topic with content-based deduplication support [#11127](https://github.com/aws/aws-cdk/issues/11127) ([#11588](https://github.com/aws/aws-cdk/issues/11588)) ([7e60d8e](https://github.com/aws/aws-cdk/commit/7e60d8e7aa7a6507675a24991d9c9832017ddfed)) +* **stepfunctions-tasks:** add support for ModelClientConfig to SageMakerCreateTransformJob ([#11892](https://github.com/aws/aws-cdk/issues/11892)) ([bf05092](https://github.com/aws/aws-cdk/commit/bf050928c033328b259746c0a7f33038aadc4c17)) +* **synthetics:** Update Cloudwatch Synthetics canaries NodeJS runtimes ([#11866](https://github.com/aws/aws-cdk/issues/11866)) ([4f6e377](https://github.com/aws/aws-cdk/commit/4f6e377ae3f35c3fa010e1597c3d71ef6e6e9a04)), closes [#11870](https://github.com/aws/aws-cdk/issues/11870) +* Configre containerName for QueueProcessingFargateService ([fad27f6](https://github.com/aws/aws-cdk/commit/fad27f65a73dc3b9c208439c5e474295491381da)) +* remove the construct compatibility layer ([#12054](https://github.com/aws/aws-cdk/issues/12054)) ([8d3c02c](https://github.com/aws/aws-cdk/commit/8d3c02c117072433bf649003af0c4fee4a1f8c4b)) + + +### Bug Fixes + +* **apigatewayv2:** vpclink - explicit subnet specification still causes private subnets to be included ([#12401](https://github.com/aws/aws-cdk/issues/12401)) ([336a58f](https://github.com/aws/aws-cdk/commit/336a58f06a3b3a9f5db2a79350f8721244767e3b)), closes [#12083](https://github.com/aws/aws-cdk/issues/12083) +* **appsync:** rds data source configured with cluster arn ([#12255](https://github.com/aws/aws-cdk/issues/12255)) ([d0305f3](https://github.com/aws/aws-cdk/commit/d0305f33da41ce1f07a5d571eb21c0ee9ea852d0)), closes [#11536](https://github.com/aws/aws-cdk/issues/11536) +* **aws-ecs:** Support configuring Windows capacity for cluster ASGs ([#12365](https://github.com/aws/aws-cdk/issues/12365)) ([6d9a0f1](https://github.com/aws/aws-cdk/commit/6d9a0f1ea0c05e7902ccca4d0fc4040e688846e5)) +* **aws-ecs:** update desired count to be optional ([#12223](https://github.com/aws/aws-cdk/issues/12223)) ([455540b](https://github.com/aws/aws-cdk/commit/455540b0915742c1612e924fc2d7c0987b1bc592)) +* **cfn-include:** cfn-include fails in monocdk ([#11595](https://github.com/aws/aws-cdk/issues/11595)) ([45e43f2](https://github.com/aws/aws-cdk/commit/45e43f28f5d175bba654ee44d683aa3fc1854f9a)), closes [#11342](https://github.com/aws/aws-cdk/issues/11342) +* **cli:** CLI doesn't read context from ~/.cdk.json ([#12394](https://github.com/aws/aws-cdk/issues/12394)) ([2389a9b](https://github.com/aws/aws-cdk/commit/2389a9b5742583f1d58c66a4f513ee4d833baab5)), closes [#10823](https://github.com/aws/aws-cdk/issues/10823) [#4802](https://github.com/aws/aws-cdk/issues/4802) +* **cli:** cross account asset upload no longer works ([#12155](https://github.com/aws/aws-cdk/issues/12155)) ([1c8cb11](https://github.com/aws/aws-cdk/commit/1c8cb11961c53fad499668aa39600f2038dce9d7)) +* **cli:** cross-account deployment no longer works ([#11966](https://github.com/aws/aws-cdk/issues/11966)) ([6fb3448](https://github.com/aws/aws-cdk/commit/6fb34483432b5cdcc485bbf6bfdb7bbb74f4b895)), closes [#11350](https://github.com/aws/aws-cdk/issues/11350) [#11792](https://github.com/aws/aws-cdk/issues/11792) [#11792](https://github.com/aws/aws-cdk/issues/11792) +* **cloudfront:** cross-region EdgeFunction does not work within a Stage ([#12103](https://github.com/aws/aws-cdk/issues/12103)) ([98d781c](https://github.com/aws/aws-cdk/commit/98d781cf9bc39d4c57454c4c60390c699326e84d)), closes [#12092](https://github.com/aws/aws-cdk/issues/12092) +* **cloudfront:** EdgeFunction fails with newStyleStackSynthesis ([#12356](https://github.com/aws/aws-cdk/issues/12356)) ([fb02736](https://github.com/aws/aws-cdk/commit/fb02736e7fb471b8ebd0d80e352f68f3cbf5270e)), closes [#12172](https://github.com/aws/aws-cdk/issues/12172) +* **codebuild:** missing permissions for SecretsManager environment variables ([#12121](https://github.com/aws/aws-cdk/issues/12121)) ([1a13d8f](https://github.com/aws/aws-cdk/commit/1a13d8fbb3ea4edd4ff8fb0a2608547f63b902f9)) +* **codebuild:** Project lacks permissions to its log destinations ([#12213](https://github.com/aws/aws-cdk/issues/12213)) ([b92ed51](https://github.com/aws/aws-cdk/commit/b92ed51c6ff11f8453755b6381a3cf1f12b0fcc1)), closes [#11444](https://github.com/aws/aws-cdk/issues/11444) [#12179](https://github.com/aws/aws-cdk/issues/12179) +* **codepipeline-actions:** use codebuild batch iam permissions when `executeBatchBuild: true` ([#12181](https://github.com/aws/aws-cdk/issues/12181)) ([5279f37](https://github.com/aws/aws-cdk/commit/5279f37288283a37c952440a7f2082517c56af3a)) +* **core:** capturing stack traces still takes a long time ([#12180](https://github.com/aws/aws-cdk/issues/12180)) ([71cd38c](https://github.com/aws/aws-cdk/commit/71cd38c8fac276e34b79ad416305b214a57af25a)), closes [#11170](https://github.com/aws/aws-cdk/issues/11170) +* **core:** DefaultStackSynthesizer bucket prefix missing for template assets ([#11855](https://github.com/aws/aws-cdk/issues/11855)) ([50a3d3a](https://github.com/aws/aws-cdk/commit/50a3d3acf3e413d9b4e51197d2be4ea1349c0955)), closes [#10710](https://github.com/aws/aws-cdk/issues/10710) [#11327](https://github.com/aws/aws-cdk/issues/11327) +* **dynamodb:** allow global replicas with Provisioned billing mode ([#12159](https://github.com/aws/aws-cdk/issues/12159)) ([ab5a383](https://github.com/aws/aws-cdk/commit/ab5a38379999bb57f28bbf22ec09d315df6b358a)), closes [#11346](https://github.com/aws/aws-cdk/issues/11346) +* **dynamodb:** missing grantRead for ConditionCheckItem ([#12313](https://github.com/aws/aws-cdk/issues/12313)) ([e157007](https://github.com/aws/aws-cdk/commit/e1570072440b07b6b82219c1a4371386c541fb1c)) +* **ec2:** 'encoded list token' error using Vpc imported from deploy-time lists ([#12040](https://github.com/aws/aws-cdk/issues/12040)) ([0690da9](https://github.com/aws/aws-cdk/commit/0690da925144c821a73bfab4ae8d678a8c074357)) +* **ec2:** fromInterfaceVpcEndpointAttributes: Security Groups should not be required ([#11857](https://github.com/aws/aws-cdk/issues/11857)) ([86ae5d6](https://github.com/aws/aws-cdk/commit/86ae5d6ec5291f7a8da37bbf021c31f88e66d283)), closes [#11050](https://github.com/aws/aws-cdk/issues/11050) +* **ec2:** interface endpoint AZ lookup does not guard against broken situations ([#12033](https://github.com/aws/aws-cdk/issues/12033)) ([80f0bfd](https://github.com/aws/aws-cdk/commit/80f0bfd167430a015e71b00506e0ecc280068e86)) +* **ec2:** Vpc.fromVpcAttributes cannot be used with EKS ([#12569](https://github.com/aws/aws-cdk/issues/12569)) ([1cdc244](https://github.com/aws/aws-cdk/commit/1cdc244e940396c962147d4e3ada4a0722923321)), closes [#12040](https://github.com/aws/aws-cdk/issues/12040) [#12160](https://github.com/aws/aws-cdk/issues/12160) +* **eks:** aws-node-termination-handler incorrectly deployed to on-demand instances as well ([#12369](https://github.com/aws/aws-cdk/issues/12369)) ([05c0b5f](https://github.com/aws/aws-cdk/commit/05c0b5f5a31c3fe89c47c6db8d9051f7165641a9)), closes [#12368](https://github.com/aws/aws-cdk/issues/12368) +* **eks:** failure to deploy cluster since aws-auth configmap exists ([#12068](https://github.com/aws/aws-cdk/issues/12068)) ([dc8a98a](https://github.com/aws/aws-cdk/commit/dc8a98a5436a7a2347fa9676d84f73a8cf00cd49)), closes [#12053](https://github.com/aws/aws-cdk/issues/12053) +* **eks:** k8s resources accidentally deleted due to logical ID change ([#12053](https://github.com/aws/aws-cdk/issues/12053)) ([019852e](https://github.com/aws/aws-cdk/commit/019852e4834327d848c9fe8dc271f1d4d5117fb8)), closes [#10397](https://github.com/aws/aws-cdk/issues/10397) [#10397](https://github.com/aws/aws-cdk/issues/10397) +* **eks:** nodegroup synthesis fails when configured with an AMI type that is not compatible to the default instance type ([#12441](https://github.com/aws/aws-cdk/issues/12441)) ([5f6f0f9](https://github.com/aws/aws-cdk/commit/5f6f0f9d46dbd460ac03dd5f9f4874eaa41611d8)), closes [40aws-cdk/aws-eks/lib/managed-nodegroup.ts#L294](https://github.com/40aws-cdk/aws-eks/lib/managed-nodegroup.ts/issues/L294) [40aws-cdk/aws-eks/lib/managed-nodegroup.ts#L302-L304](https://github.com/40aws-cdk/aws-eks/lib/managed-nodegroup.ts/issues/L302-L304) [40aws-cdk/aws-eks/lib/managed-nodegroup.ts#L329-L330](https://github.com/40aws-cdk/aws-eks/lib/managed-nodegroup.ts/issues/L329-L330) [40aws-cdk/aws-eks/lib/managed-nodegroup.ts#L324-L325](https://github.com/40aws-cdk/aws-eks/lib/managed-nodegroup.ts/issues/L324-L325) +* **eks:** Self managed nodes cannot be added to LoadBalancers created via the `LoadBalancer` service type ([#12269](https://github.com/aws/aws-cdk/issues/12269)) ([470a881](https://github.com/aws/aws-cdk/commit/470a8811ec18c7f0764018398ec7c3da05b7baac)) +* **elasticsearch:** Defining 2 domains with logging enabled in the same stack fails on construct id conflict ([#12055](https://github.com/aws/aws-cdk/issues/12055)) ([ec3ce19](https://github.com/aws/aws-cdk/commit/ec3ce19bc8203703cb1abcecdb2afc674c2013f6)), closes [#12017](https://github.com/aws/aws-cdk/issues/12017) +* **elasticsearch:** domain configured with access policies and a custom kms key fails to deploy ([#11699](https://github.com/aws/aws-cdk/issues/11699)) ([245ee6a](https://github.com/aws/aws-cdk/commit/245ee6a1253eeaa79177e960c164bf3a409d2e57)) +* **elasticsearch:** domain fails due to log publishing keys on unsupported cluster versions ([#11622](https://github.com/aws/aws-cdk/issues/11622)) ([e6bb96f](https://github.com/aws/aws-cdk/commit/e6bb96ff6bae96e3167c82f6de97807217ddb3be)) +* **elasticsearch:** log policies are overwritten when creating 2 domains which also results in a failure while destroying the stack ([#12056](https://github.com/aws/aws-cdk/issues/12056)) ([889d089](https://github.com/aws/aws-cdk/commit/889d0892bae10243e03900f0ae6db078fc7eb320)), closes [#12016](https://github.com/aws/aws-cdk/issues/12016) +* **elbv2:** can't import two application listeners into the same scope ([#12373](https://github.com/aws/aws-cdk/issues/12373)) ([6534dcf](https://github.com/aws/aws-cdk/commit/6534dcf3e04a55f5c6d28203192cbbddb5d119e6)), closes [#12132](https://github.com/aws/aws-cdk/issues/12132) +* **iam:** Groups are erroneously accepted as the Principal of a policy ([#11479](https://github.com/aws/aws-cdk/issues/11479)) ([#12549](https://github.com/aws/aws-cdk/issues/12549)) ([c9b0859](https://github.com/aws/aws-cdk/commit/c9b085996319e8d4d7d2db19184fb2f2148889a3)) +* **lambda:** make the Version hash calculation stable ([#12364](https://github.com/aws/aws-cdk/issues/12364)) ([4da50e5](https://github.com/aws/aws-cdk/commit/4da50e5bd9845d6e32687b147b6212decb422301)) +* **lambda-layer-*:** unable to calculate layer asset hash due to missing file ([#12293](https://github.com/aws/aws-cdk/issues/12293)) ([646f098](https://github.com/aws/aws-cdk/commit/646f0983143c77c2b6c68598a0bc8b290b5f6184)), closes [#12291](https://github.com/aws/aws-cdk/issues/12291) +* **lambda-nodejs:** local bundling fails with relative depsLockFilePath ([#12125](https://github.com/aws/aws-cdk/issues/12125)) ([d5afb55](https://github.com/aws/aws-cdk/commit/d5afb555b983c8c034f63dd58d1fa24b82b6e9fe)), closes [#12115](https://github.com/aws/aws-cdk/issues/12115) +* **logs:** custom resource Lambda uses old NodeJS version ([#12228](https://github.com/aws/aws-cdk/issues/12228)) ([29c4943](https://github.com/aws/aws-cdk/commit/29c4943466f4a911f65a2a13cf9e776ade9b8dfe)) +* **rds:** add the dependency on proxy targets to ensure dbInstance ([#12237](https://github.com/aws/aws-cdk/issues/12237)) ([8f74169](https://github.com/aws/aws-cdk/commit/8f74169f57f3be745cf6395149e2697d6dc497ee)), closes [#11311](https://github.com/aws/aws-cdk/issues/11311) +* **s3:** Bucket.grantWrite() no longer adds s3:PutObject* permission ([#12391](https://github.com/aws/aws-cdk/issues/12391)) ([cd437cf](https://github.com/aws/aws-cdk/commit/cd437cf630266086a3ddf9e326f215b5d1acdfd7)) +* **s3-deployment:** stop using deprecated API's that will cause breakage post 01/31/21 ([#12491](https://github.com/aws/aws-cdk/issues/12491)) ([f50f928](https://github.com/aws/aws-cdk/commit/f50f92880bbc219c331c858eaace712e0757507d)) +* **sns:** require topic name for fifo topic [#12386](https://github.com/aws/aws-cdk/issues/12386) ([#12437](https://github.com/aws/aws-cdk/issues/12437)) ([37d8ccc](https://github.com/aws/aws-cdk/commit/37d8ccc763f532999bc9f114264f3d29725b0f28)) +* **stepfunctions-tasks:** EvaluateExpression does not support JSON paths with dash ([#12248](https://github.com/aws/aws-cdk/issues/12248)) ([da1ed08](https://github.com/aws/aws-cdk/commit/da1ed08a6a2de584f5ddf43dab4efbb530541419)), closes [#12221](https://github.com/aws/aws-cdk/issues/12221) +* **stepfunctions-tasks:** policies created for EMR tasks have ARNs that are not partition-aware ([#11553](https://github.com/aws/aws-cdk/issues/11553)) ([1cf6713](https://github.com/aws/aws-cdk/commit/1cf6713b778c789af7a420ad890910a9516473f0)), closes [#11503](https://github.com/aws/aws-cdk/issues/11503) + + +* **apigatewayv2:** apiEndpoint is elevated to the IHttpApi interface ([#11988](https://github.com/aws/aws-cdk/issues/11988)) ([bc5b9b6](https://github.com/aws/aws-cdk/commit/bc5b9b659444bfbef9cfc3c8666fce7e6f45465a)) +* **eks:** Remove legacy and deprecated code ([#12189](https://github.com/aws/aws-cdk/issues/12189)) ([6a20e61](https://github.com/aws/aws-cdk/commit/6a20e61dd2ed8366cbff1451c943a02b79380de2)) + +## 2.0.0-alpha.0 (2020-12-11) + +This is the first alpha release of CDK 2.0. 🎉 diff --git a/package.json b/package.json index f82766ba1d48f..bbc2412e35c21 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "include": "dependencies/node-version" }, "scripts": { - "pkglint": "lerna --scope pkglint run build && lerna run pkglint", + "pkglint": "lerna run build --scope pkglint --include-dependencies && lerna run pkglint", "build": "./build.sh", "pack": "./pack.sh", "compat": "./scripts/check-api-compatibility.sh", diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/environment.ts b/packages/@aws-cdk-containers/ecs-service-extensions/lib/environment.ts index d83c286f0cdd6..68d4671a83432 100644 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/environment.ts +++ b/packages/@aws-cdk-containers/ecs-service-extensions/lib/environment.ts @@ -1,12 +1,8 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as ecs from '@aws-cdk/aws-ecs'; -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { EnvironmentCapacityType } from './extensions/extension-interfaces'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - /** * Settings for the environment you want to deploy. * services within. @@ -96,7 +92,7 @@ export class Environment extends Construct implements IEnvironment { */ public readonly capacityType: EnvironmentCapacityType; - private readonly scope: cdk.Construct; + private readonly scope: Construct; constructor(scope: Construct, id: string, props?: EnvironmentProps) { super(scope, id); diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/appmesh.ts b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/appmesh.ts index 95220dc1ea3b4..2739b3574a0bc 100644 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/appmesh.ts +++ b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/appmesh.ts @@ -5,14 +5,11 @@ import * as ecs from '@aws-cdk/aws-ecs'; import * as iam from '@aws-cdk/aws-iam'; import * as cdk from '@aws-cdk/core'; import * as regionInfo from '@aws-cdk/region-info'; +import { Construct } from 'constructs'; import { Service } from '../service'; import { Container } from './container'; import { ServiceExtension, ServiceBuild } from './extension-interfaces'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - // The version of the App Mesh envoy sidecar to add to the task. const APP_MESH_ENVOY_SIDECAR_VERSION = 'v1.15.1.0-prod'; diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/assign-public-ip.ts b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/assign-public-ip.ts index 3c019d44867b4..b7501385373b6 100644 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/assign-public-ip.ts +++ b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/assign-public-ip.ts @@ -1,15 +1,12 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as ecs from '@aws-cdk/aws-ecs'; import * as route53 from '@aws-cdk/aws-route53'; +import { Construct } from 'constructs'; import { Service } from '../../service'; import { Container } from '../container'; import { ServiceExtension, ServiceBuild, EnvironmentCapacityType } from '../extension-interfaces'; import { TaskRecordManager } from './task-record-manager'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - export interface AssignPublicIpExtensionOptions { /** * Enable publishing task public IPs to a recordset in a Route 53 hosted zone. diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/task-record-manager.ts b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/task-record-manager.ts index 67db42400ee5b..dd0bd0718d2e9 100644 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/task-record-manager.ts +++ b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/assign-public-ip/task-record-manager.ts @@ -10,10 +10,7 @@ import * as route53 from '@aws-cdk/aws-route53'; import * as sqs from '@aws-cdk/aws-sqs'; import * as cdk from '@aws-cdk/core'; import * as customresources from '@aws-cdk/custom-resources'; - -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; export interface TaskRecordManagerProps { service: ecs.Ec2Service | ecs.FargateService; diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/cloudwatch-agent.ts b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/cloudwatch-agent.ts index ceed938e995cb..b4bbd4286ae9f 100644 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/cloudwatch-agent.ts +++ b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/cloudwatch-agent.ts @@ -1,12 +1,9 @@ import * as ecs from '@aws-cdk/aws-ecs'; import * as iam from '@aws-cdk/aws-iam'; +import { Construct } from 'constructs'; import { Service } from '../service'; import { ServiceExtension } from './extension-interfaces'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - const CLOUDWATCH_AGENT_IMAGE = 'amazon/cloudwatch-agent:latest'; /** diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/container.ts b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/container.ts index 1bbc61ff4f8f7..0635c24c6f759 100644 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/container.ts +++ b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/container.ts @@ -1,11 +1,8 @@ import * as ecs from '@aws-cdk/aws-ecs'; +import { Construct } from 'constructs'; import { Service } from '../service'; import { ServiceExtension } from './extension-interfaces'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - /** * Setting for the main application container of a service */ diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/extension-interfaces.ts b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/extension-interfaces.ts index fa0d42602c563..14bf499d13ce5 100644 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/extension-interfaces.ts +++ b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/extension-interfaces.ts @@ -1,11 +1,8 @@ import * as ecs from '@aws-cdk/aws-ecs'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Service } from '../service'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - /** * A list of the capacity types that are supported. These * capacity types may change the behavior of an extension. @@ -109,7 +106,7 @@ export abstract class ServiceExtension { * the extension is told what Service it is now working on. */ protected parentService!: Service; - protected scope!: cdk.Construct; + protected scope!: Construct; // A list of other extensions which want to mutate the // container definition for this extension. diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/firelens.ts b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/firelens.ts index 1dfc8e1f1b0b0..bb11e3df49a4f 100644 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/firelens.ts +++ b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/firelens.ts @@ -1,14 +1,11 @@ import * as ecs from '@aws-cdk/aws-ecs'; import * as awslogs from '@aws-cdk/aws-logs'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Service } from '../service'; import { Container } from './container'; import { ContainerMutatingHook, ServiceExtension } from './extension-interfaces'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - /** * Settings for the hook which mutates the application container * to route logs through FireLens diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/http-load-balancer.ts b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/http-load-balancer.ts index 884477b4d38db..af54a305cc699 100644 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/http-load-balancer.ts +++ b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/http-load-balancer.ts @@ -1,13 +1,10 @@ import * as ecs from '@aws-cdk/aws-ecs'; import * as alb from '@aws-cdk/aws-elasticloadbalancingv2'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Service } from '../service'; import { ServiceExtension, ServiceBuild } from './extension-interfaces'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - /** * This extension add a public facing load balancer for sending traffic * to one or more replicas of the application container diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/xray.ts b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/xray.ts index 5e9affe0ffa3a..652d6a5dd8b7d 100644 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/xray.ts +++ b/packages/@aws-cdk-containers/ecs-service-extensions/lib/extensions/xray.ts @@ -1,13 +1,10 @@ import * as ecs from '@aws-cdk/aws-ecs'; import * as iam from '@aws-cdk/aws-iam'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Service } from '../service'; import { ServiceExtension } from './extension-interfaces'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - const XRAY_DAEMON_IMAGE = 'amazon/aws-xray-daemon:latest'; /** diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/lib/service.ts b/packages/@aws-cdk-containers/ecs-service-extensions/lib/service.ts index c988c0592b6bf..63af3d586e34a 100644 --- a/packages/@aws-cdk-containers/ecs-service-extensions/lib/service.ts +++ b/packages/@aws-cdk-containers/ecs-service-extensions/lib/service.ts @@ -1,14 +1,10 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as ecs from '@aws-cdk/aws-ecs'; -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { IEnvironment } from './environment'; import { EnvironmentCapacityType, ServiceBuild } from './extensions/extension-interfaces'; import { ServiceDescription } from './service-description'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - /** * The settings for an ECS Service */ @@ -76,7 +72,7 @@ export class Service extends Construct { */ private urls: Record = {}; - private readonly scope: cdk.Construct; + private readonly scope: Construct; constructor(scope: Construct, id: string, props: ServiceProps) { super(scope, id); diff --git a/packages/@aws-cdk-containers/ecs-service-extensions/package.json b/packages/@aws-cdk-containers/ecs-service-extensions/package.json index 05781b7cc3750..69102e2603562 100644 --- a/packages/@aws-cdk-containers/ecs-service-extensions/package.json +++ b/packages/@aws-cdk-containers/ecs-service-extensions/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk-containers/ecs-service-extensions", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library that helps you build ECS services using simple extensions", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -66,7 +67,7 @@ "@aws-cdk/core": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -91,7 +92,7 @@ "@aws-cdk/core": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/alexa-ask/package.json b/packages/@aws-cdk/alexa-ask/package.json index 48b5fa2b1e003..8fb1adcf0f10b 100644 --- a/packages/@aws-cdk/alexa-ask/package.json +++ b/packages/@aws-cdk/alexa-ask/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/alexa-ask", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for Alexa::ASK", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,11 +80,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/app-delivery/lib/pipeline-deploy-stack-action.ts b/packages/@aws-cdk/app-delivery/lib/pipeline-deploy-stack-action.ts index cd7f97e6629a1..047c006e5dff1 100644 --- a/packages/@aws-cdk/app-delivery/lib/pipeline-deploy-stack-action.ts +++ b/packages/@aws-cdk/app-delivery/lib/pipeline-deploy-stack-action.ts @@ -5,10 +5,7 @@ import * as events from '@aws-cdk/aws-events'; import * as iam from '@aws-cdk/aws-iam'; import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import * as cdk from '@aws-cdk/core'; - -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; export interface PipelineDeployStackActionProps { /** diff --git a/packages/@aws-cdk/app-delivery/package.json b/packages/@aws-cdk/app-delivery/package.json index de59545369bfd..aee0601425a8e 100644 --- a/packages/@aws-cdk/app-delivery/package.json +++ b/packages/@aws-cdk/app-delivery/package.json @@ -2,6 +2,7 @@ "name": "@aws-cdk/app-delivery", "description": "Continuous Integration / Continuous Delivery for CDK Applications", "deprecated": "Use the @aws-cdk/pipelines module instead", + "private": true, "version": "0.0.0", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -55,7 +56,7 @@ "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "devDependencies": { "@aws-cdk/assert": "0.0.0", @@ -93,7 +94,7 @@ "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/assert/lib/synth-utils.ts b/packages/@aws-cdk/assert/lib/synth-utils.ts index bb8d9a437afd9..3cd69d0889aee 100644 --- a/packages/@aws-cdk/assert/lib/synth-utils.ts +++ b/packages/@aws-cdk/assert/lib/synth-utils.ts @@ -7,7 +7,7 @@ export class SynthUtils { /** * Returns the cloud assembly template artifact for a stack. */ - public static synthesize(stack: core.Stack, options: core.SynthesisOptions = { }): cxapi.CloudFormationStackArtifact { + public static synthesize(stack: core.Stack, options: core.StageSynthesisOptions = { }): cxapi.CloudFormationStackArtifact { // always synthesize against the root (be it an App or whatever) so all artifacts will be included const assembly = synthesizeApp(stack, options); return assembly.getStackArtifact(stack.artifactId); @@ -16,7 +16,7 @@ export class SynthUtils { /** * Synthesizes the stack and returns the resulting CloudFormation template. */ - public static toCloudFormation(stack: core.Stack, options: core.SynthesisOptions = { }): any { + public static toCloudFormation(stack: core.Stack, options: core.StageSynthesisOptions = { }): any { const synth = this._synthesizeWithNested(stack, options); if (synth instanceof cxapi.CloudFormationStackArtifact) { return synth.template; @@ -48,7 +48,7 @@ export class SynthUtils { * @return CloudFormationStackArtifact for normal stacks or the actual template for nested stacks * @internal */ - public static _synthesizeWithNested(stack: core.Stack, options: core.SynthesisOptions = { }): cxapi.CloudFormationStackArtifact | object { + public static _synthesizeWithNested(stack: core.Stack, options: core.StageSynthesisOptions = { }): cxapi.CloudFormationStackArtifact | object { // always synthesize against the root (be it an App or whatever) so all artifacts will be included const assembly = synthesizeApp(stack, options); @@ -64,7 +64,7 @@ export class SynthUtils { /** * Synthesizes the app in which a stack resides and returns the cloud assembly object. */ -function synthesizeApp(stack: core.Stack, options: core.SynthesisOptions) { +function synthesizeApp(stack: core.Stack, options: core.StageSynthesisOptions) { const root = stack.node.root; if (!core.Stage.isStage(root)) { throw new Error('unexpected: all stacks must be part of a Stage or an App'); diff --git a/packages/@aws-cdk/assert/package.json b/packages/@aws-cdk/assert/package.json index 50b7b2a9becba..c8816ac8f72eb 100644 --- a/packages/@aws-cdk/assert/package.json +++ b/packages/@aws-cdk/assert/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/assert", "version": "0.0.0", + "private": true, "description": "An assertion library for use with CDK Apps", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -32,11 +33,11 @@ "@aws-cdk/cloudformation-diff": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0", + "constructs": "10.0.0-pre.5", "jest": "^26.6.3" }, "repository": { diff --git a/packages/@aws-cdk/assets/lib/staging.ts b/packages/@aws-cdk/assets/lib/staging.ts index fe573ce442fdc..1781ba6ccd808 100644 --- a/packages/@aws-cdk/assets/lib/staging.ts +++ b/packages/@aws-cdk/assets/lib/staging.ts @@ -4,7 +4,7 @@ import { FingerprintOptions } from './fs/options'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Deprecated diff --git a/packages/@aws-cdk/assets/package.json b/packages/@aws-cdk/assets/package.json index b19a88d4a9c12..8e19136fa602c 100644 --- a/packages/@aws-cdk/assets/package.json +++ b/packages/@aws-cdk/assets/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/assets", "version": "0.0.0", + "private": true, "description": "This module is deprecated. All types are now available under the core module", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,13 +82,13 @@ "dependencies": { "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-accessanalyzer/package.json b/packages/@aws-cdk/aws-accessanalyzer/package.json index 85c2a0d682662..3b919bee0f135 100644 --- a/packages/@aws-cdk/aws-accessanalyzer/package.json +++ b/packages/@aws-cdk/aws-accessanalyzer/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-accessanalyzer", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::AccessAnalyzer", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,11 +81,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-acmpca/package.json b/packages/@aws-cdk/aws-acmpca/package.json index e0956bffbf2c6..02358c31d51d2 100644 --- a/packages/@aws-cdk/aws-acmpca/package.json +++ b/packages/@aws-cdk/aws-acmpca/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-acmpca", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::ACMPCA", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,11 +81,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-amazonmq/package.json b/packages/@aws-cdk/aws-amazonmq/package.json index c9d6412f5effa..38ce5954b248a 100644 --- a/packages/@aws-cdk/aws-amazonmq/package.json +++ b/packages/@aws-cdk/aws-amazonmq/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-amazonmq", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::AmazonMQ", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,11 +80,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-amplify/lib/basic-auth.ts b/packages/@aws-cdk/aws-amplify/lib/basic-auth.ts index e3ac7c0967aa6..afbe6dd2072fe 100644 --- a/packages/@aws-cdk/aws-amplify/lib/basic-auth.ts +++ b/packages/@aws-cdk/aws-amplify/lib/basic-auth.ts @@ -1,10 +1,7 @@ import * as kms from '@aws-cdk/aws-kms'; import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; import { SecretValue } from '@aws-cdk/core'; - -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Properties for a BasicAuth @@ -82,7 +79,7 @@ export class BasicAuth { /** * Binds this Basic Auth configuration to an App */ - public bind(scope: CoreConstruct, id: string): BasicAuthConfig { + public bind(scope: Construct, id: string): BasicAuthConfig { const config = { enableBasicAuth: true, username: this.props.username, diff --git a/packages/@aws-cdk/aws-amplify/lib/domain.ts b/packages/@aws-cdk/aws-amplify/lib/domain.ts index f8683f44b123d..ed2b16668eb11 100644 --- a/packages/@aws-cdk/aws-amplify/lib/domain.ts +++ b/packages/@aws-cdk/aws-amplify/lib/domain.ts @@ -140,6 +140,8 @@ export class Domain extends Resource { this.domainAutoSubDomainCreationPatterns = domain.attrAutoSubDomainCreationPatterns; this.domainAutoSubDomainIamRole = domain.attrAutoSubDomainIamRole; this.domainEnableAutoSubDomain = domain.attrEnableAutoSubDomain; + + this.node.addValidation({ validate: () => this.validateDomain() }); } /** @@ -160,7 +162,7 @@ export class Domain extends Resource { return this.mapSubDomain(branch, ''); } - protected validate() { + private validateDomain() { if (this.subDomains.length === 0) { return ['The domain doesn\'t contain any subdomains']; } diff --git a/packages/@aws-cdk/aws-amplify/package.json b/packages/@aws-cdk/aws-amplify/package.json index ea1abbde2ba37..96515dcf8a4ef 100644 --- a/packages/@aws-cdk/aws-amplify/package.json +++ b/packages/@aws-cdk/aws-amplify/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-amplify", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::Amplify", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -86,7 +87,7 @@ "@aws-cdk/aws-codecommit": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/aws-iam": "0.0.0", @@ -95,7 +96,7 @@ "@aws-cdk/aws-codecommit": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-apigateway/lib/api-definition.ts b/packages/@aws-cdk/aws-apigateway/lib/api-definition.ts index 01be9ebd17c59..7efbe5440779f 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/api-definition.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/api-definition.ts @@ -1,9 +1,6 @@ import * as s3 from '@aws-cdk/aws-s3'; import * as s3_assets from '@aws-cdk/aws-s3-assets'; - -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Represents an OpenAPI definition asset. diff --git a/packages/@aws-cdk/aws-apigateway/lib/apigatewayv2.ts b/packages/@aws-cdk/aws-apigateway/lib/apigatewayv2.ts index 98ee1ba04acbf..df8213aa37c10 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/apigatewayv2.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/apigatewayv2.ts @@ -4,10 +4,7 @@ /* eslint-disable max-len */ import * as cdk from '@aws-cdk/core'; - -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Properties for defining a `AWS::ApiGatewayV2::Api` diff --git a/packages/@aws-cdk/aws-apigateway/lib/deployment.ts b/packages/@aws-cdk/aws-apigateway/lib/deployment.ts index d44b2ab223f4a..f62a58f4f59be 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/deployment.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/deployment.ts @@ -5,10 +5,6 @@ import { CfnDeployment } from './apigateway.generated'; import { Method } from './method'; import { IRestApi, RestApi, SpecRestApi, RestApiBase } from './restapi'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct as CoreConstruct } from '@aws-cdk/core'; - export interface DeploymentProps { /** * The Rest API to deploy. @@ -137,7 +133,7 @@ class LatestDeploymentResource extends CfnDeployment { private readonly originalLogicalId: string; private readonly api: IRestApi; - constructor(scope: CoreConstruct, id: string, props: LatestDeploymentResourceProps) { + constructor(scope: Construct, id: string, props: LatestDeploymentResourceProps) { super(scope, id, { description: props.description, restApiId: props.restApi.restApiId, diff --git a/packages/@aws-cdk/aws-apigateway/lib/integrations/aws.ts b/packages/@aws-cdk/aws-apigateway/lib/integrations/aws.ts index 0e607e25a21cf..2aefa7f5d3a78 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/integrations/aws.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/integrations/aws.ts @@ -1,4 +1,5 @@ import * as cdk from '@aws-cdk/core'; +import { IConstruct } from 'constructs'; import { Integration, IntegrationConfig, IntegrationOptions, IntegrationType } from '../integration'; import { Method } from '../method'; import { parseAwsApiCall } from '../util'; @@ -76,7 +77,7 @@ export interface AwsIntegrationProps { * technology. */ export class AwsIntegration extends Integration { - private scope?: cdk.IConstruct; + private scope?: IConstruct; constructor(props: AwsIntegrationProps) { const backend = props.subdomain ? `${props.subdomain}.${props.service}` : props.service; diff --git a/packages/@aws-cdk/aws-apigateway/lib/restapi.ts b/packages/@aws-cdk/aws-apigateway/lib/restapi.ts index 1afd9f7e9d090..f67096ac2bf53 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/restapi.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/restapi.ts @@ -738,6 +738,8 @@ export class RestApi extends RestApiBase { this.root = new RootResource(this, props, resource.attrRootResourceId); this.restApiRootResourceId = resource.attrRootResourceId; + + this.node.addValidation({ validate: () => this.validateRestApi() }); } /** @@ -803,7 +805,7 @@ export class RestApi extends RestApiBase { /** * Performs validation of the REST API. */ - protected validate() { + private validateRestApi() { if (this.methods.length === 0) { return ["The REST API doesn't contain any methods"]; } diff --git a/packages/@aws-cdk/aws-apigateway/lib/vpc-link.ts b/packages/@aws-cdk/aws-apigateway/lib/vpc-link.ts index f7d137f2c9e1a..06a168d31e557 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/vpc-link.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/vpc-link.ts @@ -80,6 +80,8 @@ export class VpcLink extends Resource implements IVpcLink { if (props.targets) { this.addTargets(...props.targets); } + + this.node.addValidation({ validate: () => this.validateVpcLink() }); } public addTargets(...targets: elbv2.INetworkLoadBalancer[]) { @@ -94,7 +96,7 @@ export class VpcLink extends Resource implements IVpcLink { return this._targets.map(t => t.loadBalancerDnsName); } - protected validate(): string[] { + private validateVpcLink(): string[] { if (this._targets.length === 0) { return ['No targets added to vpc link']; } diff --git a/packages/@aws-cdk/aws-apigateway/package.json b/packages/@aws-cdk/aws-apigateway/package.json index 7465b7d45a6bd..af344178e434a 100644 --- a/packages/@aws-cdk/aws-apigateway/package.json +++ b/packages/@aws-cdk/aws-apigateway/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-apigateway", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::ApiGateway", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -90,7 +91,7 @@ "@aws-cdk/aws-s3-assets": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -106,7 +107,7 @@ "@aws-cdk/aws-s3-assets": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-apigatewayv2-authorizers/package.json b/packages/@aws-cdk/aws-apigatewayv2-authorizers/package.json index f21b19c75f329..de4c9c6939b6b 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-authorizers/package.json +++ b/packages/@aws-cdk/aws-apigatewayv2-authorizers/package.json @@ -82,13 +82,13 @@ "@aws-cdk/aws-apigatewayv2": "0.0.0", "@aws-cdk/aws-cognito": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/aws-apigatewayv2": "0.0.0", "@aws-cdk/aws-cognito": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" @@ -100,5 +100,6 @@ }, "publishConfig": { "tag": "latest" - } + }, + "private": true } diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations/package.json b/packages/@aws-cdk/aws-apigatewayv2-integrations/package.json index c4a3e3039b9a3..ffd58b53cdf0e 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-integrations/package.json +++ b/packages/@aws-cdk/aws-apigatewayv2-integrations/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-apigatewayv2-integrations", "version": "0.0.0", + "private": true, "description": "Integrations for AWS APIGateway V2", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -84,7 +85,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-servicediscovery": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/aws-apigatewayv2": "0.0.0", @@ -94,7 +95,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-servicediscovery": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-apigatewayv2/lib/http/integration.ts b/packages/@aws-cdk/aws-apigatewayv2/lib/http/integration.ts index 836b831550fb7..b374c092aab28 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/lib/http/integration.ts +++ b/packages/@aws-cdk/aws-apigatewayv2/lib/http/integration.ts @@ -5,10 +5,6 @@ import { IIntegration } from '../common'; import { IHttpApi } from './api'; import { HttpMethod, IHttpRoute } from './route'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Represents an Integration for an HTTP API. */ @@ -161,7 +157,7 @@ export interface HttpRouteIntegrationBindOptions { * If the `HttpRouteIntegration` being bound creates additional constructs, * this will be used as their parent scope. */ - readonly scope: CoreConstruct; + readonly scope: Construct; } /** diff --git a/packages/@aws-cdk/aws-apigatewayv2/lib/websocket/integration.ts b/packages/@aws-cdk/aws-apigatewayv2/lib/websocket/integration.ts index e75bd00b63d95..2a7a450d3ec79 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/lib/websocket/integration.ts +++ b/packages/@aws-cdk/aws-apigatewayv2/lib/websocket/integration.ts @@ -5,10 +5,6 @@ import { IIntegration } from '../common'; import { IWebSocketApi } from './api'; import { IWebSocketRoute } from './route'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Represents an Integration for an WebSocket API. */ @@ -81,7 +77,7 @@ export interface WebSocketRouteIntegrationBindOptions { * If the `WebSocketRouteIntegration` being bound creates additional constructs, * this will be used as their parent scope. */ - readonly scope: CoreConstruct; + readonly scope: Construct; } /** diff --git a/packages/@aws-cdk/aws-apigatewayv2/package.json b/packages/@aws-cdk/aws-apigatewayv2/package.json index b1dd874b85f9e..53c53decbcf09 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/package.json +++ b/packages/@aws-cdk/aws-apigatewayv2/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-apigatewayv2", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::APIGatewayv2", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -88,7 +89,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-cloudwatch": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/aws-ec2": "0.0.0", @@ -96,7 +97,7 @@ "@aws-cdk/aws-certificatemanager": "0.0.0", "@aws-cdk/aws-cloudwatch": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-appconfig/package.json b/packages/@aws-cdk/aws-appconfig/package.json index 0836a936f672c..2d077b6a06f6d 100644 --- a/packages/@aws-cdk/aws-appconfig/package.json +++ b/packages/@aws-cdk/aws-appconfig/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-appconfig", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::AppConfig", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,11 +81,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-appflow/package.json b/packages/@aws-cdk/aws-appflow/package.json index 6d047b697b394..697b83023f7d4 100644 --- a/packages/@aws-cdk/aws-appflow/package.json +++ b/packages/@aws-cdk/aws-appflow/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-appflow", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::AppFlow", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -76,10 +77,12 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-applicationautoscaling/lib/base-scalable-attribute.ts b/packages/@aws-cdk/aws-applicationautoscaling/lib/base-scalable-attribute.ts index 95d2a19c8a17d..2ea9dd3cae636 100644 --- a/packages/@aws-cdk/aws-applicationautoscaling/lib/base-scalable-attribute.ts +++ b/packages/@aws-cdk/aws-applicationautoscaling/lib/base-scalable-attribute.ts @@ -4,10 +4,6 @@ import { ScalableTarget, ScalingSchedule, ServiceNamespace } from './scalable-ta import { BasicStepScalingPolicyProps } from './step-scaling-policy'; import { BasicTargetTrackingScalingPolicyProps } from './target-tracking-scaling-policy'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Properties for a ScalableTableAttribute */ @@ -47,7 +43,7 @@ export interface BaseScalableAttributeProps extends EnableScalingProps { * - Don't expose all scaling methods (for example Dynamo tables don't support * Step Scaling, so the Dynamo subclass won't expose this method). */ -export abstract class BaseScalableAttribute extends CoreConstruct { +export abstract class BaseScalableAttribute extends Construct { private target: ScalableTarget; public constructor(scope: Construct, id: string, protected readonly props: BaseScalableAttributeProps) { diff --git a/packages/@aws-cdk/aws-applicationautoscaling/lib/step-scaling-action.ts b/packages/@aws-cdk/aws-applicationautoscaling/lib/step-scaling-action.ts index 67021e74f71bf..0ff9f200f263c 100644 --- a/packages/@aws-cdk/aws-applicationautoscaling/lib/step-scaling-action.ts +++ b/packages/@aws-cdk/aws-applicationautoscaling/lib/step-scaling-action.ts @@ -3,10 +3,6 @@ import { Construct } from 'constructs'; import { CfnScalingPolicy } from './applicationautoscaling.generated'; import { IScalableTarget } from './scalable-target'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Properties for a scaling policy */ @@ -71,7 +67,7 @@ export interface StepScalingActionProps { * * This Action must be used as the target of a CloudWatch alarm to take effect. */ -export class StepScalingAction extends CoreConstruct { +export class StepScalingAction extends Construct { /** * ARN of the scaling policy */ diff --git a/packages/@aws-cdk/aws-applicationautoscaling/lib/step-scaling-policy.ts b/packages/@aws-cdk/aws-applicationautoscaling/lib/step-scaling-policy.ts index 8b9f7b2644267..7a5082615abff 100644 --- a/packages/@aws-cdk/aws-applicationautoscaling/lib/step-scaling-policy.ts +++ b/packages/@aws-cdk/aws-applicationautoscaling/lib/step-scaling-policy.ts @@ -5,10 +5,6 @@ import { Construct } from 'constructs'; import { IScalableTarget } from './scalable-target'; import { AdjustmentType, MetricAggregationType, StepScalingAction } from './step-scaling-action'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct as CoreConstruct } from '@aws-cdk/core'; - export interface BasicStepScalingPolicyProps { /** * Metric to scale on. @@ -86,7 +82,7 @@ export interface StepScalingPolicyProps extends BasicStepScalingPolicyProps { * * Implemented using one or more CloudWatch alarms and Step Scaling Policies. */ -export class StepScalingPolicy extends CoreConstruct { +export class StepScalingPolicy extends Construct { public readonly lowerAlarm?: cloudwatch.Alarm; public readonly lowerAction?: StepScalingAction; public readonly upperAlarm?: cloudwatch.Alarm; @@ -233,7 +229,7 @@ class StepScalingAlarmAction implements cloudwatch.IAlarmAction { constructor(private readonly stepScalingAction: StepScalingAction) { } - public bind(_scope: CoreConstruct, _alarm: cloudwatch.IAlarm): cloudwatch.AlarmActionConfig { + public bind(_scope: Construct, _alarm: cloudwatch.IAlarm): cloudwatch.AlarmActionConfig { return { alarmActionArn: this.stepScalingAction.scalingPolicyArn }; } } diff --git a/packages/@aws-cdk/aws-applicationautoscaling/lib/target-tracking-scaling-policy.ts b/packages/@aws-cdk/aws-applicationautoscaling/lib/target-tracking-scaling-policy.ts index f7ccaff153ffe..e8b31472d22cd 100644 --- a/packages/@aws-cdk/aws-applicationautoscaling/lib/target-tracking-scaling-policy.ts +++ b/packages/@aws-cdk/aws-applicationautoscaling/lib/target-tracking-scaling-policy.ts @@ -4,10 +4,6 @@ import { Construct } from 'constructs'; import { CfnScalingPolicy } from './applicationautoscaling.generated'; import { IScalableTarget } from './scalable-target'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Base interface for target tracking props * @@ -119,7 +115,7 @@ export interface TargetTrackingScalingPolicyProps extends BasicTargetTrackingSca readonly scalingTarget: IScalableTarget; } -export class TargetTrackingScalingPolicy extends CoreConstruct { +export class TargetTrackingScalingPolicy extends Construct { /** * ARN of the scaling policy */ diff --git a/packages/@aws-cdk/aws-applicationautoscaling/package.json b/packages/@aws-cdk/aws-applicationautoscaling/package.json index e9566094b344a..7164ba45c0512 100644 --- a/packages/@aws-cdk/aws-applicationautoscaling/package.json +++ b/packages/@aws-cdk/aws-applicationautoscaling/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-applicationautoscaling", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::ApplicationAutoScaling", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -83,7 +84,7 @@ "@aws-cdk/aws-cloudwatch": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -91,7 +92,7 @@ "@aws-cdk/aws-cloudwatch": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-applicationinsights/package.json b/packages/@aws-cdk/aws-applicationinsights/package.json index edef6de6de7f0..39d55d9419a86 100644 --- a/packages/@aws-cdk/aws-applicationinsights/package.json +++ b/packages/@aws-cdk/aws-applicationinsights/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-applicationinsights", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::ApplicationInsights", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,10 +80,12 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-appmesh/lib/client-policy.ts b/packages/@aws-cdk/aws-appmesh/lib/client-policy.ts index 8f39b88399111..0f3f10c46932c 100644 --- a/packages/@aws-cdk/aws-appmesh/lib/client-policy.ts +++ b/packages/@aws-cdk/aws-appmesh/lib/client-policy.ts @@ -1,10 +1,7 @@ import * as acmpca from '@aws-cdk/aws-acmpca'; +import { Construct } from 'constructs'; import { CfnVirtualNode } from './appmesh.generated'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - enum CertificateType { ACMPCA = 'acm', FILE = 'file', diff --git a/packages/@aws-cdk/aws-appmesh/lib/gateway-route-spec.ts b/packages/@aws-cdk/aws-appmesh/lib/gateway-route-spec.ts index 0a90fb1632ff9..0812f635dfdd2 100644 --- a/packages/@aws-cdk/aws-appmesh/lib/gateway-route-spec.ts +++ b/packages/@aws-cdk/aws-appmesh/lib/gateway-route-spec.ts @@ -1,11 +1,8 @@ +import { Construct } from 'constructs'; import { CfnGatewayRoute } from './appmesh.generated'; import { Protocol } from './shared-interfaces'; import { IVirtualService } from './virtual-service'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - /** * The criterion for determining a request match for this GatewayRoute */ diff --git a/packages/@aws-cdk/aws-appmesh/lib/gateway-route.ts b/packages/@aws-cdk/aws-appmesh/lib/gateway-route.ts index 5bfb3b0ca21cd..d751a6c752e48 100644 --- a/packages/@aws-cdk/aws-appmesh/lib/gateway-route.ts +++ b/packages/@aws-cdk/aws-appmesh/lib/gateway-route.ts @@ -104,7 +104,7 @@ export class GatewayRoute extends cdk.Resource implements IGatewayRoute { constructor(scope: Construct, id: string, props: GatewayRouteProps) { super(scope, id, { - physicalName: props.gatewayRouteName || cdk.Lazy.stringValue({ produce: () => this.node.uniqueId }), + physicalName: props.gatewayRouteName || cdk.Lazy.string({ produce: () => cdk.Names.uniqueId(this) }), }); this.virtualGateway = props.virtualGateway; diff --git a/packages/@aws-cdk/aws-appmesh/lib/route-spec.ts b/packages/@aws-cdk/aws-appmesh/lib/route-spec.ts index add785c02c286..f3fc872bb6e41 100644 --- a/packages/@aws-cdk/aws-appmesh/lib/route-spec.ts +++ b/packages/@aws-cdk/aws-appmesh/lib/route-spec.ts @@ -1,12 +1,9 @@ import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnRoute } from './appmesh.generated'; import { Protocol, HttpTimeout, GrpcTimeout, TcpTimeout } from './shared-interfaces'; import { IVirtualNode } from './virtual-node'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - /** * Properties for the Weighted Targets in the route */ diff --git a/packages/@aws-cdk/aws-appmesh/lib/service-discovery.ts b/packages/@aws-cdk/aws-appmesh/lib/service-discovery.ts index 961357945a16b..5793bbf746eda 100644 --- a/packages/@aws-cdk/aws-appmesh/lib/service-discovery.ts +++ b/packages/@aws-cdk/aws-appmesh/lib/service-discovery.ts @@ -1,11 +1,7 @@ import * as cloudmap from '@aws-cdk/aws-servicediscovery'; +import { Construct } from 'constructs'; import { CfnVirtualNode } from './appmesh.generated'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - - /** * Represents the properties needed to define CloudMap Service Discovery */ diff --git a/packages/@aws-cdk/aws-appmesh/lib/shared-interfaces.ts b/packages/@aws-cdk/aws-appmesh/lib/shared-interfaces.ts index 007f67c4a7a9b..98caa8dcb8025 100644 --- a/packages/@aws-cdk/aws-appmesh/lib/shared-interfaces.ts +++ b/packages/@aws-cdk/aws-appmesh/lib/shared-interfaces.ts @@ -1,12 +1,9 @@ import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnVirtualGateway, CfnVirtualNode } from './appmesh.generated'; import { ClientPolicy } from './client-policy'; import { IVirtualService } from './virtual-service'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - /** * Represents timeouts for HTTP protocols. */ diff --git a/packages/@aws-cdk/aws-appmesh/lib/tls-certificate.ts b/packages/@aws-cdk/aws-appmesh/lib/tls-certificate.ts index ec227fb13df99..8fde7e8b7694f 100644 --- a/packages/@aws-cdk/aws-appmesh/lib/tls-certificate.ts +++ b/packages/@aws-cdk/aws-appmesh/lib/tls-certificate.ts @@ -1,10 +1,7 @@ import * as acm from '@aws-cdk/aws-certificatemanager'; +import { Construct } from 'constructs'; import { CfnVirtualNode } from './appmesh.generated'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - /** * Enum of supported TLS modes */ diff --git a/packages/@aws-cdk/aws-appmesh/lib/virtual-gateway-listener.ts b/packages/@aws-cdk/aws-appmesh/lib/virtual-gateway-listener.ts index 9f081ffdefd60..9428b2fd41748 100644 --- a/packages/@aws-cdk/aws-appmesh/lib/virtual-gateway-listener.ts +++ b/packages/@aws-cdk/aws-appmesh/lib/virtual-gateway-listener.ts @@ -1,13 +1,10 @@ import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnVirtualGateway } from './appmesh.generated'; import { validateHealthChecks } from './private/utils'; import { HealthCheck, Protocol } from './shared-interfaces'; import { TlsCertificate, TlsCertificateConfig } from './tls-certificate'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - /** * Represents the properties needed to define HTTP Listeners for a VirtualGateway */ diff --git a/packages/@aws-cdk/aws-appmesh/lib/virtual-gateway.ts b/packages/@aws-cdk/aws-appmesh/lib/virtual-gateway.ts index d2f0a873a0849..3b1df58a9360c 100644 --- a/packages/@aws-cdk/aws-appmesh/lib/virtual-gateway.ts +++ b/packages/@aws-cdk/aws-appmesh/lib/virtual-gateway.ts @@ -160,7 +160,7 @@ export class VirtualGateway extends VirtualGatewayBase { constructor(scope: Construct, id: string, props: VirtualGatewayProps) { super(scope, id, { - physicalName: props.virtualGatewayName || cdk.Lazy.stringValue({ produce: () => this.node.uniqueId }), + physicalName: props.virtualGatewayName || cdk.Lazy.string({ produce: () => cdk.Names.uniqueId(this) }), }); this.mesh = props.mesh; diff --git a/packages/@aws-cdk/aws-appmesh/lib/virtual-node-listener.ts b/packages/@aws-cdk/aws-appmesh/lib/virtual-node-listener.ts index 883d05583d5c7..f918fb9443228 100644 --- a/packages/@aws-cdk/aws-appmesh/lib/virtual-node-listener.ts +++ b/packages/@aws-cdk/aws-appmesh/lib/virtual-node-listener.ts @@ -1,13 +1,10 @@ import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnVirtualNode } from './appmesh.generated'; import { validateHealthChecks } from './private/utils'; import { HealthCheck, Protocol, HttpTimeout, GrpcTimeout, TcpTimeout } from './shared-interfaces'; import { TlsCertificate, TlsCertificateConfig } from './tls-certificate'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - /** * Properties for a VirtualNode listener */ diff --git a/packages/@aws-cdk/aws-appmesh/lib/virtual-router-listener.ts b/packages/@aws-cdk/aws-appmesh/lib/virtual-router-listener.ts index ced6279d78664..a1faac006b357 100644 --- a/packages/@aws-cdk/aws-appmesh/lib/virtual-router-listener.ts +++ b/packages/@aws-cdk/aws-appmesh/lib/virtual-router-listener.ts @@ -1,10 +1,7 @@ +import { Construct } from 'constructs'; import { CfnVirtualRouter } from './appmesh.generated'; import { Protocol } from './shared-interfaces'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - /** * Properties for a VirtualRouter listener */ diff --git a/packages/@aws-cdk/aws-appmesh/package.json b/packages/@aws-cdk/aws-appmesh/package.json index 32176758bd410..3078b07a6f1d7 100644 --- a/packages/@aws-cdk/aws-appmesh/package.json +++ b/packages/@aws-cdk/aws-appmesh/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-appmesh", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::AppMesh", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -90,7 +91,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-servicediscovery": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/aws-acmpca": "0.0.0", @@ -99,7 +100,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-servicediscovery": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-appstream/package.json b/packages/@aws-cdk/aws-appstream/package.json index e9655519ab834..f01e6aa7a39db 100644 --- a/packages/@aws-cdk/aws-appstream/package.json +++ b/packages/@aws-cdk/aws-appstream/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-appstream", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::AppStream", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,11 +80,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-appsync/lib/data-source.ts b/packages/@aws-cdk/aws-appsync/lib/data-source.ts index ac22771916400..a86d5dcf52558 100644 --- a/packages/@aws-cdk/aws-appsync/lib/data-source.ts +++ b/packages/@aws-cdk/aws-appsync/lib/data-source.ts @@ -10,10 +10,6 @@ import { CfnDataSource } from './appsync.generated'; import { IGraphqlApi } from './graphqlapi-base'; import { BaseResolverProps, Resolver } from './resolver'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Base properties for an AppSync datasource */ @@ -91,7 +87,7 @@ export interface ExtendedDataSourceProps { /** * Abstract AppSync datasource implementation. Do not use directly but use subclasses for concrete datasources */ -export abstract class BaseDataSource extends CoreConstruct { +export abstract class BaseDataSource extends Construct { /** * the name of the data source */ diff --git a/packages/@aws-cdk/aws-appsync/lib/resolver.ts b/packages/@aws-cdk/aws-appsync/lib/resolver.ts index eb65a59f494fd..274783afd2dc4 100644 --- a/packages/@aws-cdk/aws-appsync/lib/resolver.ts +++ b/packages/@aws-cdk/aws-appsync/lib/resolver.ts @@ -5,10 +5,6 @@ import { BaseDataSource } from './data-source'; import { IGraphqlApi } from './graphqlapi-base'; import { MappingTemplate } from './mapping-template'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Basic properties for an AppSync resolver */ @@ -67,7 +63,7 @@ export interface ResolverProps extends ExtendedResolverProps { /** * An AppSync resolver */ -export class Resolver extends CoreConstruct { +export class Resolver extends Construct { /** * the ARN of the resolver */ diff --git a/packages/@aws-cdk/aws-appsync/package.json b/packages/@aws-cdk/aws-appsync/package.json index f6bfb64813364..a721fdfb66a28 100644 --- a/packages/@aws-cdk/aws-appsync/package.json +++ b/packages/@aws-cdk/aws-appsync/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-appsync", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::AppSync", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -89,7 +90,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-s3-assets": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -102,7 +103,7 @@ "@aws-cdk/core": "0.0.0", "@aws-cdk/aws-rds": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-athena/package.json b/packages/@aws-cdk/aws-athena/package.json index 2a3cd7207b97f..b0810b8e6dfc0 100644 --- a/packages/@aws-cdk/aws-athena/package.json +++ b/packages/@aws-cdk/aws-athena/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-athena", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::Athena", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,12 +81,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-auditmanager/package.json b/packages/@aws-cdk/aws-auditmanager/package.json index b263be5fd8c92..6b20056d13534 100644 --- a/packages/@aws-cdk/aws-auditmanager/package.json +++ b/packages/@aws-cdk/aws-auditmanager/package.json @@ -79,10 +79,12 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" @@ -94,5 +96,6 @@ }, "publishConfig": { "tag": "latest" - } + }, + "private": true } diff --git a/packages/@aws-cdk/aws-autoscaling-common/package.json b/packages/@aws-cdk/aws-autoscaling-common/package.json index 8a43f80c5b9c7..b0f3b271d2a8b 100644 --- a/packages/@aws-cdk/aws-autoscaling-common/package.json +++ b/packages/@aws-cdk/aws-autoscaling-common/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-autoscaling-common", "version": "0.0.0", + "private": true, "description": "Common implementation package for @aws-cdk/aws-autoscaling and @aws-cdk/aws-applicationautoscaling", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -73,13 +74,13 @@ "dependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "awslint": { "exclude": [ diff --git a/packages/@aws-cdk/aws-autoscaling-hooktargets/lib/lambda-hook.ts b/packages/@aws-cdk/aws-autoscaling-hooktargets/lib/lambda-hook.ts index dbe170438320e..f48e02e8ec93e 100644 --- a/packages/@aws-cdk/aws-autoscaling-hooktargets/lib/lambda-hook.ts +++ b/packages/@aws-cdk/aws-autoscaling-hooktargets/lib/lambda-hook.ts @@ -3,12 +3,11 @@ import * as kms from '@aws-cdk/aws-kms'; import * as lambda from '@aws-cdk/aws-lambda'; import * as sns from '@aws-cdk/aws-sns'; import * as subs from '@aws-cdk/aws-sns-subscriptions'; - import { TopicHook } from './topic-hook'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Use a Lambda Function as a hook target diff --git a/packages/@aws-cdk/aws-autoscaling-hooktargets/lib/queue-hook.ts b/packages/@aws-cdk/aws-autoscaling-hooktargets/lib/queue-hook.ts index 640cd2a8b0ac6..a8d97df650b3a 100644 --- a/packages/@aws-cdk/aws-autoscaling-hooktargets/lib/queue-hook.ts +++ b/packages/@aws-cdk/aws-autoscaling-hooktargets/lib/queue-hook.ts @@ -1,6 +1,6 @@ import * as autoscaling from '@aws-cdk/aws-autoscaling'; import * as sqs from '@aws-cdk/aws-sqs'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Use an SQS queue as a hook target diff --git a/packages/@aws-cdk/aws-autoscaling-hooktargets/lib/topic-hook.ts b/packages/@aws-cdk/aws-autoscaling-hooktargets/lib/topic-hook.ts index 1f6546ebd75ac..5c6571fa90dfa 100644 --- a/packages/@aws-cdk/aws-autoscaling-hooktargets/lib/topic-hook.ts +++ b/packages/@aws-cdk/aws-autoscaling-hooktargets/lib/topic-hook.ts @@ -1,6 +1,6 @@ import * as autoscaling from '@aws-cdk/aws-autoscaling'; import * as sns from '@aws-cdk/aws-sns'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Use an SNS topic as a hook target diff --git a/packages/@aws-cdk/aws-autoscaling-hooktargets/package.json b/packages/@aws-cdk/aws-autoscaling-hooktargets/package.json index b15364996c1f3..acb4e0b09ef78 100644 --- a/packages/@aws-cdk/aws-autoscaling-hooktargets/package.json +++ b/packages/@aws-cdk/aws-autoscaling-hooktargets/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-autoscaling-hooktargets", "version": "0.0.0", + "private": true, "description": "Lifecycle hook for AWS AutoScaling", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,7 +80,7 @@ "@aws-cdk/aws-sns-subscriptions": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -91,7 +92,7 @@ "@aws-cdk/aws-sns-subscriptions": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-autoscaling/lib/lifecycle-hook-target.ts b/packages/@aws-cdk/aws-autoscaling/lib/lifecycle-hook-target.ts index e15ae3ef081b5..a599f38c05c90 100644 --- a/packages/@aws-cdk/aws-autoscaling/lib/lifecycle-hook-target.ts +++ b/packages/@aws-cdk/aws-autoscaling/lib/lifecycle-hook-target.ts @@ -1,9 +1,8 @@ - import { ILifecycleHook } from './lifecycle-hook'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Interface for autoscaling lifecycle hook targets diff --git a/packages/@aws-cdk/aws-autoscaling/lib/step-scaling-action.ts b/packages/@aws-cdk/aws-autoscaling/lib/step-scaling-action.ts index 35b397e81dd04..78e64b28cb429 100644 --- a/packages/@aws-cdk/aws-autoscaling/lib/step-scaling-action.ts +++ b/packages/@aws-cdk/aws-autoscaling/lib/step-scaling-action.ts @@ -3,10 +3,6 @@ import { Construct } from 'constructs'; import { IAutoScalingGroup } from './auto-scaling-group'; import { CfnScalingPolicy } from './autoscaling.generated'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Properties for a scaling policy */ @@ -64,7 +60,7 @@ export interface StepScalingActionProps { * * This Action must be used as the target of a CloudWatch alarm to take effect. */ -export class StepScalingAction extends CoreConstruct { +export class StepScalingAction extends Construct { /** * ARN of the scaling policy */ diff --git a/packages/@aws-cdk/aws-autoscaling/lib/step-scaling-policy.ts b/packages/@aws-cdk/aws-autoscaling/lib/step-scaling-policy.ts index 307eaf525ae55..ff96848cf048e 100644 --- a/packages/@aws-cdk/aws-autoscaling/lib/step-scaling-policy.ts +++ b/packages/@aws-cdk/aws-autoscaling/lib/step-scaling-policy.ts @@ -5,10 +5,6 @@ import { Construct } from 'constructs'; import { IAutoScalingGroup } from './auto-scaling-group'; import { AdjustmentType, MetricAggregationType, StepScalingAction } from './step-scaling-action'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct as CoreConstruct } from '@aws-cdk/core'; - export interface BasicStepScalingPolicyProps { /** * Metric to scale on. @@ -87,7 +83,7 @@ export interface StepScalingPolicyProps extends BasicStepScalingPolicyProps { * * Implemented using one or more CloudWatch alarms and Step Scaling Policies. */ -export class StepScalingPolicy extends CoreConstruct { +export class StepScalingPolicy extends Construct { public readonly lowerAlarm?: cloudwatch.Alarm; public readonly lowerAction?: StepScalingAction; public readonly upperAlarm?: cloudwatch.Alarm; @@ -234,7 +230,7 @@ class StepScalingAlarmAction implements cloudwatch.IAlarmAction { constructor(private readonly stepScalingAction: StepScalingAction) { } - public bind(_scope: CoreConstruct, _alarm: cloudwatch.IAlarm): cloudwatch.AlarmActionConfig { + public bind(_scope: Construct, _alarm: cloudwatch.IAlarm): cloudwatch.AlarmActionConfig { return { alarmActionArn: this.stepScalingAction.scalingPolicyArn }; } } diff --git a/packages/@aws-cdk/aws-autoscaling/lib/target-tracking-scaling-policy.ts b/packages/@aws-cdk/aws-autoscaling/lib/target-tracking-scaling-policy.ts index 9a89faef3b045..1533821459cd2 100644 --- a/packages/@aws-cdk/aws-autoscaling/lib/target-tracking-scaling-policy.ts +++ b/packages/@aws-cdk/aws-autoscaling/lib/target-tracking-scaling-policy.ts @@ -4,10 +4,6 @@ import { Construct } from 'constructs'; import { IAutoScalingGroup } from './auto-scaling-group'; import { CfnScalingPolicy } from './autoscaling.generated'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Base interface for target tracking props * @@ -102,7 +98,7 @@ export interface TargetTrackingScalingPolicyProps extends BasicTargetTrackingSca readonly autoScalingGroup: IAutoScalingGroup; } -export class TargetTrackingScalingPolicy extends CoreConstruct { +export class TargetTrackingScalingPolicy extends Construct { /** * ARN of the scaling policy */ diff --git a/packages/@aws-cdk/aws-autoscaling/package.json b/packages/@aws-cdk/aws-autoscaling/package.json index 79a8b3e02b967..bfabf74c98a5b 100644 --- a/packages/@aws-cdk/aws-autoscaling/package.json +++ b/packages/@aws-cdk/aws-autoscaling/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-autoscaling", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::AutoScaling", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -89,7 +90,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -101,7 +102,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-autoscaling/test/scaling.test.ts b/packages/@aws-cdk/aws-autoscaling/test/scaling.test.ts index 5c1f8947b09bd..d21ae8c3ec623 100644 --- a/packages/@aws-cdk/aws-autoscaling/test/scaling.test.ts +++ b/packages/@aws-cdk/aws-autoscaling/test/scaling.test.ts @@ -3,14 +3,10 @@ import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as elbv2 from '@aws-cdk/aws-elasticloadbalancingv2'; import * as cdk from '@aws-cdk/core'; -import * as constructs from 'constructs'; +import { Construct } from 'constructs'; import { nodeunitShim, Test } from 'nodeunit-shim'; import * as autoscaling from '../lib'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - nodeunitShim({ 'target tracking policies': { 'cpu utilization'(test: Test) { @@ -346,7 +342,7 @@ class ASGFixture extends Construct { public readonly vpc: ec2.Vpc; public readonly asg: autoscaling.AutoScalingGroup; - constructor(scope: constructs.Construct, id: string) { + constructor(scope: Construct, id: string) { super(scope, id); this.vpc = new ec2.Vpc(this, 'VPC'); diff --git a/packages/@aws-cdk/aws-autoscalingplans/package.json b/packages/@aws-cdk/aws-autoscalingplans/package.json index 5674f715e2b80..85ec497694b1b 100644 --- a/packages/@aws-cdk/aws-autoscalingplans/package.json +++ b/packages/@aws-cdk/aws-autoscalingplans/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-autoscalingplans", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::AutoScalingPlans", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -78,12 +79,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-backup/lib/backupable-resources-collector.ts b/packages/@aws-cdk/aws-backup/lib/backupable-resources-collector.ts index c363ab6424812..a4a0729d62d0f 100644 --- a/packages/@aws-cdk/aws-backup/lib/backupable-resources-collector.ts +++ b/packages/@aws-cdk/aws-backup/lib/backupable-resources-collector.ts @@ -2,7 +2,8 @@ import * as dynamodb from '@aws-cdk/aws-dynamodb'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as efs from '@aws-cdk/aws-efs'; import * as rds from '@aws-cdk/aws-rds'; -import { IAspect, IConstruct, Stack } from '@aws-cdk/core'; +import { IAspect, Stack } from '@aws-cdk/core'; +import { IConstruct } from 'constructs'; export class BackupableResourcesCollector implements IAspect { public readonly resources: string[] = []; diff --git a/packages/@aws-cdk/aws-backup/lib/plan.ts b/packages/@aws-cdk/aws-backup/lib/plan.ts index 70240e778969b..84174909a724c 100644 --- a/packages/@aws-cdk/aws-backup/lib/plan.ts +++ b/packages/@aws-cdk/aws-backup/lib/plan.ts @@ -138,6 +138,8 @@ export class BackupPlan extends Resource implements IBackupPlan { for (const rule of props.backupPlanRules || []) { this.addRule(rule); } + + this.node.addValidation({ validate: () => this.validatePlan() }); } /** @@ -192,7 +194,7 @@ export class BackupPlan extends Resource implements IBackupPlan { }); } - protected validate() { + private validatePlan() { if (this.rules.length === 0) { return ['A backup plan must have at least 1 rule.']; } diff --git a/packages/@aws-cdk/aws-backup/lib/resource.ts b/packages/@aws-cdk/aws-backup/lib/resource.ts index 46323f6838370..07ac3f2103ec0 100644 --- a/packages/@aws-cdk/aws-backup/lib/resource.ts +++ b/packages/@aws-cdk/aws-backup/lib/resource.ts @@ -5,10 +5,6 @@ import * as rds from '@aws-cdk/aws-rds'; import { Stack } from '@aws-cdk/core'; import { Construct } from 'constructs'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * An operation that is applied to a key-value pair */ @@ -134,11 +130,11 @@ export class BackupResource { /** * A construct */ - public readonly construct?: CoreConstruct; + public readonly construct?: Construct; constructor(resource?: string, tagCondition?: TagCondition, construct?: Construct) { this.resource = resource; this.tagCondition = tagCondition; - this.construct = construct as CoreConstruct; + this.construct = construct; } } diff --git a/packages/@aws-cdk/aws-backup/package.json b/packages/@aws-cdk/aws-backup/package.json index 841f29f929f36..5069375fd0465 100644 --- a/packages/@aws-cdk/aws-backup/package.json +++ b/packages/@aws-cdk/aws-backup/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-backup", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::Backup", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -89,7 +90,7 @@ "@aws-cdk/aws-rds": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/aws-dynamodb": "0.0.0", @@ -101,7 +102,7 @@ "@aws-cdk/aws-rds": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-backup/test/selection.test.ts b/packages/@aws-cdk/aws-backup/test/selection.test.ts index d801efb34894c..79db9acff4c0b 100644 --- a/packages/@aws-cdk/aws-backup/test/selection.test.ts +++ b/packages/@aws-cdk/aws-backup/test/selection.test.ts @@ -6,10 +6,6 @@ import { RemovalPolicy, Stack } from '@aws-cdk/core'; import { Construct } from 'constructs'; import { BackupPlan, BackupResource, BackupSelection } from '../lib'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - let stack: Stack; let plan: BackupPlan; beforeEach(() => { @@ -125,14 +121,14 @@ test('allow restores', () => { test('fromConstruct', () => { // GIVEN - class EfsConstruct extends CoreConstruct { + class EfsConstruct extends Construct { constructor(scope: Construct, id: string) { super(scope, id); const fs = new efs.CfnFileSystem(this, 'FileSystem'); fs.applyRemovalPolicy(RemovalPolicy.DESTROY); } } - class MyConstruct extends CoreConstruct { + class MyConstruct extends Construct { constructor(scope: Construct, id: string) { super(scope, id); diff --git a/packages/@aws-cdk/aws-batch/lib/job-definition-image-config.ts b/packages/@aws-cdk/aws-batch/lib/job-definition-image-config.ts index ba3c0c1740597..f212883ce07da 100644 --- a/packages/@aws-cdk/aws-batch/lib/job-definition-image-config.ts +++ b/packages/@aws-cdk/aws-batch/lib/job-definition-image-config.ts @@ -3,10 +3,6 @@ import * as iam from '@aws-cdk/aws-iam'; import { Construct } from 'constructs'; import { JobDefinitionContainer } from './job-definition'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * TaskDefinitionRole * @@ -68,7 +64,7 @@ export class JobDefinitionImageConfig { } private bindImageConfig(scope: Construct, container: JobDefinitionContainer): ecs.ContainerImageConfig { - return container.image.bind(scope as CoreConstruct, new ecs.ContainerDefinition(scope, 'Resource-Batch-Job-Container-Definition', { + return container.image.bind(scope, new ecs.ContainerDefinition(scope, 'Resource-Batch-Job-Container-Definition', { command: container.command, cpu: container.vcpus, image: container.image, diff --git a/packages/@aws-cdk/aws-batch/package.json b/packages/@aws-cdk/aws-batch/package.json index 0b8f4666ab077..80b4b7030a88b 100644 --- a/packages/@aws-cdk/aws-batch/package.json +++ b/packages/@aws-cdk/aws-batch/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-batch", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::Batch", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -86,7 +87,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/aws-ssm": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -97,7 +98,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/aws-ssm": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-budgets/package.json b/packages/@aws-cdk/aws-budgets/package.json index 3d8297269395f..1ff433cf384af 100644 --- a/packages/@aws-cdk/aws-budgets/package.json +++ b/packages/@aws-cdk/aws-budgets/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-budgets", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::Budgets", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -78,12 +79,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-cassandra/package.json b/packages/@aws-cdk/aws-cassandra/package.json index 5b0a317a627d8..0aa3a915562f7 100644 --- a/packages/@aws-cdk/aws-cassandra/package.json +++ b/packages/@aws-cdk/aws-cassandra/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-cassandra", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::Cassandra", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,10 +80,12 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-ce/package.json b/packages/@aws-cdk/aws-ce/package.json index 07c5e186da907..6409f9ba02dc1 100644 --- a/packages/@aws-cdk/aws-ce/package.json +++ b/packages/@aws-cdk/aws-ce/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-ce", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::CE", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,10 +80,12 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-certificatemanager/lib/dns-validated-certificate.ts b/packages/@aws-cdk/aws-certificatemanager/lib/dns-validated-certificate.ts index 6bb389afea97e..75794f69ba5f9 100644 --- a/packages/@aws-cdk/aws-certificatemanager/lib/dns-validated-certificate.ts +++ b/packages/@aws-cdk/aws-certificatemanager/lib/dns-validated-certificate.ts @@ -106,9 +106,11 @@ export class DnsValidatedCertificate extends cdk.Resource implements ICertificat }); this.certificateArn = certificate.getAtt('Arn').toString(); + + this.node.addValidation({ validate: () => this.validateDnsValidatedCertificate() }); } - protected validate(): string[] { + private validateDnsValidatedCertificate(): string[] { const errors: string[] = []; // Ensure the zone name is a parent zone of the certificate domain name if (!cdk.Token.isUnresolved(this.normalizedZoneName) && diff --git a/packages/@aws-cdk/aws-certificatemanager/package.json b/packages/@aws-cdk/aws-certificatemanager/package.json index 96e0787fb06ec..12c3853f1416b 100644 --- a/packages/@aws-cdk/aws-certificatemanager/package.json +++ b/packages/@aws-cdk/aws-certificatemanager/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-certificatemanager", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::CertificateManager", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,7 +82,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-route53": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -89,7 +90,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-route53": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-chatbot/package.json b/packages/@aws-cdk/aws-chatbot/package.json index ab267bf8f1c0c..54cafcbdad63e 100644 --- a/packages/@aws-cdk/aws-chatbot/package.json +++ b/packages/@aws-cdk/aws-chatbot/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-chatbot", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::Chatbot", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -85,7 +86,7 @@ "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/aws-cloudwatch": "0.0.0", @@ -93,7 +94,7 @@ "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-cloud9/package.json b/packages/@aws-cdk/aws-cloud9/package.json index e71b8c60f3bc0..17de5a37902f0 100644 --- a/packages/@aws-cdk/aws-cloud9/package.json +++ b/packages/@aws-cdk/aws-cloud9/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-cloud9", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::Cloud9", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -82,14 +83,14 @@ "@aws-cdk/core": "0.0.0", "@aws-cdk/aws-codecommit": "0.0.0", "@aws-cdk/aws-ec2": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", "@aws-cdk/aws-codecommit": "0.0.0", "@aws-cdk/aws-ec2": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-cloudformation/lib/custom-resource.ts b/packages/@aws-cdk/aws-cloudformation/lib/custom-resource.ts index 9c30e6c08540c..443ca165acf13 100644 --- a/packages/@aws-cdk/aws-cloudformation/lib/custom-resource.ts +++ b/packages/@aws-cdk/aws-cloudformation/lib/custom-resource.ts @@ -1,10 +1,7 @@ import * as lambda from '@aws-cdk/aws-lambda'; import * as sns from '@aws-cdk/aws-sns'; import * as core from '@aws-cdk/core'; - -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Collection of arbitrary properties diff --git a/packages/@aws-cdk/aws-cloudformation/lib/nested-stack.ts b/packages/@aws-cdk/aws-cloudformation/lib/nested-stack.ts index c72d94598ecfc..21a0d00b7909c 100644 --- a/packages/@aws-cdk/aws-cloudformation/lib/nested-stack.ts +++ b/packages/@aws-cdk/aws-cloudformation/lib/nested-stack.ts @@ -1,9 +1,6 @@ import * as sns from '@aws-cdk/aws-sns'; import * as core from '@aws-cdk/core'; - -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Initialization props for the `NestedStack` construct. diff --git a/packages/@aws-cdk/aws-cloudformation/package.json b/packages/@aws-cdk/aws-cloudformation/package.json index 550bc780b750d..ad7fdfe1e5ce4 100644 --- a/packages/@aws-cdk/aws-cloudformation/package.json +++ b/packages/@aws-cdk/aws-cloudformation/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-cloudformation", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::CloudFormation", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -88,7 +89,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -98,7 +99,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-cloudformation/test/integ.core-custom-resources.ts b/packages/@aws-cdk/aws-cloudformation/test/integ.core-custom-resources.ts index bdd4ae31af241..4d5cac64651bd 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/integ.core-custom-resources.ts +++ b/packages/@aws-cdk/aws-cloudformation/test/integ.core-custom-resources.ts @@ -11,7 +11,7 @@ import { App, CfnOutput, CustomResource, CustomResourceProvider, CustomResourceP // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /* eslint-disable cdk/no-core-construct */ diff --git a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stack.ts b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stack.ts index 77e008ac6872c..09989e2d0bb6b 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stack.ts +++ b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stack.ts @@ -7,7 +7,7 @@ import * as cfn from '../lib'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /* eslint-disable cdk/no-core-construct */ diff --git a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-assets.ts b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-assets.ts index dd3a74360e934..dcf69d58a78fd 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-assets.ts +++ b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-assets.ts @@ -6,7 +6,7 @@ import * as cfn from '../lib'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /* eslint-disable cdk/no-core-construct */ diff --git a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-multi.ts b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-multi.ts index 67f11d0f31878..0630ed9782f6f 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-multi.ts +++ b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-multi.ts @@ -5,7 +5,7 @@ import * as cfn from '../lib'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /* eslint-disable cdk/no-core-construct */ diff --git a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-refs1.ts b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-refs1.ts index 1240d8d39e5b3..3caa1d3da7f5e 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-refs1.ts +++ b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-refs1.ts @@ -10,7 +10,7 @@ import * as cfn from '../lib'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; class ConsumerNestedStack extends cfn.NestedStack { constructor(scope: Construct, id: string, topic: sns.Topic) { diff --git a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-refs2.ts b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-refs2.ts index 712de493fa9a3..a93ff634e5abf 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-refs2.ts +++ b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-refs2.ts @@ -5,12 +5,10 @@ import * as cfn from '../lib'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; // non-nested non-parent stack consumes a resource from a nested stack -/* eslint-disable cdk/no-core-construct */ - class ProducerNestedStack extends cfn.NestedStack { public readonly topic: sns.Topic; diff --git a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-refs3.ts b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-refs3.ts index f44eb1b1f731a..7c2c7b1e77214 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-refs3.ts +++ b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stacks-refs3.ts @@ -5,12 +5,10 @@ import * as cfn from '../lib'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; // references between siblings -/* eslint-disable cdk/no-core-construct */ - class ProducerNestedStack extends cfn.NestedStack { public readonly topic: sns.Topic; diff --git a/packages/@aws-cdk/aws-cloudformation/test/integ.trivial-lambda-resource.ts b/packages/@aws-cdk/aws-cloudformation/test/integ.trivial-lambda-resource.ts index 5d2b63f9b88b0..9870d063f5cba 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/integ.trivial-lambda-resource.ts +++ b/packages/@aws-cdk/aws-cloudformation/test/integ.trivial-lambda-resource.ts @@ -1,12 +1,9 @@ import * as fs from 'fs'; import * as lambda from '@aws-cdk/aws-lambda'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CustomResource, CustomResourceProvider } from '../lib'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - /* eslint-disable cdk/no-core-construct */ interface DemoResourceProps { diff --git a/packages/@aws-cdk/aws-cloudformation/test/test.nested-stack.ts b/packages/@aws-cdk/aws-cloudformation/test/test.nested-stack.ts index 7a443a6db19cd..5bcab5df7469f 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/test.nested-stack.ts +++ b/packages/@aws-cdk/aws-cloudformation/test/test.nested-stack.ts @@ -9,7 +9,7 @@ import { NestedStack } from '../lib/nested-stack'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /* eslint-disable cdk/no-core-construct */ /* eslint-disable max-len */ diff --git a/packages/@aws-cdk/aws-cloudformation/test/test.resource.ts b/packages/@aws-cdk/aws-cloudformation/test/test.resource.ts index 7015fe21bf948..566978ec0d4d9 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/test.resource.ts +++ b/packages/@aws-cdk/aws-cloudformation/test/test.resource.ts @@ -2,13 +2,10 @@ import { expect, haveResource, ResourcePart } from '@aws-cdk/assert'; import * as lambda from '@aws-cdk/aws-lambda'; import * as sns from '@aws-cdk/aws-sns'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Test, testCase } from 'nodeunit'; import { CustomResource, CustomResourceProvider } from '../lib'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - /* eslint-disable cdk/no-core-construct */ /* eslint-disable quote-props */ diff --git a/packages/@aws-cdk/aws-cloudfront-origins/lib/origin-group.ts b/packages/@aws-cdk/aws-cloudfront-origins/lib/origin-group.ts index 8fa8284e62ea9..7b49d8501f17f 100644 --- a/packages/@aws-cdk/aws-cloudfront-origins/lib/origin-group.ts +++ b/packages/@aws-cdk/aws-cloudfront-origins/lib/origin-group.ts @@ -1,5 +1,5 @@ import * as cloudfront from '@aws-cdk/aws-cloudfront'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** Construction properties for {@link OriginGroup}. */ export interface OriginGroupProps { diff --git a/packages/@aws-cdk/aws-cloudfront-origins/lib/s3-origin.ts b/packages/@aws-cdk/aws-cloudfront-origins/lib/s3-origin.ts index a0ac4037d9741..b55493e974fed 100644 --- a/packages/@aws-cdk/aws-cloudfront-origins/lib/s3-origin.ts +++ b/packages/@aws-cdk/aws-cloudfront-origins/lib/s3-origin.ts @@ -2,12 +2,9 @@ import * as cloudfront from '@aws-cdk/aws-cloudfront'; import * as iam from '@aws-cdk/aws-iam'; import * as s3 from '@aws-cdk/aws-s3'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { HttpOrigin } from './http-origin'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - /** * Properties to use to customize an S3 Origin. */ diff --git a/packages/@aws-cdk/aws-cloudfront-origins/package.json b/packages/@aws-cdk/aws-cloudfront-origins/package.json index d90ce2d097315..b59d40954e8cc 100644 --- a/packages/@aws-cdk/aws-cloudfront-origins/package.json +++ b/packages/@aws-cdk/aws-cloudfront-origins/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-cloudfront-origins", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS CloudFront Origins", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -82,12 +83,12 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0", + "constructs": "10.0.0-pre.5", "@aws-cdk/aws-cloudfront": "0.0.0", "@aws-cdk/aws-elasticloadbalancingv2": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", diff --git a/packages/@aws-cdk/aws-cloudfront/lib/distribution.ts b/packages/@aws-cdk/aws-cloudfront/lib/distribution.ts index 02e3d092295f3..ec531e98325e0 100644 --- a/packages/@aws-cdk/aws-cloudfront/lib/distribution.ts +++ b/packages/@aws-cdk/aws-cloudfront/lib/distribution.ts @@ -11,10 +11,6 @@ import { IOrigin, OriginBindConfig, OriginBindOptions } from './origin'; import { IOriginRequestPolicy } from './origin-request-policy'; import { CacheBehavior } from './private/cache-behavior'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Interface for CloudFront distributions */ @@ -328,7 +324,7 @@ export class Distribution extends Resource implements IDistribution { return existingOrigin.originGroupId ?? existingOrigin.originId; } else { const originIndex = this.boundOrigins.length + 1; - const scope = new CoreConstruct(this, `Origin${originIndex}`); + const scope = new Construct(this, `Origin${originIndex}`); const originId = Names.uniqueId(scope).slice(-ORIGIN_ID_MAX_LENGTH); const originBindConfig = origin.bind(scope, { originId }); if (!originBindConfig.failoverConfig) { @@ -338,7 +334,7 @@ export class Distribution extends Resource implements IDistribution { throw new Error('An Origin cannot use an Origin with its own failover configuration as its fallback origin!'); } const groupIndex = this.originGroups.length + 1; - const originGroupId = Names.uniqueId(new CoreConstruct(this, `OriginGroup${groupIndex}`)).slice(-ORIGIN_ID_MAX_LENGTH); + const originGroupId = Names.uniqueId(new Construct(this, `OriginGroup${groupIndex}`)).slice(-ORIGIN_ID_MAX_LENGTH); this.boundOrigins.push({ origin, originId, originGroupId, ...originBindConfig }); const failoverOriginId = this.addOrigin(originBindConfig.failoverConfig.failoverOrigin, true); diff --git a/packages/@aws-cdk/aws-cloudfront/lib/experimental/edge-function.ts b/packages/@aws-cdk/aws-cloudfront/lib/experimental/edge-function.ts index b12a56fe67e80..bc661b9c3ff37 100644 --- a/packages/@aws-cdk/aws-cloudfront/lib/experimental/edge-function.ts +++ b/packages/@aws-cdk/aws-cloudfront/lib/experimental/edge-function.ts @@ -7,11 +7,10 @@ import * as lambda from '@aws-cdk/aws-lambda'; import { calculateFunctionHash } from '@aws-cdk/aws-lambda/lib/function-hash'; import * as ssm from '@aws-cdk/aws-ssm'; import { - ConstructNode, CustomResource, CustomResourceProvider, CustomResourceProviderRuntime, Resource, Stack, Stage, Token, } from '@aws-cdk/core'; -import { Construct } from 'constructs'; +import { Construct, Node } from 'constructs'; /** * Properties for creating a Lambda@Edge function @@ -47,7 +46,7 @@ export class EdgeFunction extends Resource implements lambda.IVersion { public readonly functionArn: string; public readonly grantPrincipal: iam.IPrincipal; public readonly isBoundToVpc = false; - public readonly permissionsNode: ConstructNode; + public readonly permissionsNode: Node; public readonly role?: iam.IRole; public readonly version: string; diff --git a/packages/@aws-cdk/aws-cloudfront/lib/origin.ts b/packages/@aws-cdk/aws-cloudfront/lib/origin.ts index 6f5a42e407e01..921ef1939ee62 100644 --- a/packages/@aws-cdk/aws-cloudfront/lib/origin.ts +++ b/packages/@aws-cdk/aws-cloudfront/lib/origin.ts @@ -3,7 +3,7 @@ import { CfnDistribution } from './cloudfront.generated'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * The failover configuration used for Origin Groups, diff --git a/packages/@aws-cdk/aws-cloudfront/package.json b/packages/@aws-cdk/aws-cloudfront/package.json index 75b18c5b95444..409dd033da64b 100644 --- a/packages/@aws-cdk/aws-cloudfront/package.json +++ b/packages/@aws-cdk/aws-cloudfront/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-cloudfront", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::CloudFront", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -89,7 +90,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-ssm": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -102,7 +103,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-ssm": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-cloudfront/test/test-origin.ts b/packages/@aws-cdk/aws-cloudfront/test/test-origin.ts index 1c6d3762add4f..4a485c2ab092c 100644 --- a/packages/@aws-cdk/aws-cloudfront/test/test-origin.ts +++ b/packages/@aws-cdk/aws-cloudfront/test/test-origin.ts @@ -1,9 +1,6 @@ +import { Construct } from 'constructs'; import { CfnDistribution, IOrigin, OriginBase, OriginBindConfig, OriginBindOptions, OriginProps, OriginProtocolPolicy } from '../lib'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct } from '@aws-cdk/core'; - /** Used for testing common Origin functionality */ export class TestOrigin extends OriginBase { constructor(domainName: string, props: OriginProps = {}) { super(domainName, props); } diff --git a/packages/@aws-cdk/aws-cloudtrail/package.json b/packages/@aws-cdk/aws-cloudtrail/package.json index ce2c1f2e647ed..d0c6025b116f7 100644 --- a/packages/@aws-cdk/aws-cloudtrail/package.json +++ b/packages/@aws-cdk/aws-cloudtrail/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-cloudtrail", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::CloudTrail", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -89,7 +90,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -101,7 +102,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "awslint": { "exclude": [ diff --git a/packages/@aws-cdk/aws-cloudwatch-actions/lib/appscaling.ts b/packages/@aws-cdk/aws-cloudwatch-actions/lib/appscaling.ts index a37f6badf5ecb..d548120e1c716 100644 --- a/packages/@aws-cdk/aws-cloudwatch-actions/lib/appscaling.ts +++ b/packages/@aws-cdk/aws-cloudwatch-actions/lib/appscaling.ts @@ -1,9 +1,6 @@ import * as appscaling from '@aws-cdk/aws-applicationautoscaling'; import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; - -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Use an ApplicationAutoScaling StepScalingAction as an Alarm Action diff --git a/packages/@aws-cdk/aws-cloudwatch-actions/lib/autoscaling.ts b/packages/@aws-cdk/aws-cloudwatch-actions/lib/autoscaling.ts index 2ce075d4cd129..0c4ad825572c9 100644 --- a/packages/@aws-cdk/aws-cloudwatch-actions/lib/autoscaling.ts +++ b/packages/@aws-cdk/aws-cloudwatch-actions/lib/autoscaling.ts @@ -1,9 +1,6 @@ import * as autoscaling from '@aws-cdk/aws-autoscaling'; import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; - -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Use an AutoScaling StepScalingAction as an Alarm Action diff --git a/packages/@aws-cdk/aws-cloudwatch-actions/lib/ec2.ts b/packages/@aws-cdk/aws-cloudwatch-actions/lib/ec2.ts index 57d5a4fb67501..9b6615cc113bc 100644 --- a/packages/@aws-cdk/aws-cloudwatch-actions/lib/ec2.ts +++ b/packages/@aws-cdk/aws-cloudwatch-actions/lib/ec2.ts @@ -3,7 +3,7 @@ import { Stack } from '@aws-cdk/core'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Types of EC2 actions available diff --git a/packages/@aws-cdk/aws-cloudwatch-actions/lib/sns.ts b/packages/@aws-cdk/aws-cloudwatch-actions/lib/sns.ts index deb882be507b3..a7c11f9dba918 100644 --- a/packages/@aws-cdk/aws-cloudwatch-actions/lib/sns.ts +++ b/packages/@aws-cdk/aws-cloudwatch-actions/lib/sns.ts @@ -1,6 +1,6 @@ import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; import * as sns from '@aws-cdk/aws-sns'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Use an SNS topic as an alarm action diff --git a/packages/@aws-cdk/aws-cloudwatch-actions/package.json b/packages/@aws-cdk/aws-cloudwatch-actions/package.json index 04ed6918384c1..d3ecb5002fd65 100644 --- a/packages/@aws-cdk/aws-cloudwatch-actions/package.json +++ b/packages/@aws-cdk/aws-cloudwatch-actions/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-cloudwatch-actions", "version": "0.0.0", + "private": true, "description": "Alarm Actions for AWS CloudWatch CDK library", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -77,7 +78,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -87,7 +88,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-cloudwatch/lib/alarm-action.ts b/packages/@aws-cdk/aws-cloudwatch/lib/alarm-action.ts index fb7afe98d7725..da3676162e32f 100644 --- a/packages/@aws-cdk/aws-cloudwatch/lib/alarm-action.ts +++ b/packages/@aws-cdk/aws-cloudwatch/lib/alarm-action.ts @@ -1,9 +1,8 @@ - import { IAlarm } from './alarm-base'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Interface for objects that can be the targets of CloudWatch alarm actions diff --git a/packages/@aws-cdk/aws-cloudwatch/lib/metric.ts b/packages/@aws-cdk/aws-cloudwatch/lib/metric.ts index 0590a592da502..bfb1e94dd19aa 100644 --- a/packages/@aws-cdk/aws-cloudwatch/lib/metric.ts +++ b/packages/@aws-cdk/aws-cloudwatch/lib/metric.ts @@ -1,15 +1,11 @@ import * as iam from '@aws-cdk/aws-iam'; import * as cdk from '@aws-cdk/core'; -import * as constructs from 'constructs'; +import { Construct, IConstruct } from 'constructs'; import { Alarm, ComparisonOperator, TreatMissingData } from './alarm'; import { Dimension, IMetric, MetricAlarmConfig, MetricConfig, MetricGraphConfig, Unit } from './metric-types'; import { dispatchMetric, metricKey } from './private/metric-util'; import { normalizeStatistic, parseStatistic } from './private/statistic'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - export type DimensionHash = {[dim: string]: any}; /** @@ -277,7 +273,7 @@ export class Metric implements IMetric { * If the scope we attach to is in an environment-agnostic stack, * nothing is done and the same Metric object is returned. */ - public attachTo(scope: constructs.IConstruct): Metric { + public attachTo(scope: IConstruct): Metric { const stack = cdk.Stack.of(scope); return this.with({ diff --git a/packages/@aws-cdk/aws-cloudwatch/package.json b/packages/@aws-cdk/aws-cloudwatch/package.json index 98a3281163384..334e4f9e5555b 100644 --- a/packages/@aws-cdk/aws-cloudwatch/package.json +++ b/packages/@aws-cdk/aws-cloudwatch/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-cloudwatch", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::CloudWatch", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,13 +82,13 @@ "dependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "awslint": { "exclude": [ diff --git a/packages/@aws-cdk/aws-codeartifact/package.json b/packages/@aws-cdk/aws-codeartifact/package.json index e4b8ef3ffaad6..3a59186b3de06 100644 --- a/packages/@aws-cdk/aws-codeartifact/package.json +++ b/packages/@aws-cdk/aws-codeartifact/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-codeartifact", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::CodeArtifact", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,10 +80,12 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-codebuild/lib/artifacts.ts b/packages/@aws-cdk/aws-codebuild/lib/artifacts.ts index 397f5e08a5ef5..bbf84ed26c4b3 100644 --- a/packages/@aws-cdk/aws-codebuild/lib/artifacts.ts +++ b/packages/@aws-cdk/aws-codebuild/lib/artifacts.ts @@ -1,11 +1,8 @@ import * as s3 from '@aws-cdk/aws-s3'; +import { Construct } from 'constructs'; import { CfnProject } from './codebuild.generated'; import { IProject } from './project'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * The type returned from {@link IArtifacts#bind}. */ @@ -38,7 +35,7 @@ export interface IArtifacts { * @param scope a root Construct that allows creating new Constructs * @param project the Project this Artifacts is used in */ - bind(scope: CoreConstruct, project: IProject): ArtifactsConfig; + bind(scope: Construct, project: IProject): ArtifactsConfig; } /** @@ -67,7 +64,7 @@ export abstract class Artifacts implements IArtifacts { this.identifier = props.identifier; } - public bind(_scope: CoreConstruct, _project: IProject): ArtifactsConfig { + public bind(_scope: Construct, _project: IProject): ArtifactsConfig { return { artifactsProperty: { artifactIdentifier: this.identifier, @@ -143,7 +140,7 @@ class S3Artifacts extends Artifacts { super(props); } - public bind(_scope: CoreConstruct, project: IProject): ArtifactsConfig { + public bind(_scope: Construct, project: IProject): ArtifactsConfig { this.props.bucket.grantReadWrite(project); const superConfig = super.bind(_scope, project); return { diff --git a/packages/@aws-cdk/aws-codebuild/lib/file-location.ts b/packages/@aws-cdk/aws-codebuild/lib/file-location.ts index eabfd95570b06..fc57f64e3a61b 100644 --- a/packages/@aws-cdk/aws-codebuild/lib/file-location.ts +++ b/packages/@aws-cdk/aws-codebuild/lib/file-location.ts @@ -1,10 +1,7 @@ +import { Construct } from 'constructs'; import { CfnProject } from './codebuild.generated'; import { IProject } from './project'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * The type returned from {@link IFileSystemLocation#bind}. */ @@ -25,7 +22,7 @@ export interface IFileSystemLocation { * Called by the project when a file system is added so it can perform * binding operations on this file system location. */ - bind(scope: CoreConstruct, project: IProject): FileSystemConfig; + bind(scope: Construct, project: IProject): FileSystemConfig; } /** @@ -47,7 +44,7 @@ export class FileSystemLocation { class EfsFileSystemLocation implements IFileSystemLocation { constructor(private readonly props: EfsFileSystemLocationProps) {} - public bind(_scope: CoreConstruct, _project: IProject): FileSystemConfig { + public bind(_scope: Construct, _project: IProject): FileSystemConfig { return { location: { identifier: this.props.identifier, diff --git a/packages/@aws-cdk/aws-codebuild/lib/linux-gpu-build-image.ts b/packages/@aws-cdk/aws-codebuild/lib/linux-gpu-build-image.ts index 6cbf5bcfc2f7e..b96beebc4c3c5 100644 --- a/packages/@aws-cdk/aws-codebuild/lib/linux-gpu-build-image.ts +++ b/packages/@aws-cdk/aws-codebuild/lib/linux-gpu-build-image.ts @@ -1,6 +1,7 @@ import * as ecr from '@aws-cdk/aws-ecr'; import * as core from '@aws-cdk/core'; import { FactName, RegionInfo } from '@aws-cdk/region-info'; +import { Construct } from 'constructs'; import { BuildSpec } from './build-spec'; import { runScriptLinuxBuildSpec } from './private/run-script-linux-build-spec'; import { @@ -8,10 +9,6 @@ import { ImagePullPrincipalType, IProject, } from './project'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - const mappingName = 'AwsDeepLearningContainersRepositoriesAccounts'; /** diff --git a/packages/@aws-cdk/aws-codebuild/lib/project.ts b/packages/@aws-cdk/aws-codebuild/lib/project.ts index 718f7263ada13..37d99827e9c33 100644 --- a/packages/@aws-cdk/aws-codebuild/lib/project.ts +++ b/packages/@aws-cdk/aws-codebuild/lib/project.ts @@ -8,7 +8,7 @@ import * as kms from '@aws-cdk/aws-kms'; import * as s3 from '@aws-cdk/aws-s3'; import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; import { Aws, Duration, IResource, Lazy, Names, PhysicalName, Resource, SecretValue, Stack, Tokenization } from '@aws-cdk/core'; -import { Construct } from 'constructs'; +import { Construct, IConstruct } from 'constructs'; import { IArtifacts } from './artifacts'; import { BuildSpec } from './build-spec'; import { Cache } from './cache'; @@ -24,10 +24,6 @@ import { renderReportGroupArn } from './report-group-utils'; import { ISource } from './source'; import { CODEPIPELINE_SOURCE_ARTIFACTS_TYPE, NO_SOURCE_TYPE } from './source-types'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * The type returned from {@link IProject#enableBatchBuilds}. */ @@ -736,7 +732,7 @@ export class Project extends ProjectBase { // save the SSM env variables if (envVariable.type === BuildEnvironmentVariableType.PARAMETER_STORE) { const envVariableValue = envVariable.value.toString(); - ssmVariables.push(Stack.of(principal).formatArn({ + ssmVariables.push(Stack.of(principal as unknown as IConstruct).formatArn({ service: 'ssm', resource: 'parameter', // If the parameter name starts with / the resource name is not separated with a double '/' @@ -749,7 +745,7 @@ export class Project extends ProjectBase { // save SecretsManager env variables if (envVariable.type === BuildEnvironmentVariableType.SECRETS_MANAGER) { - secretsManagerSecrets.push(Stack.of(principal).formatArn({ + secretsManagerSecrets.push(Stack.of(principal as unknown as IConstruct).formatArn({ service: 'secretsmanager', resource: 'secret', // we don't know the exact ARN of the Secret just from its name, but we can get close @@ -931,6 +927,8 @@ export class Project extends ProjectBase { if (bindFunction) { bindFunction.call(this.buildImage, this, this, {}); } + + this.node.addValidation({ validate: () => this.validateProject() }); } public enableBatchBuilds(): BatchBuildConfig | undefined { @@ -1003,7 +1001,7 @@ export class Project extends ProjectBase { * @param _scope the construct the binding is taking place in * @param options additional options for the binding */ - public bindToCodePipeline(_scope: CoreConstruct, options: BindToCodePipelineOptions): void { + public bindToCodePipeline(_scope: Construct, options: BindToCodePipelineOptions): void { // work around a bug in CodeBuild: it ignores the KMS key set on the pipeline, // and always uses its own, project-level key if (options.artifactBucket.encryptionKey && !this._encryptionKey) { @@ -1019,10 +1017,7 @@ export class Project extends ProjectBase { } } - /** - * @override - */ - protected validate(): string[] { + private validateProject(): string[] { const ret = new Array(); if (this.source.type === CODEPIPELINE_SOURCE_ARTIFACTS_TYPE) { if (this._secondarySources.length > 0) { @@ -1411,7 +1406,7 @@ export interface BuildImageConfig { } /** A variant of {@link IBuildImage} that allows binding to the project. */ export interface IBindableBuildImage extends IBuildImage { /** Function that allows the build image access to the construct tree. */ - bind(scope: CoreConstruct, project: IProject, options: BuildImageBindOptions): BuildImageConfig; + bind(scope: Construct, project: IProject, options: BuildImageBindOptions): BuildImageConfig; } class ArmBuildImage implements IBuildImage { diff --git a/packages/@aws-cdk/aws-codebuild/lib/source.ts b/packages/@aws-cdk/aws-codebuild/lib/source.ts index a14026da98711..351f89b3b568d 100644 --- a/packages/@aws-cdk/aws-codebuild/lib/source.ts +++ b/packages/@aws-cdk/aws-codebuild/lib/source.ts @@ -1,6 +1,7 @@ import * as codecommit from '@aws-cdk/aws-codecommit'; import * as iam from '@aws-cdk/aws-iam'; import * as s3 from '@aws-cdk/aws-s3'; +import { Construct } from 'constructs'; import { CfnProject } from './codebuild.generated'; import { IProject } from './project'; import { @@ -11,10 +12,6 @@ import { S3_SOURCE_TYPE, } from './source-types'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * The type returned from {@link ISource#bind}. */ @@ -42,7 +39,7 @@ export interface ISource { readonly badgeSupported: boolean; - bind(scope: CoreConstruct, project: IProject): SourceConfig; + bind(scope: Construct, project: IProject): SourceConfig; } /** @@ -93,7 +90,7 @@ export abstract class Source implements ISource { * binding operations on the source. For example, it can grant permissions to the * code build project to read from the S3 bucket. */ - public bind(_scope: CoreConstruct, _project: IProject): SourceConfig { + public bind(_scope: Construct, _project: IProject): SourceConfig { return { sourceProperty: { sourceIdentifier: this.identifier, @@ -147,7 +144,7 @@ abstract class GitSource extends Source { this.fetchSubmodules = props.fetchSubmodules; } - public bind(_scope: CoreConstruct, _project: IProject): SourceConfig { + public bind(_scope: Construct, _project: IProject): SourceConfig { const superConfig = super.bind(_scope, _project); return { sourceVersion: this.branchOrRef, @@ -520,7 +517,7 @@ abstract class ThirdPartyGitSource extends GitSource { this.webhookTriggersBatchBuild = props.webhookTriggersBatchBuild; } - public bind(_scope: CoreConstruct, project: IProject): SourceConfig { + public bind(_scope: Construct, project: IProject): SourceConfig { const anyFilterGroupsProvided = this.webhookFilters.length > 0; const webhook = this.webhook ?? (anyFilterGroupsProvided ? true : undefined); @@ -573,7 +570,7 @@ class CodeCommitSource extends GitSource { this.repo = props.repository; } - public bind(_scope: CoreConstruct, project: IProject): SourceConfig { + public bind(_scope: Construct, project: IProject): SourceConfig { // https://docs.aws.amazon.com/codebuild/latest/userguide/setting-up.html project.addToRolePolicy(new iam.PolicyStatement({ actions: ['codecommit:GitPull'], @@ -622,7 +619,7 @@ class S3Source extends Source { this.version = props.version; } - public bind(_scope: CoreConstruct, project: IProject): SourceConfig { + public bind(_scope: Construct, project: IProject): SourceConfig { this.bucket.grantRead(project); const superConfig = super.bind(_scope, project); @@ -667,7 +664,7 @@ class GitHubSource extends ThirdPartyGitSource { this.httpsCloneUrl = `https://github.com/${props.owner}/${props.repo}.git`; } - public bind(_scope: CoreConstruct, project: IProject): SourceConfig { + public bind(_scope: Construct, project: IProject): SourceConfig { const superConfig = super.bind(_scope, project); return { sourceProperty: { @@ -711,7 +708,7 @@ class GitHubEnterpriseSource extends ThirdPartyGitSource { this.ignoreSslErrors = props.ignoreSslErrors; } - public bind(_scope: CoreConstruct, _project: IProject): SourceConfig { + public bind(_scope: Construct, _project: IProject): SourceConfig { if (this.hasCommitMessageFilterAndPrEvent()) { throw new Error('COMMIT_MESSAGE filters cannot be used with GitHub Enterprise Server pull request events'); } @@ -782,7 +779,7 @@ class BitBucketSource extends ThirdPartyGitSource { this.httpsCloneUrl = `https://bitbucket.org/${props.owner}/${props.repo}.git`; } - public bind(_scope: CoreConstruct, _project: IProject): SourceConfig { + public bind(_scope: Construct, _project: IProject): SourceConfig { // BitBucket sources don't support the PULL_REQUEST_REOPENED event action if (this.anyWebhookFilterContainsPrReopenedEventAction()) { throw new Error('BitBucket sources do not support the PULL_REQUEST_REOPENED webhook event action'); diff --git a/packages/@aws-cdk/aws-codebuild/package.json b/packages/@aws-cdk/aws-codebuild/package.json index 7b268062d474f..43448c0c838b5 100644 --- a/packages/@aws-cdk/aws-codebuild/package.json +++ b/packages/@aws-cdk/aws-codebuild/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-codebuild", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::CodeBuild", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -100,7 +101,7 @@ "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -118,7 +119,7 @@ "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-codecommit/package.json b/packages/@aws-cdk/aws-codecommit/package.json index 0580fab198c85..6dea8ec2ad214 100644 --- a/packages/@aws-cdk/aws-codecommit/package.json +++ b/packages/@aws-cdk/aws-codecommit/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-codecommit", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::CodeCommit", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -89,14 +90,14 @@ "@aws-cdk/aws-events": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-events": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-codedeploy/lib/ecs/deployment-config.ts b/packages/@aws-cdk/aws-codedeploy/lib/ecs/deployment-config.ts index c531cdd56c965..f9f41e12202a7 100644 --- a/packages/@aws-cdk/aws-codedeploy/lib/ecs/deployment-config.ts +++ b/packages/@aws-cdk/aws-codedeploy/lib/ecs/deployment-config.ts @@ -20,7 +20,7 @@ export interface IEcsDeploymentConfig { * * Note: This class currently stands as namespaced container of the default configurations * until CloudFormation supports custom ECS Deployment Configs. Until then it is closed - * (private constructor) and does not extend {@link cdk.Construct} + * (private constructor) and does not extend {@link Construct} * * @resource AWS::CodeDeploy::DeploymentConfig */ diff --git a/packages/@aws-cdk/aws-codedeploy/lib/ecs/deployment-group.ts b/packages/@aws-cdk/aws-codedeploy/lib/ecs/deployment-group.ts index 5b893bc9f4f6e..4a432631375e5 100644 --- a/packages/@aws-cdk/aws-codedeploy/lib/ecs/deployment-group.ts +++ b/packages/@aws-cdk/aws-codedeploy/lib/ecs/deployment-group.ts @@ -35,7 +35,7 @@ export interface IEcsDeploymentGroup extends cdk.IResource { * Note: This class currently stands as a namespaced container for importing an ECS * Deployment Group defined outside the CDK app until CloudFormation supports provisioning * ECS Deployment Groups. Until then it is closed (private constructor) and does not - * extend {@link cdk.Construct}. + * extend {@link Construct}. * * @resource AWS::CodeDeploy::DeploymentGroup */ diff --git a/packages/@aws-cdk/aws-codedeploy/lib/lambda/deployment-config.ts b/packages/@aws-cdk/aws-codedeploy/lib/lambda/deployment-config.ts index ebbd4df337529..594d994942f46 100644 --- a/packages/@aws-cdk/aws-codedeploy/lib/lambda/deployment-config.ts +++ b/packages/@aws-cdk/aws-codedeploy/lib/lambda/deployment-config.ts @@ -33,7 +33,7 @@ export interface LambdaDeploymentConfigImportProps { * * Note: This class currently stands as namespaced container of the default configurations * until CloudFormation supports custom Lambda Deployment Configs. Until then it is closed - * (private constructor) and does not extend {@link cdk.Construct} + * (private constructor) and does not extend {@link Construct} * * @resource AWS::CodeDeploy::DeploymentConfig */ diff --git a/packages/@aws-cdk/aws-codedeploy/package.json b/packages/@aws-cdk/aws-codedeploy/package.json index 257e001f0fdbe..6c33503e3246e 100644 --- a/packages/@aws-cdk/aws-codedeploy/package.json +++ b/packages/@aws-cdk/aws-codedeploy/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-codedeploy", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::CodeDeploy", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -92,7 +93,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -106,7 +107,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-codeguruprofiler/package.json b/packages/@aws-cdk/aws-codeguruprofiler/package.json index dd7c44d1a3527..abf1acc4a7f7d 100644 --- a/packages/@aws-cdk/aws-codeguruprofiler/package.json +++ b/packages/@aws-cdk/aws-codeguruprofiler/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-codeguruprofiler", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::CodeGuruProfiler", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -82,12 +83,12 @@ "dependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-codegurureviewer/package.json b/packages/@aws-cdk/aws-codegurureviewer/package.json index 1b75ae00b4682..c1f1dc6166387 100644 --- a/packages/@aws-cdk/aws-codegurureviewer/package.json +++ b/packages/@aws-cdk/aws-codegurureviewer/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-codegurureviewer", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::CodeGuruReviewer", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,10 +80,12 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/action.ts index c2f7ca5ca5305..a16f724ac1590 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/action.ts @@ -4,7 +4,7 @@ import { Lazy } from '@aws-cdk/core'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Low-level class for generic CodePipeline Actions. diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/alexa-ask/deploy-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/alexa-ask/deploy-action.ts index f5eb7c4e64579..2c802761678de 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/alexa-ask/deploy-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/alexa-ask/deploy-action.ts @@ -4,7 +4,7 @@ import { Action } from '../action'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Construction properties of the {@link AlexaSkillDeployAction Alexa deploy Action}. diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/bitbucket/source-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/bitbucket/source-action.ts index 7d7625ab4fca4..37b3cf76543d8 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/bitbucket/source-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/bitbucket/source-action.ts @@ -1,12 +1,11 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as iam from '@aws-cdk/aws-iam'; - import { Action } from '../action'; import { sourceArtifactBounds } from '../common'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Construction properties for {@link BitBucketSourceAction}. diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/cloudformation/pipeline-actions.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/cloudformation/pipeline-actions.ts index 63618e086ed91..0c57341aa4bd6 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/cloudformation/pipeline-actions.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/cloudformation/pipeline-actions.ts @@ -2,12 +2,9 @@ import * as cloudformation from '@aws-cdk/aws-cloudformation'; import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as iam from '@aws-cdk/aws-iam'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Action } from '../action'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - /** * Properties common to all CloudFormation actions */ @@ -540,7 +537,7 @@ class SingletonPolicy extends Construct implements iam.IGrantable { private statements: { [key: string]: iam.PolicyStatement } = {}; private constructor(private readonly role: iam.IRole) { - super(role as unknown as cdk.Construct, SingletonPolicy.UUID); + super(role as unknown as Construct, SingletonPolicy.UUID); this.grantPrincipal = role; } diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/codebuild/build-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/codebuild/build-action.ts index 54735d4ec1d9d..f64771c87b8cc 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/codebuild/build-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/codebuild/build-action.ts @@ -2,14 +2,11 @@ import * as codebuild from '@aws-cdk/aws-codebuild'; import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as iam from '@aws-cdk/aws-iam'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { BitBucketSourceAction } from '..'; import { Action } from '../action'; import { CodeCommitSourceAction } from '../codecommit/source-action'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - /** * The type of the CodeBuild action that determines its CodePipeline Category - * Build, or Test. diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/codecommit/source-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/codecommit/source-action.ts index 602a168487830..e8e0d494f9b1e 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/codecommit/source-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/codecommit/source-action.ts @@ -8,7 +8,7 @@ import { sourceArtifactBounds } from '../common'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * How should the CodeCommit Action detect changes. diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/codedeploy/ecs-deploy-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/codedeploy/ecs-deploy-action.ts index dd9ff5247e828..a3dfd31d43733 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/codedeploy/ecs-deploy-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/codedeploy/ecs-deploy-action.ts @@ -6,7 +6,7 @@ import { Action } from '../action'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Configuration for replacing a placeholder string in the ECS task diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/codedeploy/server-deploy-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/codedeploy/server-deploy-action.ts index 519a47708b74a..0abfd9d0e3513 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/codedeploy/server-deploy-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/codedeploy/server-deploy-action.ts @@ -1,13 +1,12 @@ import * as codedeploy from '@aws-cdk/aws-codedeploy'; import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as iam from '@aws-cdk/aws-iam'; - import { Action } from '../action'; import { deployArtifactBounds } from '../common'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Construction properties of the {@link CodeDeployServerDeployAction CodeDeploy server deploy CodePipeline Action}. diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/custom-action-registration.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/custom-action-registration.ts index dad9e84a47094..af61c807d90d0 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/custom-action-registration.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/custom-action-registration.ts @@ -1,8 +1,5 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; - -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * The creation attributes used for defining a configuration property diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/ecr/source-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/ecr/source-action.ts index 6042d701017a5..0f9587908b0fa 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/ecr/source-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/ecr/source-action.ts @@ -8,7 +8,7 @@ import { sourceArtifactBounds } from '../common'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * The CodePipeline variables emitted by the ECR source Action. diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/ecs/deploy-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/ecs/deploy-action.ts index 22c9988ac3ff5..b90bb6ff477e5 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/ecs/deploy-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/ecs/deploy-action.ts @@ -7,7 +7,7 @@ import { deployArtifactBounds } from '../common'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Construction properties of {@link EcsDeployAction}. diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/github/source-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/github/source-action.ts index 96b90a0ecb19b..6566fd08f1ee6 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/github/source-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/github/source-action.ts @@ -5,7 +5,7 @@ import { sourceArtifactBounds } from '../common'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * If and how the GitHub source action should be triggered diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/jenkins/jenkins-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/jenkins/jenkins-action.ts index 81da65206b12a..ab381fe85e97e 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/jenkins/jenkins-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/jenkins/jenkins-action.ts @@ -1,11 +1,10 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; - import { Action } from '../action'; import { IJenkinsProvider, jenkinsArtifactsBounds } from './jenkins-provider'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * The type of the Jenkins Action that determines its CodePipeline Category - diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/jenkins/jenkins-provider.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/jenkins/jenkins-provider.ts index 923b1a1e39e7c..9b8e84e37d375 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/jenkins/jenkins-provider.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/jenkins/jenkins-provider.ts @@ -1,12 +1,7 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; -import * as cdk from '@aws-cdk/core'; -import { Construct } from 'constructs'; +import { Construct, IConstruct } from 'constructs'; import { CustomActionRegistration } from '../custom-action-registration'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * A Jenkins provider. * @@ -16,7 +11,7 @@ import { Construct as CoreConstruct } from '@aws-cdk/core'; * If you want to reference an already registered provider, * use the {@link JenkinsProvider#fromJenkinsProviderAttributes} method. */ -export interface IJenkinsProvider extends cdk.IConstruct { +export interface IJenkinsProvider extends IConstruct { readonly providerName: string; readonly serverUrl: string; readonly version: string; @@ -107,7 +102,7 @@ export interface JenkinsProviderProps { readonly forTest?: boolean; } -export abstract class BaseJenkinsProvider extends CoreConstruct implements IJenkinsProvider { +export abstract class BaseJenkinsProvider extends Construct implements IJenkinsProvider { public abstract readonly providerName: string; public abstract readonly serverUrl: string; public readonly version: string; diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/lambda/invoke-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/lambda/invoke-action.ts index f8a49d977f6b4..a37a4fb3fe878 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/lambda/invoke-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/lambda/invoke-action.ts @@ -6,7 +6,7 @@ import { Action } from '../action'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Construction properties of the {@link LambdaInvokeAction Lambda invoke CodePipeline Action}. diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/manual-approval-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/manual-approval-action.ts index bf91f75b7359b..678e8b34f2035 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/manual-approval-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/manual-approval-action.ts @@ -1,12 +1,9 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as sns from '@aws-cdk/aws-sns'; import * as subs from '@aws-cdk/aws-sns-subscriptions'; +import { Construct } from 'constructs'; import { Action } from './action'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - /** * Construction properties of the {@link ManualApprovalAction}. */ diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/s3/deploy-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/s3/deploy-action.ts index 75998456f4a39..0805ae2ab8cab 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/s3/deploy-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/s3/deploy-action.ts @@ -2,13 +2,10 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as s3 from '@aws-cdk/aws-s3'; import { Duration } from '@aws-cdk/core'; import { kebab as toKebabCase } from 'case'; +import { Construct } from 'constructs'; import { Action } from '../action'; import { deployArtifactBounds } from '../common'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - // Class copied verbatim from the aws-s3-deployment module. // Yes, it sucks that we didn't abstract this properly in a common class, // but having 2 different CacheControl classes that behave differently would be worse I think. diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/s3/source-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/s3/source-action.ts index cb86bd2591c6a..397fea17ea915 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/s3/source-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/s3/source-action.ts @@ -7,7 +7,7 @@ import { sourceArtifactBounds } from '../common'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * How should the S3 Action detect changes. diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/servicecatalog/deploy-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/servicecatalog/deploy-action.ts index 9059af1ac0ba1..711e221b2ee0b 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/servicecatalog/deploy-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/servicecatalog/deploy-action.ts @@ -1,11 +1,10 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as iam from '@aws-cdk/aws-iam'; - import { Action } from '../action'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Construction properties of the {@link ServiceCatalogDeployAction ServiceCatalog deploy CodePipeline Action}. diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/stepfunctions/invoke-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/stepfunctions/invoke-action.ts index bf6c34ab505a8..7332bb861be3c 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/stepfunctions/invoke-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/stepfunctions/invoke-action.ts @@ -2,12 +2,9 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as iam from '@aws-cdk/aws-iam'; import * as stepfunction from '@aws-cdk/aws-stepfunctions'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Action } from '../action'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - /** * Represents the input for the StateMachine. */ diff --git a/packages/@aws-cdk/aws-codepipeline-actions/package.json b/packages/@aws-cdk/aws-codepipeline-actions/package.json index 62a7868ece518..f8ec91da01d6f 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/package.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-codepipeline-actions", "version": "0.0.0", + "private": true, "description": "Concrete Actions for AWS Code Pipeline", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -96,7 +97,7 @@ "@aws-cdk/aws-stepfunctions": "0.0.0", "@aws-cdk/core": "0.0.0", "case": "1.6.3", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -118,7 +119,7 @@ "@aws-cdk/aws-sns-subscriptions": "0.0.0", "@aws-cdk/aws-stepfunctions": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "bundledDependencies": [ "case" diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/cloudformation/pipeline-actions.test.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/cloudformation/pipeline-actions.test.ts index 1433ffc6e2860..b4828d22aa654 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/cloudformation/pipeline-actions.test.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/cloudformation/pipeline-actions.test.ts @@ -3,7 +3,7 @@ import * as events from '@aws-cdk/aws-events'; import * as iam from '@aws-cdk/aws-iam'; import * as s3 from '@aws-cdk/aws-s3'; import * as cdk from '@aws-cdk/core'; -import * as constructs from 'constructs'; +import { Construct, IConstruct, Node } from 'constructs'; import * as _ from 'lodash'; import { nodeunitShim, Test } from 'nodeunit-shim'; import * as cpactions from '../../lib'; @@ -315,7 +315,7 @@ function _isOrContains(stack: cdk.Stack, entity: string | string[], value: strin return false; } -function _stackArn(stackName: string, scope: constructs.IConstruct): string { +function _stackArn(stackName: string, scope: IConstruct): string { return cdk.Stack.of(scope).formatArn({ service: 'cloudformation', resource: 'stack', @@ -329,7 +329,7 @@ class PipelineDouble extends cdk.Resource implements codepipeline.IPipeline { public readonly role: iam.Role; public readonly artifactBucket: s3.IBucket; - constructor(scope: constructs.Construct, id: string, { pipelineName, role }: { pipelineName?: string, role: iam.Role }) { + constructor(scope: Construct, id: string, { pipelineName, role }: { pipelineName?: string, role: iam.Role }) { super(scope, id); this.pipelineName = pipelineName || 'TestPipeline'; this.pipelineArn = cdk.Stack.of(this).formatArn({ service: 'codepipeline', resource: 'pipeline', resourceName: this.pipelineName }); @@ -359,7 +359,7 @@ class StageDouble implements codepipeline.IStage { public readonly actions: codepipeline.IAction[] = []; public readonly fullActions: FullAction[]; - public get node(): cdk.ConstructNode { + public get node(): Node { throw new Error('StageDouble is not a real construct'); } @@ -367,10 +367,10 @@ class StageDouble implements codepipeline.IStage { this.stageName = name || 'TestStage'; this.pipeline = pipeline; - const stageParent = new cdk.Construct(pipeline, this.stageName); + const stageParent = new Construct(pipeline, this.stageName); const fullActions = new Array(); for (const action of actions) { - const actionParent = new cdk.Construct(stageParent, action.actionProperties.actionName); + const actionParent = new Construct(stageParent, action.actionProperties.actionName); fullActions.push(new FullAction(action.actionProperties, action.bind(actionParent, this, { role: pipeline.role, bucket: pipeline.artifactBucket, @@ -392,7 +392,7 @@ class StageDouble implements codepipeline.IStage { class RoleDouble extends iam.Role { public readonly statements = new Array(); - constructor(scope: constructs.Construct, id: string, props: iam.RoleProps = { assumedBy: new iam.ServicePrincipal('test') }) { + constructor(scope: Construct, id: string, props: iam.RoleProps = { assumedBy: new iam.ServicePrincipal('test') }) { super(scope, id, props); } diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/pipeline.test.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/pipeline.test.ts index 0c0491d778150..893666c41d704 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/pipeline.test.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/pipeline.test.ts @@ -7,7 +7,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as lambda from '@aws-cdk/aws-lambda'; import * as s3 from '@aws-cdk/aws-s3'; import * as sns from '@aws-cdk/aws-sns'; -import { App, Aws, CfnParameter, ConstructNode, SecretValue, Stack } from '@aws-cdk/core'; +import { App, Aws, CfnParameter, SecretValue, Stack } from '@aws-cdk/core'; import { nodeunitShim, Test } from 'nodeunit-shim'; import * as cpactions from '../lib'; @@ -46,7 +46,7 @@ nodeunitShim({ }); test.notDeepEqual(SynthUtils.toCloudFormation(stack), {}); - test.deepEqual([], ConstructNode.validate(pipeline.node)); + test.deepEqual([], pipeline.node.validate()); test.done(); }, @@ -276,7 +276,7 @@ nodeunitShim({ ], })); - test.deepEqual([], ConstructNode.validate(p.node)); + test.deepEqual([], p.node.validate()); test.done(); }, @@ -367,7 +367,7 @@ nodeunitShim({ ], })); - test.deepEqual([], ConstructNode.validate(pipeline.node)); + test.deepEqual([], pipeline.node.validate()); test.done(); }, diff --git a/packages/@aws-cdk/aws-codepipeline/lib/action.ts b/packages/@aws-cdk/aws-codepipeline/lib/action.ts index 6b28bcc8a3749..236a97919104d 100644 --- a/packages/@aws-cdk/aws-codepipeline/lib/action.ts +++ b/packages/@aws-cdk/aws-codepipeline/lib/action.ts @@ -6,7 +6,7 @@ import { Artifact } from './artifact'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; export enum ActionCategory { SOURCE = 'Source', diff --git a/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts b/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts index 8ef8cc3dede8e..4b3af86b8fbee 100644 --- a/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts +++ b/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts @@ -15,10 +15,6 @@ import { RichAction } from './private/rich-action'; import { Stage } from './private/stage'; import { validateName, validateNamespaceName, validateSourceAction } from './private/validation'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Allows you to control where to place a new Stage when it's added to the Pipeline. * Note that you can provide only one of the below properties - @@ -319,6 +315,8 @@ export class Pipeline extends PipelineBase { for (const stage of props.stages || []) { this.addStage(stage); } + + this.node.addValidation({ validate: () => this.validatePipeline() }); } /** @@ -397,7 +395,7 @@ export class Pipeline extends PipelineBase { } /** @internal */ - public _attachActionToPipeline(stage: Stage, action: IAction, actionScope: CoreConstruct): FullActionDescriptor { + public _attachActionToPipeline(stage: Stage, action: IAction, actionScope: Construct): FullActionDescriptor { const richAction = new RichAction(action, this); // handle cross-region actions here @@ -433,9 +431,8 @@ export class Pipeline extends PipelineBase { * Validation happens according to the rules documented at * * https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html#pipeline-requirements - * @override */ - protected validate(): string[] { + private validatePipeline(): string[] { return [ ...this.validateSourceActionLocations(), ...this.validateHasStages(), diff --git a/packages/@aws-cdk/aws-codepipeline/lib/private/cross-region-support-stack.ts b/packages/@aws-cdk/aws-codepipeline/lib/private/cross-region-support-stack.ts index e52e6c7f68a40..ee3a4958f32a5 100644 --- a/packages/@aws-cdk/aws-codepipeline/lib/private/cross-region-support-stack.ts +++ b/packages/@aws-cdk/aws-codepipeline/lib/private/cross-region-support-stack.ts @@ -1,10 +1,7 @@ import * as kms from '@aws-cdk/aws-kms'; import * as s3 from '@aws-cdk/aws-s3'; import * as cdk from '@aws-cdk/core'; - -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; const REQUIRED_ALIAS_PREFIX = 'alias/'; diff --git a/packages/@aws-cdk/aws-codepipeline/lib/private/rich-action.ts b/packages/@aws-cdk/aws-codepipeline/lib/private/rich-action.ts index e2cde045f88a3..2d2f8b82482a6 100644 --- a/packages/@aws-cdk/aws-codepipeline/lib/private/rich-action.ts +++ b/packages/@aws-cdk/aws-codepipeline/lib/private/rich-action.ts @@ -4,7 +4,7 @@ import { ActionBindOptions, ActionConfig, ActionProperties, IAction, IPipeline, // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Helper routines to work with Actions diff --git a/packages/@aws-cdk/aws-codepipeline/lib/private/stage.ts b/packages/@aws-cdk/aws-codepipeline/lib/private/stage.ts index e9ed5a6995f02..954394d9a2c46 100644 --- a/packages/@aws-cdk/aws-codepipeline/lib/private/stage.ts +++ b/packages/@aws-cdk/aws-codepipeline/lib/private/stage.ts @@ -1,5 +1,6 @@ import * as events from '@aws-cdk/aws-events'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { IAction, IPipeline, IStage } from '../action'; import { Artifact } from '../artifact'; import { CfnPipeline } from '../codepipeline.generated'; @@ -20,7 +21,7 @@ export class Stage implements IStage { * The Pipeline this Stage is a part of. */ public readonly stageName: string; - private readonly scope: cdk.Construct; + private readonly scope: Construct; private readonly _pipeline: Pipeline; private readonly _actions = new Array(); @@ -32,7 +33,7 @@ export class Stage implements IStage { this.stageName = props.stageName; this._pipeline = pipeline; - this.scope = new cdk.Construct(pipeline, this.stageName); + this.scope = new Construct(pipeline, this.stageName); for (const action of props.actions || []) { this.addAction(action); @@ -137,7 +138,7 @@ export class Stage implements IStage { private attachActionToPipeline(action: IAction): FullActionDescriptor { // notify the Pipeline of the new Action - const actionScope = new cdk.Construct(this.scope, action.actionProperties.actionName); + const actionScope = new Construct(this.scope, action.actionProperties.actionName); return this._pipeline._attachActionToPipeline(this, action, actionScope); } diff --git a/packages/@aws-cdk/aws-codepipeline/package.json b/packages/@aws-cdk/aws-codepipeline/package.json index 1cc830be83ec6..942369f67c312 100644 --- a/packages/@aws-cdk/aws-codepipeline/package.json +++ b/packages/@aws-cdk/aws-codepipeline/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-codepipeline", "version": "0.0.0", + "private": true, "description": "Better interface to AWS Code Pipeline", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -92,7 +93,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -101,7 +102,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-codepipeline/test/artifacts.test.ts b/packages/@aws-cdk/aws-codepipeline/test/artifacts.test.ts index c67176d1e13ae..e63b7e9860336 100644 --- a/packages/@aws-cdk/aws-codepipeline/test/artifacts.test.ts +++ b/packages/@aws-cdk/aws-codepipeline/test/artifacts.test.ts @@ -1,4 +1,4 @@ -import { expect, haveResourceLike } from '@aws-cdk/assert'; +import { expect, haveResourceLike, SynthUtils } from '@aws-cdk/assert'; import * as cdk from '@aws-cdk/core'; import { nodeunitShim, Test } from 'nodeunit-shim'; import * as codepipeline from '../lib'; @@ -41,12 +41,14 @@ nodeunitShim({ ], }); - const errors = validate(stack); + // synthesize - this is where names for artifact without names are allocated + SynthUtils.synthesize(stack, { skipValidation: true }); + + const errors = pipeline.node.validate(); test.equal(errors.length, 1); const error = errors[0]; - test.same(error.source, pipeline); - test.equal(error.message, "Action 'Build' is using an unnamed input Artifact, which is not being produced in this pipeline"); + test.equal(error, "Action 'Build' is using an unnamed input Artifact, which is not being produced in this pipeline"); test.done(); }, @@ -77,12 +79,11 @@ nodeunitShim({ ], }); - const errors = validate(stack); + const errors = pipeline.node.validate(); test.equal(errors.length, 1); const error = errors[0]; - test.same(error.source, pipeline); - test.equal(error.message, "Action 'Build' is using input Artifact 'named', which is not being produced in this pipeline"); + test.equal(error, "Action 'Build' is using input Artifact 'named', which is not being produced in this pipeline"); test.done(); }, @@ -114,12 +115,12 @@ nodeunitShim({ ], }); - const errors = validate(stack); + SynthUtils.synthesize(stack, { skipValidation: true }); + const errors = pipeline.node.validate(); test.equal(errors.length, 1); const error = errors[0]; - test.same(error.source, pipeline); - test.equal(error.message, "Both Actions 'Source' and 'Build' are producting Artifact 'Artifact_Source_Source'. Every artifact can only be produced once."); + test.equal(error, "Both Actions 'Source' and 'Build' are producting Artifact 'Artifact_Source_Source'. Every artifact can only be produced once."); test.done(); }, @@ -216,12 +217,11 @@ nodeunitShim({ ], }); - const errors = validate(stack); + const errors = pipeline.node.validate(); test.equal(errors.length, 1); const error = errors[0]; - test.same(error.source, pipeline); - test.equal(error.message, "Stage 2 Action 2 ('Build'/'build2') is consuming input Artifact 'buildOutput1' before it is being produced at Stage 2 Action 3 ('Build'/'build1')"); + test.equal(error, "Stage 2 Action 2 ('Build'/'build2') is consuming input Artifact 'buildOutput1' before it is being produced at Stage 2 Action 3 ('Build'/'build1')"); test.done(); }, @@ -284,10 +284,3 @@ nodeunitShim({ }, }, }); - -/* eslint-disable cdk/no-core-construct */ -function validate(construct: cdk.IConstruct): cdk.ValidationError[] { - cdk.ConstructNode.prepare(construct.node); - return cdk.ConstructNode.validate(construct.node); -} -/* eslint-enable cdk/no-core-construct */ diff --git a/packages/@aws-cdk/aws-codepipeline/test/general-validation.test.ts b/packages/@aws-cdk/aws-codepipeline/test/general-validation.test.ts index 76cd9b71a6941..130f91d75ef31 100644 --- a/packages/@aws-cdk/aws-codepipeline/test/general-validation.test.ts +++ b/packages/@aws-cdk/aws-codepipeline/test/general-validation.test.ts @@ -49,7 +49,7 @@ nodeunitShim({ const stack = new cdk.Stack(); const pipeline = new Pipeline(stack, 'Pipeline'); - test.deepEqual(cdk.ConstructNode.validate(pipeline.node).length, 1); + test.deepEqual(pipeline.node.validate().length, 1); test.done(); }, @@ -68,7 +68,7 @@ nodeunitShim({ ], }); - test.deepEqual(cdk.ConstructNode.validate(pipeline.node).length, 1); + test.deepEqual(pipeline.node.validate().length, 1); test.done(); }, diff --git a/packages/@aws-cdk/aws-codestar/package.json b/packages/@aws-cdk/aws-codestar/package.json index 01024a24b1248..7b708c19c8f65 100644 --- a/packages/@aws-cdk/aws-codestar/package.json +++ b/packages/@aws-cdk/aws-codestar/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-codestar", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::CodeStar", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -82,12 +83,12 @@ "dependencies": { "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-codestarconnections/package.json b/packages/@aws-cdk/aws-codestarconnections/package.json index 66ab2aab76ea6..4016052d245d1 100644 --- a/packages/@aws-cdk/aws-codestarconnections/package.json +++ b/packages/@aws-cdk/aws-codestarconnections/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-codestarconnections", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::CodeStarConnections", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,10 +80,12 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-codestarnotifications/package.json b/packages/@aws-cdk/aws-codestarnotifications/package.json index 18667b45db8b1..8648ab13eec8c 100644 --- a/packages/@aws-cdk/aws-codestarnotifications/package.json +++ b/packages/@aws-cdk/aws-codestarnotifications/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-codestarnotifications", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::CodeStarNotifications", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,11 +81,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-cognito/package.json b/packages/@aws-cdk/aws-cognito/package.json index 3a981167956a3..14dc5aa373ad5 100644 --- a/packages/@aws-cdk/aws-cognito/package.json +++ b/packages/@aws-cdk/aws-cognito/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-cognito", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::Cognito", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -85,7 +86,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", - "constructs": "^3.2.0", + "constructs": "10.0.0-pre.5", "punycode": "^2.1.1" }, "homepage": "https://github.com/aws/aws-cdk", @@ -95,7 +96,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "bundledDependencies": [ "punycode" diff --git a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-domain-cfdist.expected.json b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-domain-cfdist.expected.json index abcb9265e2bda..b73cdc2ddb344 100644 --- a/packages/@aws-cdk/aws-cognito/test/integ.user-pool-domain-cfdist.expected.json +++ b/packages/@aws-cdk/aws-cognito/test/integ.user-pool-domain-cfdist.expected.json @@ -226,4 +226,4 @@ "Description": "Artifact hash for asset \"0625b1566df06e0ffd948f0f65f97a3d22d48242e66196d3f72b480f5309b343\"" } } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/aws-config/package.json b/packages/@aws-cdk/aws-config/package.json index 59055c7030216..561c95aa19f95 100644 --- a/packages/@aws-cdk/aws-config/package.json +++ b/packages/@aws-cdk/aws-config/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-config", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::Config", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -85,7 +86,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -94,7 +95,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-databrew/package.json b/packages/@aws-cdk/aws-databrew/package.json index be8bdfacf71db..f66f38d41444a 100644 --- a/packages/@aws-cdk/aws-databrew/package.json +++ b/packages/@aws-cdk/aws-databrew/package.json @@ -79,10 +79,12 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" @@ -94,5 +96,6 @@ }, "publishConfig": { "tag": "latest" - } + }, + "private": true } diff --git a/packages/@aws-cdk/aws-datapipeline/package.json b/packages/@aws-cdk/aws-datapipeline/package.json index 2e1f552ef864a..fe264d1f0f493 100644 --- a/packages/@aws-cdk/aws-datapipeline/package.json +++ b/packages/@aws-cdk/aws-datapipeline/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-datapipeline", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::DataPipeline", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -78,12 +79,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-datasync/package.json b/packages/@aws-cdk/aws-datasync/package.json index 124d3871ae0c3..d0f9900f8ecf7 100644 --- a/packages/@aws-cdk/aws-datasync/package.json +++ b/packages/@aws-cdk/aws-datasync/package.json @@ -79,10 +79,12 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" @@ -94,5 +96,6 @@ }, "publishConfig": { "tag": "latest" - } + }, + "private": true } diff --git a/packages/@aws-cdk/aws-dax/package.json b/packages/@aws-cdk/aws-dax/package.json index 83fecea8535ee..a7c9880fca036 100644 --- a/packages/@aws-cdk/aws-dax/package.json +++ b/packages/@aws-cdk/aws-dax/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-dax", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::DAX", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -78,12 +79,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-detective/package.json b/packages/@aws-cdk/aws-detective/package.json index 741eade5dc9e2..38071ff9d620b 100644 --- a/packages/@aws-cdk/aws-detective/package.json +++ b/packages/@aws-cdk/aws-detective/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-detective", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::Detective", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,10 +80,12 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-devopsguru/package.json b/packages/@aws-cdk/aws-devopsguru/package.json index 7632ba1d35cea..e73aba2508059 100644 --- a/packages/@aws-cdk/aws-devopsguru/package.json +++ b/packages/@aws-cdk/aws-devopsguru/package.json @@ -79,10 +79,12 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" @@ -94,5 +96,6 @@ }, "publishConfig": { "tag": "latest" - } + }, + "private": true } diff --git a/packages/@aws-cdk/aws-directoryservice/package.json b/packages/@aws-cdk/aws-directoryservice/package.json index 9be65b5324fff..bb641f93989e9 100644 --- a/packages/@aws-cdk/aws-directoryservice/package.json +++ b/packages/@aws-cdk/aws-directoryservice/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-directoryservice", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::DirectoryService", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -78,12 +79,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-dlm/package.json b/packages/@aws-cdk/aws-dlm/package.json index 5829ed6a34e11..44035b759c744 100644 --- a/packages/@aws-cdk/aws-dlm/package.json +++ b/packages/@aws-cdk/aws-dlm/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-dlm", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::DLM", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,11 +80,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-dms/package.json b/packages/@aws-cdk/aws-dms/package.json index 1c6f0a473b7b3..29e4bfd61f662 100644 --- a/packages/@aws-cdk/aws-dms/package.json +++ b/packages/@aws-cdk/aws-dms/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-dms", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::DMS", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -78,12 +79,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-docdb/package.json b/packages/@aws-cdk/aws-docdb/package.json index 658583ff0d644..5ad71f540a227 100644 --- a/packages/@aws-cdk/aws-docdb/package.json +++ b/packages/@aws-cdk/aws-docdb/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-docdb", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::DocDB", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -85,7 +86,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/aws-efs": "0.0.0", @@ -93,7 +94,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-dynamodb-global/lib/aws-dynamodb-global.ts b/packages/@aws-cdk/aws-dynamodb-global/lib/aws-dynamodb-global.ts index caa9eedec0c4d..576228502bb27 100644 --- a/packages/@aws-cdk/aws-dynamodb-global/lib/aws-dynamodb-global.ts +++ b/packages/@aws-cdk/aws-dynamodb-global/lib/aws-dynamodb-global.ts @@ -1,11 +1,8 @@ import * as dynamodb from '@aws-cdk/aws-dynamodb'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { GlobalTableCoordinator } from './global-table-coordinator'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - /** * Properties for the multiple DynamoDB tables to mash together into a * global table diff --git a/packages/@aws-cdk/aws-dynamodb-global/lib/global-table-coordinator.ts b/packages/@aws-cdk/aws-dynamodb-global/lib/global-table-coordinator.ts index 924c84b9237f1..89c751e7b7e44 100644 --- a/packages/@aws-cdk/aws-dynamodb-global/lib/global-table-coordinator.ts +++ b/packages/@aws-cdk/aws-dynamodb-global/lib/global-table-coordinator.ts @@ -2,12 +2,9 @@ import * as path from 'path'; import * as iam from '@aws-cdk/aws-iam'; import * as lambda from '@aws-cdk/aws-lambda'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { GlobalTableProps } from './aws-dynamodb-global'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - /** * A stack that will make a Lambda that will launch a lambda to glue * together all the DynamoDB tables into a global table diff --git a/packages/@aws-cdk/aws-dynamodb-global/package.json b/packages/@aws-cdk/aws-dynamodb-global/package.json index 2a3a41bc29fbb..d01c21507d0ed 100644 --- a/packages/@aws-cdk/aws-dynamodb-global/package.json +++ b/packages/@aws-cdk/aws-dynamodb-global/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-dynamodb-global", "version": "0.0.0", + "private": true, "description": "Build a global dynamodb table", "deprecated": "This module has been deprecated. Use @aws-cdk/aws-dynamodb.Table with replicationRegions instead", "license": "Apache-2.0", @@ -53,7 +54,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "devDependencies": { "@aws-cdk/assert": "0.0.0", @@ -68,7 +69,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "scripts": { "build": "cdk-build", diff --git a/packages/@aws-cdk/aws-dynamodb/lib/replica-provider.ts b/packages/@aws-cdk/aws-dynamodb/lib/replica-provider.ts index d984c4bb7b3ff..872a51cf23f43 100644 --- a/packages/@aws-cdk/aws-dynamodb/lib/replica-provider.ts +++ b/packages/@aws-cdk/aws-dynamodb/lib/replica-provider.ts @@ -5,10 +5,6 @@ import { Duration, NestedStack, Stack } from '@aws-cdk/core'; import * as cr from '@aws-cdk/custom-resources'; import { Construct } from 'constructs'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Properties for a ReplicaProvider */ @@ -47,7 +43,7 @@ export class ReplicaProvider extends NestedStack { public readonly isCompleteHandler: lambda.Function; private constructor(scope: Construct, id: string, props: ReplicaProviderProps = {}) { - super(scope as CoreConstruct, id); + super(scope, id); const code = lambda.Code.fromAsset(path.join(__dirname, 'replica-handler')); diff --git a/packages/@aws-cdk/aws-dynamodb/lib/table.ts b/packages/@aws-cdk/aws-dynamodb/lib/table.ts index a958bf135546e..1be4708ebea34 100644 --- a/packages/@aws-cdk/aws-dynamodb/lib/table.ts +++ b/packages/@aws-cdk/aws-dynamodb/lib/table.ts @@ -14,10 +14,6 @@ import { ReplicaProvider } from './replica-provider'; import { EnableScalingProps, IScalableTableAttribute } from './scalable-attribute-api'; import { ScalableTableAttribute } from './scalable-table-attribute'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct as CoreConstruct } from '@aws-cdk/core'; - const HASH_KEY_TYPE = 'HASH'; const RANGE_KEY_TYPE = 'RANGE'; @@ -1144,6 +1140,8 @@ export class Table extends TableBase { if (props.replicationRegions && props.replicationRegions.length > 0) { this.createReplicaTables(props.replicationRegions, props.replicationTimeout); } + + this.node.addValidation({ validate: () => this.validateTable() }); } /** @@ -1303,7 +1301,7 @@ export class Table extends TableBase { * * @returns an array of validation error message */ - protected validate(): string[] { + private validateTable(): string[] { const errors = new Array(); if (!this.tablePartitionKey) { @@ -1675,7 +1673,7 @@ interface ScalableAttributePair { * policy resource), new permissions are in effect before clean up happens, and so replicas that * need to be dropped can no longer be due to lack of permissions. */ -class SourceTableAttachedPolicy extends CoreConstruct implements iam.IGrantable { +class SourceTableAttachedPolicy extends Construct implements iam.IGrantable { public readonly grantPrincipal: iam.IPrincipal; public readonly policy: iam.IManagedPolicy; diff --git a/packages/@aws-cdk/aws-dynamodb/package.json b/packages/@aws-cdk/aws-dynamodb/package.json index b0e4e4484ae37..7e96abe0585e2 100644 --- a/packages/@aws-cdk/aws-dynamodb/package.json +++ b/packages/@aws-cdk/aws-dynamodb/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-dynamodb", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::DynamoDB", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -91,7 +92,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -102,7 +103,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-dynamodb/test/dynamodb.test.ts b/packages/@aws-cdk/aws-dynamodb/test/dynamodb.test.ts index cddba2ff1504b..74190ea7b31d7 100644 --- a/packages/@aws-cdk/aws-dynamodb/test/dynamodb.test.ts +++ b/packages/@aws-cdk/aws-dynamodb/test/dynamodb.test.ts @@ -3,7 +3,7 @@ import '@aws-cdk/assert/jest'; import * as appscaling from '@aws-cdk/aws-applicationautoscaling'; import * as iam from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; -import { App, Aws, CfnDeletionPolicy, ConstructNode, Duration, PhysicalName, RemovalPolicy, Resource, Stack, Tags } from '@aws-cdk/core'; +import { App, Aws, CfnDeletionPolicy, Duration, PhysicalName, RemovalPolicy, Resource, Stack, Tags } from '@aws-cdk/core'; import * as cr from '@aws-cdk/custom-resources'; import { testLegacyBehavior } from 'cdk-build-tools/lib/feature-flag'; import { Construct } from 'constructs'; @@ -1302,10 +1302,10 @@ test('error when validating construct if a local secondary index exists without sortKey: LSI_SORT_KEY, }); - const errors = ConstructNode.validate(table.node); + const errors = table.node.validate(); expect(errors.length).toBe(1); - expect(errors[0]?.message).toBe('a sort key of the table must be specified to add local secondary indexes'); + expect(errors[0]).toBe('a sort key of the table must be specified to add local secondary indexes'); }); test('can enable Read AutoScaling', () => { diff --git a/packages/@aws-cdk/aws-ec2/lib/cfn-init.ts b/packages/@aws-cdk/aws-ec2/lib/cfn-init.ts index 910e7ab85cf7f..50a2501b01aba 100644 --- a/packages/@aws-cdk/aws-ec2/lib/cfn-init.ts +++ b/packages/@aws-cdk/aws-ec2/lib/cfn-init.ts @@ -8,7 +8,7 @@ import { UserData } from './user-data'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * A CloudFormation-init configuration diff --git a/packages/@aws-cdk/aws-ec2/lib/machine-image.ts b/packages/@aws-cdk/aws-ec2/lib/machine-image.ts index df4a1eece07e0..35e15f459318b 100644 --- a/packages/@aws-cdk/aws-ec2/lib/machine-image.ts +++ b/packages/@aws-cdk/aws-ec2/lib/machine-image.ts @@ -7,7 +7,7 @@ import { WindowsVersion } from './windows-versions'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Interface for classes that can select an appropriate machine image to use diff --git a/packages/@aws-cdk/aws-ec2/lib/private/cfn-init-internal.ts b/packages/@aws-cdk/aws-ec2/lib/private/cfn-init-internal.ts index ff7fc407eedf2..75e6c57175b93 100644 --- a/packages/@aws-cdk/aws-ec2/lib/private/cfn-init-internal.ts +++ b/packages/@aws-cdk/aws-ec2/lib/private/cfn-init-internal.ts @@ -1,5 +1,5 @@ import * as iam from '@aws-cdk/aws-iam'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * The type of the init element. diff --git a/packages/@aws-cdk/aws-ec2/lib/private/ebs-util.ts b/packages/@aws-cdk/aws-ec2/lib/private/ebs-util.ts index dc91f6d795011..14496f30fb144 100644 --- a/packages/@aws-cdk/aws-ec2/lib/private/ebs-util.ts +++ b/packages/@aws-cdk/aws-ec2/lib/private/ebs-util.ts @@ -4,7 +4,7 @@ import { BlockDevice, EbsDeviceVolumeType } from '../volume'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; export function instanceBlockDeviceMappings(construct: Construct, blockDevices: BlockDevice[]): CfnInstance.BlockDeviceMappingProperty[] { return synthesizeBlockDeviceMappings(construct, blockDevices, {}); diff --git a/packages/@aws-cdk/aws-ec2/lib/volume.ts b/packages/@aws-cdk/aws-ec2/lib/volume.ts index 64f920866a17b..2cf6f61fa41f3 100644 --- a/packages/@aws-cdk/aws-ec2/lib/volume.ts +++ b/packages/@aws-cdk/aws-ec2/lib/volume.ts @@ -7,11 +7,6 @@ import { Construct } from 'constructs'; import { CfnVolume } from './ec2.generated'; import { IInstance } from './instance'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - - /** * Block device */ @@ -511,7 +506,7 @@ abstract class VolumeBase extends Resource implements IVolume { // The ResourceTag condition requires that all resources involved in the operation have // the given tag, so we tag this and all constructs given. Tags.of(this).add(tagKey, tagValue); - constructs.forEach(construct => Tags.of(construct as CoreConstruct).add(tagKey, tagValue)); + constructs.forEach(construct => Tags.of(construct).add(tagKey, tagValue)); return result; } @@ -540,7 +535,7 @@ abstract class VolumeBase extends Resource implements IVolume { // The ResourceTag condition requires that all resources involved in the operation have // the given tag, so we tag this and all constructs given. Tags.of(this).add(tagKey, tagValue); - constructs.forEach(construct => Tags.of(construct as CoreConstruct).add(tagKey, tagValue)); + constructs.forEach(construct => Tags.of(construct).add(tagKey, tagValue)); return result; } diff --git a/packages/@aws-cdk/aws-ec2/lib/vpc-flow-logs.ts b/packages/@aws-cdk/aws-ec2/lib/vpc-flow-logs.ts index 498940fab878a..b10fc81c8e469 100644 --- a/packages/@aws-cdk/aws-ec2/lib/vpc-flow-logs.ts +++ b/packages/@aws-cdk/aws-ec2/lib/vpc-flow-logs.ts @@ -6,10 +6,6 @@ import { Construct } from 'constructs'; import { CfnFlowLog } from './ec2.generated'; import { ISubnet, IVpc } from './vpc'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * A FlowLog * @@ -140,7 +136,7 @@ export abstract class FlowLogDestination { /** * Generates a flow log destination configuration */ - public abstract bind(scope: CoreConstruct, flowLog: FlowLog): FlowLogDestinationConfig; + public abstract bind(scope: Construct, flowLog: FlowLog): FlowLogDestinationConfig; } /** @@ -193,7 +189,7 @@ class S3Destination extends FlowLogDestination { super(); } - public bind(scope: CoreConstruct, _flowLog: FlowLog): FlowLogDestinationConfig { + public bind(scope: Construct, _flowLog: FlowLog): FlowLogDestinationConfig { let s3Bucket: s3.IBucket; if (this.props.s3Bucket === undefined) { s3Bucket = new s3.Bucket(scope, 'Bucket', { @@ -219,7 +215,7 @@ class CloudWatchLogsDestination extends FlowLogDestination { super(); } - public bind(scope: CoreConstruct, _flowLog: FlowLog): FlowLogDestinationConfig { + public bind(scope: Construct, _flowLog: FlowLog): FlowLogDestinationConfig { let iamRole: iam.IRole; let logGroup: logs.ILogGroup; if (this.props.iamRole === undefined) { diff --git a/packages/@aws-cdk/aws-ec2/lib/vpc.ts b/packages/@aws-cdk/aws-ec2/lib/vpc.ts index 8d878dde26024..09d2819b3f0cf 100644 --- a/packages/@aws-cdk/aws-ec2/lib/vpc.ts +++ b/packages/@aws-cdk/aws-ec2/lib/vpc.ts @@ -1,10 +1,10 @@ import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import { - Annotations, ConcreteDependable, ContextProvider, DependableTrait, IConstruct, + Annotations, ConcreteDependable, ContextProvider, DependableTrait, IDependable, IResource, Lazy, Resource, Stack, Token, Tags, Names, } from '@aws-cdk/core'; import * as cxapi from '@aws-cdk/cx-api'; -import { Construct, Node } from 'constructs'; +import { Construct, IConstruct, Node } from 'constructs'; import { CfnEIP, CfnInternetGateway, CfnNatGateway, CfnRoute, CfnRouteTable, CfnSubnet, CfnSubnetRouteTableAssociation, CfnVPC, CfnVPCGatewayAttachment, CfnVPNGatewayRoutePropagation, @@ -19,10 +19,6 @@ import { FlowLog, FlowLogOptions, FlowLogResourceType } from './vpc-flow-logs'; import { VpcLookupOptions } from './vpc-lookup'; import { EnableVpnGatewayOptions, VpnConnection, VpnConnectionOptions, VpnConnectionType, VpnGateway } from './vpn'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - const VPC_SUBNET_SYMBOL = Symbol.for('@aws-cdk/aws-ec2.VpcSubnet'); export interface ISubnet extends IResource { @@ -1631,8 +1627,8 @@ export class Subnet extends Resource implements ISubnet { public associateNetworkAcl(id: string, networkAcl: INetworkAcl) { this._networkAcl = networkAcl; - const scope = CoreConstruct.isConstruct(networkAcl) ? networkAcl : this; - const other = CoreConstruct.isConstruct(networkAcl) ? this : networkAcl; + const scope = networkAcl instanceof Construct ? networkAcl : this; + const other = networkAcl instanceof Construct ? this : networkAcl; new SubnetNetworkAclAssociation(scope, id + Names.nodeUniqueId(other.node), { networkAcl, subnet: this, @@ -1991,8 +1987,8 @@ class ImportedSubnet extends Resource implements ISubnet, IPublicSubnet, IPrivat } public associateNetworkAcl(id: string, networkAcl: INetworkAcl): void { - const scope = CoreConstruct.isConstruct(networkAcl) ? networkAcl : this; - const other = CoreConstruct.isConstruct(networkAcl) ? this : networkAcl; + const scope = networkAcl instanceof Construct ? networkAcl : this; + const other = networkAcl instanceof Construct ? this : networkAcl; new SubnetNetworkAclAssociation(scope, id + Names.nodeUniqueId(other.node), { networkAcl, subnet: this, diff --git a/packages/@aws-cdk/aws-ec2/package.json b/packages/@aws-cdk/aws-ec2/package.json index e454bface8c4a..fd5eb2ce74abb 100644 --- a/packages/@aws-cdk/aws-ec2/package.json +++ b/packages/@aws-cdk/aws-ec2/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-ec2", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::EC2", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -92,7 +93,7 @@ "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -107,7 +108,7 @@ "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-ec2/test/integ.share-vpcs.lit.ts b/packages/@aws-cdk/aws-ec2/test/integ.share-vpcs.lit.ts index e7c65834019cc..805830d3f8fa8 100644 --- a/packages/@aws-cdk/aws-ec2/test/integ.share-vpcs.lit.ts +++ b/packages/@aws-cdk/aws-ec2/test/integ.share-vpcs.lit.ts @@ -1,12 +1,8 @@ /// !cdk-integ * import * as cdk from '@aws-cdk/core'; -import * as constructs from 'constructs'; +import { Construct } from 'constructs'; import * as ec2 from '../lib'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - const app = new cdk.App(); interface ConstructThatTakesAVpcProps { @@ -14,7 +10,7 @@ interface ConstructThatTakesAVpcProps { } class ConstructThatTakesAVpc extends Construct { - constructor(scope: constructs.Construct, id: string, _props: ConstructThatTakesAVpcProps) { + constructor(scope: Construct, id: string, _props: ConstructThatTakesAVpcProps) { super(scope, id); // new ec2.CfnInstance(this, 'Instance', { diff --git a/packages/@aws-cdk/aws-ecr-assets/lib/image-asset.ts b/packages/@aws-cdk/aws-ecr-assets/lib/image-asset.ts index 26a3a40f35335..7d7a8dbc61981 100644 --- a/packages/@aws-cdk/aws-ecr-assets/lib/image-asset.ts +++ b/packages/@aws-cdk/aws-ecr-assets/lib/image-asset.ts @@ -4,11 +4,10 @@ import * as assets from '@aws-cdk/assets'; import * as ecr from '@aws-cdk/aws-ecr'; import { Annotations, FeatureFlags, IgnoreMode, Stack, Token } from '@aws-cdk/core'; import * as cxapi from '@aws-cdk/cx-api'; -import { Construct } from 'constructs'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct as CoreConstruct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Options for DockerImageAsset @@ -69,7 +68,7 @@ export interface DockerImageAssetProps extends DockerImageAssetOptions { * * The image will be created in build time and uploaded to an ECR repository. */ -export class DockerImageAsset extends CoreConstruct implements assets.IAsset { +export class DockerImageAsset extends Construct implements assets.IAsset { /** * The full URI of the image (including a tag). Use this reference to pull * the asset. diff --git a/packages/@aws-cdk/aws-ecr-assets/package.json b/packages/@aws-cdk/aws-ecr-assets/package.json index 3d8b54ee08122..713989333b31f 100644 --- a/packages/@aws-cdk/aws-ecr-assets/package.json +++ b/packages/@aws-cdk/aws-ecr-assets/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-ecr-assets", "version": "0.0.0", + "private": true, "description": "Docker image assets deployed to ECR", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,7 +82,7 @@ "@aws-cdk/assets": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "minimatch": "^3.0.4", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -91,7 +92,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "nyc": { "statements": 70 diff --git a/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-docker.ts b/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-docker.ts index d6c4c2aac75b7..9212e350f8c8c 100644 --- a/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-docker.ts +++ b/packages/@aws-cdk/aws-ecr-assets/test/integ.assets-docker.ts @@ -1,14 +1,9 @@ import * as path from 'path'; import * as iam from '@aws-cdk/aws-iam'; import * as cdk from '@aws-cdk/core'; -import * as cxapi from '@aws-cdk/cx-api'; import * as assets from '../lib'; -const app = new cdk.App({ - context: { - [cxapi.DOCKER_IGNORE_SUPPORT]: true, - }, -}); +const app = new cdk.App(); const stack = new cdk.Stack(app, 'integ-assets-docker'); const asset = new assets.DockerImageAsset(stack, 'DockerImage', { diff --git a/packages/@aws-cdk/aws-ecr-assets/test/integ.nested-stacks-docker.ts b/packages/@aws-cdk/aws-ecr-assets/test/integ.nested-stacks-docker.ts index 394fedc07ddf6..83d71192e18f4 100644 --- a/packages/@aws-cdk/aws-ecr-assets/test/integ.nested-stacks-docker.ts +++ b/packages/@aws-cdk/aws-ecr-assets/test/integ.nested-stacks-docker.ts @@ -1,7 +1,6 @@ import * as path from 'path'; import * as iam from '@aws-cdk/aws-iam'; import { App, CfnOutput, NestedStack, NestedStackProps, Stack, StackProps } from '@aws-cdk/core'; -import * as cxapi from '@aws-cdk/cx-api'; import { Construct } from 'constructs'; import * as ecr_assets from '../lib'; @@ -28,10 +27,6 @@ class TheParentStack extends Stack { } } -const app = new App({ - context: { - [cxapi.DOCKER_IGNORE_SUPPORT]: true, - }, -}); +const app = new App(); new TheParentStack(app, 'nested-stacks-docker'); app.synth(); diff --git a/packages/@aws-cdk/aws-ecr/lib/repository.ts b/packages/@aws-cdk/aws-ecr/lib/repository.ts index 3734db8176d36..3b62d2a8b794a 100644 --- a/packages/@aws-cdk/aws-ecr/lib/repository.ts +++ b/packages/@aws-cdk/aws-ecr/lib/repository.ts @@ -475,6 +475,8 @@ export class Repository extends RepositoryBase { resource: 'repository', resourceName: this.physicalName, }); + + this.node.addValidation({ validate: () => this.policyDocument?.validateForResourcePolicy() ?? [] }); } public addToResourcePolicy(statement: iam.PolicyStatement): iam.AddToResourcePolicyResult { @@ -485,12 +487,6 @@ export class Repository extends RepositoryBase { return { statementAdded: false, policyDependable: this.policyDocument }; } - protected validate(): string[] { - const errors = super.validate(); - errors.push(...this.policyDocument?.validateForResourcePolicy() || []); - return errors; - } - /** * Add a life cycle rule to the repository * diff --git a/packages/@aws-cdk/aws-ecr/package.json b/packages/@aws-cdk/aws-ecr/package.json index bc3671a7c5585..d833b8f8a0b44 100644 --- a/packages/@aws-cdk/aws-ecr/package.json +++ b/packages/@aws-cdk/aws-ecr/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-ecr", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::ECR", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -86,14 +87,14 @@ "@aws-cdk/aws-events": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-events": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/base/application-load-balanced-service-base.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/base/application-load-balanced-service-base.ts index 2593853cd0350..a380d77a2a91f 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/base/application-load-balanced-service-base.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/base/application-load-balanced-service-base.ts @@ -14,10 +14,6 @@ import { LoadBalancerTarget } from '@aws-cdk/aws-route53-targets'; import * as cdk from '@aws-cdk/core'; import { Construct } from 'constructs'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Describes the type of DNS record the service should create */ @@ -323,7 +319,8 @@ export interface ApplicationLoadBalancedTaskImageOptions { /** * The base class for ApplicationLoadBalancedEc2Service and ApplicationLoadBalancedFargateService services. */ -export abstract class ApplicationLoadBalancedServiceBase extends CoreConstruct { +export abstract class ApplicationLoadBalancedServiceBase extends Construct { + /** * The desired number of instantiations of the task definition to keep running on the service. * @deprecated - Use `internalDesiredCount` instead. @@ -491,7 +488,7 @@ export abstract class ApplicationLoadBalancedServiceBase extends CoreConstruct { /** * Returns the default cluster. */ - protected getDefaultCluster(scope: CoreConstruct, vpc?: IVpc): Cluster { + protected getDefaultCluster(scope: Construct, vpc?: IVpc): Cluster { // magic string to avoid collision with user-defined constructs const DEFAULT_CLUSTER_ID = `EcsDefaultClusterMnL3mNNYN${vpc ? vpc.node.id : ''}`; const stack = cdk.Stack.of(scope); diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/base/application-multiple-target-groups-service-base.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/base/application-multiple-target-groups-service-base.ts index ff3fc675fcd69..e801b8797d13b 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/base/application-multiple-target-groups-service-base.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/base/application-multiple-target-groups-service-base.ts @@ -11,10 +11,6 @@ import { LoadBalancerTarget } from '@aws-cdk/aws-route53-targets'; import { CfnOutput, Duration, Stack } from '@aws-cdk/core'; import { Construct } from 'constructs'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * The properties for the base ApplicationMultipleTargetGroupsEc2Service or ApplicationMultipleTargetGroupsFargateService service. */ @@ -330,7 +326,8 @@ export interface ApplicationListenerProps { /** * The base class for ApplicationMultipleTargetGroupsEc2Service and ApplicationMultipleTargetGroupsFargateService classes. */ -export abstract class ApplicationMultipleTargetGroupsServiceBase extends CoreConstruct { +export abstract class ApplicationMultipleTargetGroupsServiceBase extends Construct { + /** * The desired number of instantiations of the task definition to keep running on the service. * @deprecated - Use `internalDesiredCount` instead. diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/base/network-load-balanced-service-base.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/base/network-load-balanced-service-base.ts index 5872217a43f22..f04ca581f14cb 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/base/network-load-balanced-service-base.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/base/network-load-balanced-service-base.ts @@ -10,10 +10,6 @@ import { LoadBalancerTarget } from '@aws-cdk/aws-route53-targets'; import * as cdk from '@aws-cdk/core'; import { Construct } from 'constructs'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Describes the type of DNS record the service should create */ @@ -272,7 +268,7 @@ export interface NetworkLoadBalancedTaskImageOptions { /** * The base class for NetworkLoadBalancedEc2Service and NetworkLoadBalancedFargateService services. */ -export abstract class NetworkLoadBalancedServiceBase extends CoreConstruct { +export abstract class NetworkLoadBalancedServiceBase extends Construct { /** * The desired number of instantiations of the task definition to keep running on the service. * @deprecated - Use `internalDesiredCount` instead. @@ -384,7 +380,7 @@ export abstract class NetworkLoadBalancedServiceBase extends CoreConstruct { /** * Returns the default cluster. */ - protected getDefaultCluster(scope: CoreConstruct, vpc?: IVpc): Cluster { + protected getDefaultCluster(scope: Construct, vpc?: IVpc): Cluster { // magic string to avoid collision with user-defined constructs const DEFAULT_CLUSTER_ID = `EcsDefaultClusterMnL3mNNYN${vpc ? vpc.node.id : ''}`; const stack = cdk.Stack.of(scope); diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/base/network-multiple-target-groups-service-base.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/base/network-multiple-target-groups-service-base.ts index 60fd9904b8078..a6ad1a6d3a53f 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/base/network-multiple-target-groups-service-base.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/base/network-multiple-target-groups-service-base.ts @@ -10,10 +10,6 @@ import { LoadBalancerTarget } from '@aws-cdk/aws-route53-targets'; import { CfnOutput, Duration, Stack } from '@aws-cdk/core'; import { Construct } from 'constructs'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * The properties for the base NetworkMultipleTargetGroupsEc2Service or NetworkMultipleTargetGroupsFargateService service. */ @@ -263,7 +259,7 @@ export interface NetworkTargetProps { /** * The base class for NetworkMultipleTargetGroupsEc2Service and NetworkMultipleTargetGroupsFargateService classes. */ -export abstract class NetworkMultipleTargetGroupsServiceBase extends CoreConstruct { +export abstract class NetworkMultipleTargetGroupsServiceBase extends Construct { /** * The desired number of instantiations of the task definition to keep running on the service. * @deprecated - Use `internalDesiredCount` instead. diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/base/queue-processing-service-base.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/base/queue-processing-service-base.ts index 7ec268c241249..6bad39534ccc4 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/base/queue-processing-service-base.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/base/queue-processing-service-base.ts @@ -9,10 +9,6 @@ import { CfnOutput, Duration, Stack } from '@aws-cdk/core'; import * as cxapi from '@aws-cdk/cx-api'; import { Construct } from 'constructs'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * The properties for the base QueueProcessingEc2Service or QueueProcessingFargateService service. */ @@ -204,7 +200,7 @@ export interface QueueProcessingServiceBaseProps { /** * The base class for QueueProcessingEc2Service and QueueProcessingFargateService services. */ -export abstract class QueueProcessingServiceBase extends CoreConstruct { +export abstract class QueueProcessingServiceBase extends Construct { /** * The SQS queue that the service will process from */ diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/base/scheduled-task-base.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/base/scheduled-task-base.ts index 7dc6492f42919..66a1632a65304 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/base/scheduled-task-base.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/base/scheduled-task-base.ts @@ -6,10 +6,6 @@ import { EcsTask } from '@aws-cdk/aws-events-targets'; import { Stack } from '@aws-cdk/core'; import { Construct } from 'constructs'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * The properties for the base ScheduledEc2Task or ScheduledFargateTask task. */ @@ -112,7 +108,7 @@ export interface ScheduledTaskImageProps { /** * The base class for ScheduledEc2Task and ScheduledFargateTask tasks. */ -export abstract class ScheduledTaskBase extends CoreConstruct { +export abstract class ScheduledTaskBase extends Construct { /** * The name of the cluster that hosts the service. */ @@ -190,7 +186,7 @@ export abstract class ScheduledTaskBase extends CoreConstruct { /** * Returns the default cluster. */ - protected getDefaultCluster(scope: CoreConstruct, vpc?: IVpc): Cluster { + protected getDefaultCluster(scope: Construct, vpc?: IVpc): Cluster { // magic string to avoid collision with user-defined constructs const DEFAULT_CLUSTER_ID = `EcsDefaultClusterMnL3mNNYN${vpc ? vpc.node.id : ''}`; const stack = Stack.of(scope); diff --git a/packages/@aws-cdk/aws-ecs-patterns/package.json b/packages/@aws-cdk/aws-ecs-patterns/package.json index dcb4d8b436bda..b7b9d801c94a6 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/package.json +++ b/packages/@aws-cdk/aws-ecs-patterns/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-ecs-patterns", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::ECS", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -87,7 +88,7 @@ "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -105,7 +106,7 @@ "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-ecs/lib/base/task-definition.ts b/packages/@aws-cdk/aws-ecs/lib/base/task-definition.ts index 7c3bb618142a5..29cab053ec4b7 100644 --- a/packages/@aws-cdk/aws-ecs/lib/base/task-definition.ts +++ b/packages/@aws-cdk/aws-ecs/lib/base/task-definition.ts @@ -387,6 +387,7 @@ export class TaskDefinition extends TaskDefinitionBase { } this.taskDefinitionArn = taskDef.ref; + this.node.addValidation({ validate: () => this.validateTaskDefinition() }); } public get executionRole(): iam.IRole | undefined { @@ -554,8 +555,8 @@ export class TaskDefinition extends TaskDefinitionBase { /** * Validates the task definition. */ - protected validate(): string[] { - const ret = super.validate(); + private validateTaskDefinition(): string[] { + const ret = new Array(); if (isEc2Compatible(this.compatibility)) { // EC2 mode validations diff --git a/packages/@aws-cdk/aws-ecs/lib/cluster.ts b/packages/@aws-cdk/aws-ecs/lib/cluster.ts index c60fc9f4b1dee..6c43665fec79d 100644 --- a/packages/@aws-cdk/aws-ecs/lib/cluster.ts +++ b/packages/@aws-cdk/aws-ecs/lib/cluster.ts @@ -11,10 +11,6 @@ import { InstanceDrainHook } from './drain-hook/instance-drain-hook'; import { ECSMetrics } from './ecs-canned-metrics.generated'; import { CfnCluster } from './ecs.generated'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * The properties used to define an ECS cluster. */ @@ -548,7 +544,7 @@ export class EcsOptimizedAmi implements ec2.IMachineImage { /** * Return the correct image */ - public getImage(scope: CoreConstruct): ec2.MachineImageConfig { + public getImage(scope: Construct): ec2.MachineImageConfig { const ami = ssm.StringParameter.valueForTypedStringParameter(scope, this.amiParameterName, ssm.ParameterType.AWS_EC2_IMAGE_ID); const osType = this.windowsVersion ? ec2.OperatingSystemType.WINDOWS : ec2.OperatingSystemType.LINUX; return { @@ -621,7 +617,7 @@ export class EcsOptimizedImage implements ec2.IMachineImage { /** * Return the correct image */ - public getImage(scope: CoreConstruct): ec2.MachineImageConfig { + public getImage(scope: Construct): ec2.MachineImageConfig { const ami = ssm.StringParameter.valueForTypedStringParameter(scope, this.amiParameterName, ssm.ParameterType.AWS_EC2_IMAGE_ID); const osType = this.windowsVersion ? ec2.OperatingSystemType.WINDOWS : ec2.OperatingSystemType.LINUX; return { @@ -679,7 +675,7 @@ export class BottleRocketImage implements ec2.IMachineImage { /** * Return the correct image */ - public getImage(scope: CoreConstruct): ec2.MachineImageConfig { + public getImage(scope: Construct): ec2.MachineImageConfig { const ami = ssm.StringParameter.valueForStringParameter(scope, this.amiParameterName); return { imageId: ami, diff --git a/packages/@aws-cdk/aws-ecs/lib/container-definition.ts b/packages/@aws-cdk/aws-ecs/lib/container-definition.ts index 9911a49a039cf..0fbf07044b510 100644 --- a/packages/@aws-cdk/aws-ecs/lib/container-definition.ts +++ b/packages/@aws-cdk/aws-ecs/lib/container-definition.ts @@ -10,10 +10,6 @@ import { EnvironmentFile, EnvironmentFileConfig } from './environment-file'; import { LinuxParameters } from './linux-parameters'; import { LogDriver, LogDriverConfig } from './log-drivers/log-driver'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * A secret environment variable. */ @@ -311,7 +307,7 @@ export interface ContainerDefinitionProps extends ContainerDefinitionOptions { /** * A container definition is used in a task definition to describe the containers that are launched as part of a task. */ -export class ContainerDefinition extends CoreConstruct { +export class ContainerDefinition extends Construct { /** * The Linux-specific modifications that are applied to the container, such as Linux kernel capabilities. */ diff --git a/packages/@aws-cdk/aws-ecs/lib/container-image.ts b/packages/@aws-cdk/aws-ecs/lib/container-image.ts index 52ca23dcb5aed..b2a01fca50d4e 100644 --- a/packages/@aws-cdk/aws-ecs/lib/container-image.ts +++ b/packages/@aws-cdk/aws-ecs/lib/container-image.ts @@ -1,11 +1,8 @@ import * as ecr from '@aws-cdk/aws-ecr'; +import { Construct } from 'constructs'; import { ContainerDefinition } from './container-definition'; import { CfnTaskDefinition } from './ecs.generated'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Constructs for types of container images */ @@ -43,7 +40,7 @@ export abstract class ContainerImage { */ public static fromDockerImageAsset(asset: DockerImageAsset): ContainerImage { return { - bind(_scope: CoreConstruct, containerDefinition: ContainerDefinition): ContainerImageConfig { + bind(_scope: Construct, containerDefinition: ContainerDefinition): ContainerImageConfig { asset.repository.grantPull(containerDefinition.taskDefinition.obtainExecutionRole()); return { imageName: asset.imageUri, @@ -55,7 +52,7 @@ export abstract class ContainerImage { /** * Called when the image is used by a ContainerDefinition */ - public abstract bind(scope: CoreConstruct, containerDefinition: ContainerDefinition): ContainerImageConfig; + public abstract bind(scope: Construct, containerDefinition: ContainerDefinition): ContainerImageConfig; } /** @@ -77,3 +74,4 @@ import { DockerImageAsset } from '@aws-cdk/aws-ecr-assets'; import { AssetImage, AssetImageProps } from './images/asset-image'; import { EcrImage } from './images/ecr'; import { RepositoryImage, RepositoryImageProps } from './images/repository'; + diff --git a/packages/@aws-cdk/aws-ecs/lib/drain-hook/instance-drain-hook.ts b/packages/@aws-cdk/aws-ecs/lib/drain-hook/instance-drain-hook.ts index cb0f9a57d6288..eda62a301dfe0 100644 --- a/packages/@aws-cdk/aws-ecs/lib/drain-hook/instance-drain-hook.ts +++ b/packages/@aws-cdk/aws-ecs/lib/drain-hook/instance-drain-hook.ts @@ -9,10 +9,6 @@ import * as cdk from '@aws-cdk/core'; import { Construct } from 'constructs'; import { ICluster } from '../cluster'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct as CoreConstruct } from '@aws-cdk/core'; - // Reference for the source in this package: // // https://github.com/aws-samples/ecs-refarch-cloudformation/blob/master/infrastructure/lifecyclehook.yaml @@ -53,7 +49,7 @@ export interface InstanceDrainHookProps { /** * A hook to drain instances from ECS traffic before they're terminated */ -export class InstanceDrainHook extends CoreConstruct { +export class InstanceDrainHook extends Construct { /** * Constructs a new instance of the InstanceDrainHook class. diff --git a/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts b/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts index 4cf4de8a83292..ad027e669ebd4 100644 --- a/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts +++ b/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts @@ -232,6 +232,8 @@ export class Ec2Service extends BaseService implements IEc2Service { this.node.addValidation({ validate: () => !this.taskDefinition.defaultContainer ? ['A TaskDefinition must have at least one essential container'] : [], }); + + this.node.addValidation({ validate: this.validateEc2Service.bind(this) }); } /** @@ -261,8 +263,8 @@ export class Ec2Service extends BaseService implements IEc2Service { /** * Validates this Ec2Service. */ - protected validate(): string[] { - const ret = super.validate(); + private validateEc2Service(): string[] { + const ret = new Array(); if (!this.cluster.hasEc2Capacity) { ret.push('Cluster for this service needs Ec2 capacity. Call addXxxCapacity() on the cluster.'); } diff --git a/packages/@aws-cdk/aws-ecs/lib/environment-file.ts b/packages/@aws-cdk/aws-ecs/lib/environment-file.ts index 0a5c8bb9de9cb..daaaf7db98d78 100644 --- a/packages/@aws-cdk/aws-ecs/lib/environment-file.ts +++ b/packages/@aws-cdk/aws-ecs/lib/environment-file.ts @@ -1,6 +1,6 @@ import { IBucket, Location } from '@aws-cdk/aws-s3'; import { Asset, AssetOptions } from '@aws-cdk/aws-s3-assets'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Constructs for types of environment files diff --git a/packages/@aws-cdk/aws-ecs/lib/images/asset-image.ts b/packages/@aws-cdk/aws-ecs/lib/images/asset-image.ts index c17f56d7cfdee..2b2a9e039bdb9 100644 --- a/packages/@aws-cdk/aws-ecs/lib/images/asset-image.ts +++ b/packages/@aws-cdk/aws-ecs/lib/images/asset-image.ts @@ -1,11 +1,8 @@ import { DockerImageAsset, DockerImageAssetOptions } from '@aws-cdk/aws-ecr-assets'; +import { Construct } from 'constructs'; import { ContainerDefinition } from '../container-definition'; import { ContainerImage, ContainerImageConfig } from '../container-image'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * The properties for building an AssetImage. */ @@ -25,7 +22,7 @@ export class AssetImage extends ContainerImage { super(); } - public bind(scope: CoreConstruct, containerDefinition: ContainerDefinition): ContainerImageConfig { + public bind(scope: Construct, containerDefinition: ContainerDefinition): ContainerImageConfig { const asset = new DockerImageAsset(scope, 'AssetImage', { directory: this.directory, ...this.props, diff --git a/packages/@aws-cdk/aws-ecs/lib/images/ecr.ts b/packages/@aws-cdk/aws-ecs/lib/images/ecr.ts index b9786f13e2816..a8a98b0932a56 100644 --- a/packages/@aws-cdk/aws-ecs/lib/images/ecr.ts +++ b/packages/@aws-cdk/aws-ecs/lib/images/ecr.ts @@ -1,11 +1,8 @@ import * as ecr from '@aws-cdk/aws-ecr'; +import { Construct } from 'constructs'; import { ContainerDefinition } from '../container-definition'; import { ContainerImage, ContainerImageConfig } from '../container-image'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * An image from an Amazon ECR repository. */ @@ -32,7 +29,7 @@ export class EcrImage extends ContainerImage { } } - public bind(_scope: CoreConstruct, containerDefinition: ContainerDefinition): ContainerImageConfig { + public bind(_scope: Construct, containerDefinition: ContainerDefinition): ContainerImageConfig { this.repository.grantPull(containerDefinition.taskDefinition.obtainExecutionRole()); return { diff --git a/packages/@aws-cdk/aws-ecs/lib/images/repository.ts b/packages/@aws-cdk/aws-ecs/lib/images/repository.ts index bf014fb18cb68..7e232a8cbdf36 100644 --- a/packages/@aws-cdk/aws-ecs/lib/images/repository.ts +++ b/packages/@aws-cdk/aws-ecs/lib/images/repository.ts @@ -1,12 +1,9 @@ import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; import { Annotations, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ContainerDefinition } from '../container-definition'; import { ContainerImage, ContainerImageConfig } from '../container-image'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Regex pattern to check if it is an ECR image URL. * @@ -38,7 +35,7 @@ export class RepositoryImage extends ContainerImage { super(); } - public bind(scope: CoreConstruct, containerDefinition: ContainerDefinition): ContainerImageConfig { + public bind(scope: Construct, containerDefinition: ContainerDefinition): ContainerImageConfig { // name could be a Token - in that case, skip validation altogether if (!Token.isUnresolved(this.imageName) && ECR_IMAGE_REGEX.test(this.imageName)) { Annotations.of(scope).addWarning("Proper policies need to be attached before pulling from ECR repository, or use 'fromEcrRepository'."); diff --git a/packages/@aws-cdk/aws-ecs/lib/images/tag-parameter-container-image.ts b/packages/@aws-cdk/aws-ecs/lib/images/tag-parameter-container-image.ts index c6479f44b951b..f232aa3932b54 100644 --- a/packages/@aws-cdk/aws-ecs/lib/images/tag-parameter-container-image.ts +++ b/packages/@aws-cdk/aws-ecs/lib/images/tag-parameter-container-image.ts @@ -1,12 +1,9 @@ import * as ecr from '@aws-cdk/aws-ecr'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ContainerDefinition } from '../container-definition'; import { ContainerImage, ContainerImageConfig } from '../container-image'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - /** * A special type of {@link ContainerImage} that uses an ECR repository for the image, * but a CloudFormation Parameter for the tag of the image in that repository. diff --git a/packages/@aws-cdk/aws-ecs/lib/linux-parameters.ts b/packages/@aws-cdk/aws-ecs/lib/linux-parameters.ts index b83b208552b95..7185527184694 100644 --- a/packages/@aws-cdk/aws-ecs/lib/linux-parameters.ts +++ b/packages/@aws-cdk/aws-ecs/lib/linux-parameters.ts @@ -2,10 +2,6 @@ import * as cdk from '@aws-cdk/core'; import { Construct } from 'constructs'; import { CfnTaskDefinition } from './ecs.generated'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * The properties for defining Linux-specific options that are applied to the container. */ @@ -28,7 +24,7 @@ export interface LinuxParametersProps { /** * Linux-specific options that are applied to the container. */ -export class LinuxParameters extends CoreConstruct { +export class LinuxParameters extends Construct { /** * Whether the init process is enabled */ diff --git a/packages/@aws-cdk/aws-ecs/lib/log-drivers/aws-log-driver.ts b/packages/@aws-cdk/aws-ecs/lib/log-drivers/aws-log-driver.ts index 705c4ed7fcb72..dffe40822281f 100644 --- a/packages/@aws-cdk/aws-ecs/lib/log-drivers/aws-log-driver.ts +++ b/packages/@aws-cdk/aws-ecs/lib/log-drivers/aws-log-driver.ts @@ -1,13 +1,10 @@ import * as logs from '@aws-cdk/aws-logs'; import { Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ContainerDefinition } from '../container-definition'; import { LogDriver, LogDriverConfig } from './log-driver'; import { removeEmpty } from './utils'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Specifies the awslogs log driver configuration options. */ @@ -91,7 +88,7 @@ export class AwsLogDriver extends LogDriver { /** * Called when the log driver is configured on a container */ - public bind(scope: CoreConstruct, containerDefinition: ContainerDefinition): LogDriverConfig { + public bind(scope: Construct, containerDefinition: ContainerDefinition): LogDriverConfig { this.logGroup = this.props.logGroup || new logs.LogGroup(scope, 'LogGroup', { retention: this.props.logRetention || Infinity, }); diff --git a/packages/@aws-cdk/aws-ecs/lib/log-drivers/firelens-log-driver.ts b/packages/@aws-cdk/aws-ecs/lib/log-drivers/firelens-log-driver.ts index caba29cafaf3a..a664ea63de9c3 100644 --- a/packages/@aws-cdk/aws-ecs/lib/log-drivers/firelens-log-driver.ts +++ b/packages/@aws-cdk/aws-ecs/lib/log-drivers/firelens-log-driver.ts @@ -1,12 +1,9 @@ +import { Construct } from 'constructs'; import { ContainerDefinition } from '../container-definition'; import { BaseLogDriverProps } from './base-log-driver'; import { LogDriver, LogDriverConfig } from './log-driver'; import { removeEmpty } from './utils'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Specifies the firelens log driver configuration options. */ @@ -42,7 +39,7 @@ export class FireLensLogDriver extends LogDriver { /** * Called when the log driver is configured on a container */ - public bind(_scope: CoreConstruct, _containerDefinition: ContainerDefinition): LogDriverConfig { + public bind(_scope: Construct, _containerDefinition: ContainerDefinition): LogDriverConfig { return { logDriver: 'awsfirelens', ...(this.options && { options: removeEmpty(this.options) }), diff --git a/packages/@aws-cdk/aws-ecs/lib/log-drivers/fluentd-log-driver.ts b/packages/@aws-cdk/aws-ecs/lib/log-drivers/fluentd-log-driver.ts index 30800bb022b86..26f33c16f84e6 100644 --- a/packages/@aws-cdk/aws-ecs/lib/log-drivers/fluentd-log-driver.ts +++ b/packages/@aws-cdk/aws-ecs/lib/log-drivers/fluentd-log-driver.ts @@ -1,13 +1,10 @@ import { Duration } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ContainerDefinition } from '../container-definition'; import { BaseLogDriverProps } from './base-log-driver'; import { LogDriver, LogDriverConfig } from './log-driver'; import { renderCommonLogDriverOptions, stringifyOptions } from './utils'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Specifies the fluentd log driver configuration options. * @@ -76,7 +73,7 @@ export class FluentdLogDriver extends LogDriver { /** * Called when the log driver is configured on a container */ - public bind(_scope: CoreConstruct, _containerDefinition: ContainerDefinition): LogDriverConfig { + public bind(_scope: Construct, _containerDefinition: ContainerDefinition): LogDriverConfig { return { logDriver: 'fluentd', options: stringifyOptions({ diff --git a/packages/@aws-cdk/aws-ecs/lib/log-drivers/gelf-log-driver.ts b/packages/@aws-cdk/aws-ecs/lib/log-drivers/gelf-log-driver.ts index 120bcb0d4545f..e16d499ff3c63 100644 --- a/packages/@aws-cdk/aws-ecs/lib/log-drivers/gelf-log-driver.ts +++ b/packages/@aws-cdk/aws-ecs/lib/log-drivers/gelf-log-driver.ts @@ -1,13 +1,10 @@ import { Duration } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ContainerDefinition } from '../container-definition'; import { BaseLogDriverProps } from './base-log-driver'; import { LogDriver, LogDriverConfig } from './log-driver'; import { ensureInRange, ensurePositiveInteger, renderCommonLogDriverOptions, stringifyOptions } from './utils'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * The type of compression the GELF driver uses to compress each log message. */ @@ -88,7 +85,7 @@ export class GelfLogDriver extends LogDriver { /** * Called when the log driver is configured on a container */ - public bind(_scope: CoreConstruct, _containerDefinition: ContainerDefinition): LogDriverConfig { + public bind(_scope: Construct, _containerDefinition: ContainerDefinition): LogDriverConfig { return { logDriver: 'gelf', options: stringifyOptions({ diff --git a/packages/@aws-cdk/aws-ecs/lib/log-drivers/generic-log-driver.ts b/packages/@aws-cdk/aws-ecs/lib/log-drivers/generic-log-driver.ts index 7389887afddd0..90e7b5a005d28 100644 --- a/packages/@aws-cdk/aws-ecs/lib/log-drivers/generic-log-driver.ts +++ b/packages/@aws-cdk/aws-ecs/lib/log-drivers/generic-log-driver.ts @@ -1,11 +1,8 @@ +import { Construct } from 'constructs'; import { ContainerDefinition } from '../container-definition'; import { LogDriver, LogDriverConfig } from '../index'; import { removeEmpty } from './utils'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * The configuration to use when creating a log driver. */ @@ -64,7 +61,7 @@ export class GenericLogDriver extends LogDriver { /** * Called when the log driver is configured on a container. */ - public bind(_scope: CoreConstruct, _containerDefinition: ContainerDefinition): LogDriverConfig { + public bind(_scope: Construct, _containerDefinition: ContainerDefinition): LogDriverConfig { return { logDriver: this.logDriver, options: removeEmpty(this.options), diff --git a/packages/@aws-cdk/aws-ecs/lib/log-drivers/journald-log-driver.ts b/packages/@aws-cdk/aws-ecs/lib/log-drivers/journald-log-driver.ts index 2f958dc00dc33..80eb842c06f0a 100644 --- a/packages/@aws-cdk/aws-ecs/lib/log-drivers/journald-log-driver.ts +++ b/packages/@aws-cdk/aws-ecs/lib/log-drivers/journald-log-driver.ts @@ -1,12 +1,9 @@ +import { Construct } from 'constructs'; import { ContainerDefinition } from '../container-definition'; import { BaseLogDriverProps } from './base-log-driver'; import { LogDriver, LogDriverConfig } from './log-driver'; import { renderCommonLogDriverOptions, stringifyOptions } from './utils'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Specifies the journald log driver configuration options. * @@ -30,7 +27,7 @@ export class JournaldLogDriver extends LogDriver { /** * Called when the log driver is configured on a container */ - public bind(_scope: CoreConstruct, _containerDefinition: ContainerDefinition): LogDriverConfig { + public bind(_scope: Construct, _containerDefinition: ContainerDefinition): LogDriverConfig { return { logDriver: 'journald', options: stringifyOptions({ diff --git a/packages/@aws-cdk/aws-ecs/lib/log-drivers/json-file-log-driver.ts b/packages/@aws-cdk/aws-ecs/lib/log-drivers/json-file-log-driver.ts index 75652cfd416ae..d5a5ee2d0651c 100644 --- a/packages/@aws-cdk/aws-ecs/lib/log-drivers/json-file-log-driver.ts +++ b/packages/@aws-cdk/aws-ecs/lib/log-drivers/json-file-log-driver.ts @@ -1,12 +1,9 @@ +import { Construct } from 'constructs'; import { ContainerDefinition } from '../container-definition'; import { BaseLogDriverProps } from './base-log-driver'; import { LogDriver, LogDriverConfig } from './log-driver'; import { joinWithCommas, stringifyOptions } from './utils'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Specifies the json-file log driver configuration options. * @@ -59,7 +56,7 @@ export class JsonFileLogDriver extends LogDriver { /** * Called when the log driver is configured on a container */ - public bind(_scope: CoreConstruct, _containerDefinition: ContainerDefinition): LogDriverConfig { + public bind(_scope: Construct, _containerDefinition: ContainerDefinition): LogDriverConfig { return { logDriver: 'json-file', options: stringifyOptions({ diff --git a/packages/@aws-cdk/aws-ecs/lib/log-drivers/log-driver.ts b/packages/@aws-cdk/aws-ecs/lib/log-drivers/log-driver.ts index 59d7bfe6e417a..ce7cc80f1e677 100644 --- a/packages/@aws-cdk/aws-ecs/lib/log-drivers/log-driver.ts +++ b/packages/@aws-cdk/aws-ecs/lib/log-drivers/log-driver.ts @@ -1,10 +1,7 @@ +import { Construct } from 'constructs'; import { ContainerDefinition } from '../container-definition'; import { AwsLogDriver, AwsLogDriverProps } from './aws-log-driver'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * The base class for log drivers. */ @@ -19,7 +16,7 @@ export abstract class LogDriver { /** * Called when the log driver is configured on a container */ - public abstract bind(scope: CoreConstruct, containerDefinition: ContainerDefinition): LogDriverConfig; + public abstract bind(scope: Construct, containerDefinition: ContainerDefinition): LogDriverConfig; } /** diff --git a/packages/@aws-cdk/aws-ecs/lib/log-drivers/splunk-log-driver.ts b/packages/@aws-cdk/aws-ecs/lib/log-drivers/splunk-log-driver.ts index ecb4d9f0dd9c1..ee630695cf11c 100644 --- a/packages/@aws-cdk/aws-ecs/lib/log-drivers/splunk-log-driver.ts +++ b/packages/@aws-cdk/aws-ecs/lib/log-drivers/splunk-log-driver.ts @@ -1,13 +1,10 @@ import { SecretValue } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ContainerDefinition } from '../container-definition'; import { BaseLogDriverProps } from './base-log-driver'; import { LogDriver, LogDriverConfig } from './log-driver'; import { ensureInRange, renderCommonLogDriverOptions, stringifyOptions } from './utils'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Log Message Format */ @@ -129,7 +126,7 @@ export class SplunkLogDriver extends LogDriver { /** * Called when the log driver is configured on a container */ - public bind(_scope: CoreConstruct, _containerDefinition: ContainerDefinition): LogDriverConfig { + public bind(_scope: Construct, _containerDefinition: ContainerDefinition): LogDriverConfig { return { logDriver: 'splunk', options: stringifyOptions({ diff --git a/packages/@aws-cdk/aws-ecs/lib/log-drivers/syslog-log-driver.ts b/packages/@aws-cdk/aws-ecs/lib/log-drivers/syslog-log-driver.ts index 82f006c47bde8..7ae1eb2f90891 100644 --- a/packages/@aws-cdk/aws-ecs/lib/log-drivers/syslog-log-driver.ts +++ b/packages/@aws-cdk/aws-ecs/lib/log-drivers/syslog-log-driver.ts @@ -1,12 +1,9 @@ +import { Construct } from 'constructs'; import { ContainerDefinition } from '../container-definition'; import { BaseLogDriverProps } from './base-log-driver'; import { LogDriver, LogDriverConfig } from './log-driver'; import { renderCommonLogDriverOptions, stringifyOptions } from './utils'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Specifies the syslog log driver configuration options. * @@ -89,7 +86,7 @@ export class SyslogLogDriver extends LogDriver { /** * Called when the log driver is configured on a container */ - public bind(_scope: CoreConstruct, _containerDefinition: ContainerDefinition): LogDriverConfig { + public bind(_scope: Construct, _containerDefinition: ContainerDefinition): LogDriverConfig { return { logDriver: 'syslog', options: stringifyOptions({ diff --git a/packages/@aws-cdk/aws-ecs/lib/proxy-configuration/app-mesh-proxy-configuration.ts b/packages/@aws-cdk/aws-ecs/lib/proxy-configuration/app-mesh-proxy-configuration.ts index 7b10ce325506a..12d09bc68737d 100644 --- a/packages/@aws-cdk/aws-ecs/lib/proxy-configuration/app-mesh-proxy-configuration.ts +++ b/packages/@aws-cdk/aws-ecs/lib/proxy-configuration/app-mesh-proxy-configuration.ts @@ -1,11 +1,8 @@ +import { Construct } from 'constructs'; import { TaskDefinition } from '../base/task-definition'; import { CfnTaskDefinition } from '../ecs.generated'; import { ProxyConfiguration } from './proxy-configuration'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Interface for setting the properties of proxy configuration. */ @@ -90,7 +87,7 @@ export class AppMeshProxyConfiguration extends ProxyConfiguration { /** * Called when the proxy configuration is configured on a task definition. */ - public bind(_scope: CoreConstruct, _taskDefinition: TaskDefinition): CfnTaskDefinition.ProxyConfigurationProperty { + public bind(_scope: Construct, _taskDefinition: TaskDefinition): CfnTaskDefinition.ProxyConfigurationProperty { const configProps = this.props.properties; const configType = 'APPMESH'; return { diff --git a/packages/@aws-cdk/aws-ecs/lib/proxy-configuration/proxy-configuration.ts b/packages/@aws-cdk/aws-ecs/lib/proxy-configuration/proxy-configuration.ts index ef457a6e18b41..2bb30545785bb 100644 --- a/packages/@aws-cdk/aws-ecs/lib/proxy-configuration/proxy-configuration.ts +++ b/packages/@aws-cdk/aws-ecs/lib/proxy-configuration/proxy-configuration.ts @@ -1,10 +1,7 @@ +import { Construct } from 'constructs'; import { TaskDefinition } from '../base/task-definition'; import { CfnTaskDefinition } from '../ecs.generated'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * The base class for proxy configurations. */ @@ -12,5 +9,5 @@ export abstract class ProxyConfiguration { /** * Called when the proxy configuration is configured on a task definition. */ - public abstract bind(_scope: CoreConstruct, _taskDefinition: TaskDefinition): CfnTaskDefinition.ProxyConfigurationProperty; + public abstract bind(_scope: Construct, _taskDefinition: TaskDefinition): CfnTaskDefinition.ProxyConfigurationProperty; } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ecs/package.json b/packages/@aws-cdk/aws-ecs/package.json index ec829127f9e84..a68432a28d398 100644 --- a/packages/@aws-cdk/aws-ecs/package.json +++ b/packages/@aws-cdk/aws-ecs/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-ecs", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::ECS", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -109,7 +110,7 @@ "@aws-cdk/aws-ssm": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -138,7 +139,7 @@ "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-s3-assets": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-efs/package.json b/packages/@aws-cdk/aws-efs/package.json index 6a7cef054b6a2..18267acb01b82 100644 --- a/packages/@aws-cdk/aws-efs/package.json +++ b/packages/@aws-cdk/aws-efs/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-efs", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::EFS", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -83,7 +84,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -92,7 +93,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-eks-legacy/lib/aws-auth.ts b/packages/@aws-cdk/aws-eks-legacy/lib/aws-auth.ts index 933ccbb144ea1..75baad391f4e2 100644 --- a/packages/@aws-cdk/aws-eks-legacy/lib/aws-auth.ts +++ b/packages/@aws-cdk/aws-eks-legacy/lib/aws-auth.ts @@ -6,7 +6,7 @@ import { KubernetesResource } from './k8s-resource'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; export interface AwsAuthProps { /** diff --git a/packages/@aws-cdk/aws-eks-legacy/lib/cluster-resource.ts b/packages/@aws-cdk/aws-eks-legacy/lib/cluster-resource.ts index 2de302f8c6331..279fa6cdf8c04 100644 --- a/packages/@aws-cdk/aws-eks-legacy/lib/cluster-resource.ts +++ b/packages/@aws-cdk/aws-eks-legacy/lib/cluster-resource.ts @@ -7,7 +7,7 @@ import { KubectlLayer } from './kubectl-layer'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * A low-level CFN resource Amazon EKS cluster implemented through a custom diff --git a/packages/@aws-cdk/aws-eks-legacy/lib/cluster.ts b/packages/@aws-cdk/aws-eks-legacy/lib/cluster.ts index 1f8c699180aad..90d1c1840728f 100644 --- a/packages/@aws-cdk/aws-eks-legacy/lib/cluster.ts +++ b/packages/@aws-cdk/aws-eks-legacy/lib/cluster.ts @@ -16,7 +16,7 @@ import { renderUserData } from './user-data'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; // defaults are based on https://eksctl.io const DEFAULT_CAPACITY_COUNT = 2; diff --git a/packages/@aws-cdk/aws-eks-legacy/lib/helm-chart.ts b/packages/@aws-cdk/aws-eks-legacy/lib/helm-chart.ts index 6accff6c05bd2..0a8afb0e97530 100644 --- a/packages/@aws-cdk/aws-eks-legacy/lib/helm-chart.ts +++ b/packages/@aws-cdk/aws-eks-legacy/lib/helm-chart.ts @@ -6,7 +6,7 @@ import { KubectlLayer } from './kubectl-layer'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Helm Chart options. diff --git a/packages/@aws-cdk/aws-eks-legacy/lib/k8s-resource.ts b/packages/@aws-cdk/aws-eks-legacy/lib/k8s-resource.ts index f28901d125cc9..60896649f469f 100644 --- a/packages/@aws-cdk/aws-eks-legacy/lib/k8s-resource.ts +++ b/packages/@aws-cdk/aws-eks-legacy/lib/k8s-resource.ts @@ -3,7 +3,7 @@ import { Cluster } from './cluster'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; export interface KubernetesResourceProps { /** diff --git a/packages/@aws-cdk/aws-eks-legacy/lib/kubectl-layer.ts b/packages/@aws-cdk/aws-eks-legacy/lib/kubectl-layer.ts index 7121b34a277d6..a9198fe4aa2d3 100644 --- a/packages/@aws-cdk/aws-eks-legacy/lib/kubectl-layer.ts +++ b/packages/@aws-cdk/aws-eks-legacy/lib/kubectl-layer.ts @@ -4,7 +4,7 @@ import { CfnResource, Resource, Stack, Token } from '@aws-cdk/core'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; const KUBECTL_APP_ARN = 'arn:aws:serverlessrepo:us-east-1:903779448426:applications/lambda-layer-kubectl'; const KUBECTL_APP_VERSION = '1.13.7'; diff --git a/packages/@aws-cdk/aws-eks-legacy/package.json b/packages/@aws-cdk/aws-eks-legacy/package.json index 67078e5830dcf..dc2e82738a76a 100644 --- a/packages/@aws-cdk/aws-eks-legacy/package.json +++ b/packages/@aws-cdk/aws-eks-legacy/package.json @@ -2,6 +2,7 @@ "name": "@aws-cdk/aws-eks-legacy", "version": "0.0.0", "deprecated": "Use the @aws-cdk/aws-eks module instead", + "private": true, "description": "The CDK Construct Library for AWS::EKS (Legacy)", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -84,7 +85,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-ssm": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -95,7 +96,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-ssm": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-eks/lib/aws-auth.ts b/packages/@aws-cdk/aws-eks/lib/aws-auth.ts index c1c405bf2dc29..0a8a6d9051a6d 100644 --- a/packages/@aws-cdk/aws-eks/lib/aws-auth.ts +++ b/packages/@aws-cdk/aws-eks/lib/aws-auth.ts @@ -1,14 +1,10 @@ import * as iam from '@aws-cdk/aws-iam'; -import { Lazy, Stack, IConstruct } from '@aws-cdk/core'; -import { Construct } from 'constructs'; +import { Lazy, Stack } from '@aws-cdk/core'; +import { Construct, IConstruct } from 'constructs'; import { AwsAuthMapping } from './aws-auth-mapping'; import { Cluster } from './cluster'; import { KubernetesManifest } from './k8s-manifest'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Configuration props for the AwsAuth construct. */ @@ -26,7 +22,7 @@ export interface AwsAuthProps { * * @see https://docs.aws.amazon.com/en_us/eks/latest/userguide/add-user-role.html */ -export class AwsAuth extends CoreConstruct { +export class AwsAuth extends Construct { private readonly stack: Stack; private readonly roleMappings = new Array<{ role: iam.IRole, mapping: AwsAuthMapping }>(); private readonly userMappings = new Array<{ user: iam.IUser, mapping: AwsAuthMapping }>(); diff --git a/packages/@aws-cdk/aws-eks/lib/cluster-resource-provider.ts b/packages/@aws-cdk/aws-eks/lib/cluster-resource-provider.ts index 12839a3ee6044..0fcb1a20c0b79 100644 --- a/packages/@aws-cdk/aws-eks/lib/cluster-resource-provider.ts +++ b/packages/@aws-cdk/aws-eks/lib/cluster-resource-provider.ts @@ -6,10 +6,6 @@ import { Duration, NestedStack, Stack } from '@aws-cdk/core'; import * as cr from '@aws-cdk/custom-resources'; import { Construct } from 'constructs'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - const HANDLER_DIR = path.join(__dirname, 'cluster-resource-handler'); const HANDLER_RUNTIME = lambda.Runtime.NODEJS_12_X; @@ -56,7 +52,7 @@ export class ClusterResourceProvider extends NestedStack { public readonly provider: cr.Provider; private constructor(scope: Construct, id: string, props: ClusterResourceProviderProps) { - super(scope as CoreConstruct, id); + super(scope, id); const onEvent = new lambda.Function(this, 'OnEventHandler', { code: lambda.Code.fromAsset(HANDLER_DIR), diff --git a/packages/@aws-cdk/aws-eks/lib/cluster-resource.ts b/packages/@aws-cdk/aws-eks/lib/cluster-resource.ts index e134601aef73d..061d637bd6676 100644 --- a/packages/@aws-cdk/aws-eks/lib/cluster-resource.ts +++ b/packages/@aws-cdk/aws-eks/lib/cluster-resource.ts @@ -7,10 +7,6 @@ import { CLUSTER_RESOURCE_TYPE } from './cluster-resource-handler/consts'; import { ClusterResourceProvider } from './cluster-resource-provider'; import { CfnCluster } from './eks.generated'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - export interface ClusterResourceProps { readonly resourcesVpcConfig: CfnCluster.ResourcesVpcConfigProperty; readonly roleArn: string; @@ -36,7 +32,7 @@ export interface ClusterResourceProps { * cluster via `kubectl` to enable Kubernetes management capabilities like apply * manifest and IAM role/user RBAC mapping. */ -export class ClusterResource extends CoreConstruct { +export class ClusterResource extends Construct { public readonly attrEndpoint: string; public readonly attrArn: string; public readonly attrCertificateAuthorityData: string; diff --git a/packages/@aws-cdk/aws-eks/lib/cluster.ts b/packages/@aws-cdk/aws-eks/lib/cluster.ts index c578b90fa388b..16d0b7c609ecd 100644 --- a/packages/@aws-cdk/aws-eks/lib/cluster.ts +++ b/packages/@aws-cdk/aws-eks/lib/cluster.ts @@ -24,10 +24,6 @@ import { BottleRocketImage } from './private/bottlerocket'; import { ServiceAccount, ServiceAccountOptions } from './service-account'; import { LifecycleLabel, renderAmazonLinuxUserData, renderBottlerocketUserData } from './user-data'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - // defaults are based on https://eksctl.io const DEFAULT_CAPACITY_COUNT = 2; const DEFAULT_CAPACITY_TYPE = ec2.InstanceType.of(ec2.InstanceClass.M5, ec2.InstanceSize.LARGE); @@ -1852,7 +1848,7 @@ export class EksOptimizedImage implements ec2.IMachineImage { /** * Return the correct image */ - public getImage(scope: CoreConstruct): ec2.MachineImageConfig { + public getImage(scope: Construct): ec2.MachineImageConfig { const ami = ssm.StringParameter.valueForStringParameter(scope, this.amiParameterName); return { imageId: ami, diff --git a/packages/@aws-cdk/aws-eks/lib/fargate-profile.ts b/packages/@aws-cdk/aws-eks/lib/fargate-profile.ts index 4ce6f094909bd..1fd6a3ff8c7d6 100644 --- a/packages/@aws-cdk/aws-eks/lib/fargate-profile.ts +++ b/packages/@aws-cdk/aws-eks/lib/fargate-profile.ts @@ -6,10 +6,6 @@ import { Cluster } from './cluster'; import { FARGATE_PROFILE_RESOURCE_TYPE } from './cluster-resource-handler/consts'; import { ClusterResourceProvider } from './cluster-resource-provider'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Options for defining EKS Fargate Profiles. */ @@ -113,7 +109,7 @@ export interface Selector { * eks.amazonaws.com/fargate-profile: profile_name. However, the pod must still * match a selector in that profile in order to be scheduled onto Fargate. */ -export class FargateProfile extends CoreConstruct implements ITaggable { +export class FargateProfile extends Construct implements ITaggable { /** * The full Amazon Resource Name (ARN) of the Fargate profile. diff --git a/packages/@aws-cdk/aws-eks/lib/helm-chart.ts b/packages/@aws-cdk/aws-eks/lib/helm-chart.ts index 9e981bf449793..0c8eaaeb1455d 100644 --- a/packages/@aws-cdk/aws-eks/lib/helm-chart.ts +++ b/packages/@aws-cdk/aws-eks/lib/helm-chart.ts @@ -3,10 +3,6 @@ import { Construct } from 'constructs'; import { ICluster } from './cluster'; import { KubectlProvider } from './kubectl-provider'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Helm Chart options. */ @@ -84,7 +80,7 @@ export interface HelmChartProps extends HelmChartOptions { * * Applies/deletes the resources using `kubectl` in sync with the resource. */ -export class HelmChart extends CoreConstruct { +export class HelmChart extends Construct { /** * The CloudFormation resource type. */ diff --git a/packages/@aws-cdk/aws-eks/lib/k8s-manifest.ts b/packages/@aws-cdk/aws-eks/lib/k8s-manifest.ts index 205c28a9ee647..9ffe48da1f08e 100644 --- a/packages/@aws-cdk/aws-eks/lib/k8s-manifest.ts +++ b/packages/@aws-cdk/aws-eks/lib/k8s-manifest.ts @@ -3,10 +3,6 @@ import { Construct, Node } from 'constructs'; import { ICluster } from './cluster'; import { KubectlProvider } from './kubectl-provider'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - const PRUNE_LABEL_PREFIX = 'aws.cdk.eks/prune-'; /** @@ -100,7 +96,7 @@ export interface KubernetesManifestProps extends KubernetesManifestOptions { * * Applies/deletes the manifest using `kubectl`. */ -export class KubernetesManifest extends CoreConstruct { +export class KubernetesManifest extends Construct { /** * The CloudFormation reosurce type. */ diff --git a/packages/@aws-cdk/aws-eks/lib/k8s-object-value.ts b/packages/@aws-cdk/aws-eks/lib/k8s-object-value.ts index e8cfddd478f60..6234aa6efc6ac 100644 --- a/packages/@aws-cdk/aws-eks/lib/k8s-object-value.ts +++ b/packages/@aws-cdk/aws-eks/lib/k8s-object-value.ts @@ -3,10 +3,6 @@ import { Construct } from 'constructs'; import { ICluster } from './cluster'; import { KubectlProvider } from './kubectl-provider'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Properties for KubernetesObjectValue. */ @@ -55,7 +51,7 @@ export interface KubernetesObjectValueProps { * Represents a value of a specific object deployed in the cluster. * Use this to fetch any information available by the `kubectl get` command. */ -export class KubernetesObjectValue extends CoreConstruct { +export class KubernetesObjectValue extends Construct { /** * The CloudFormation reosurce type. */ diff --git a/packages/@aws-cdk/aws-eks/lib/k8s-patch.ts b/packages/@aws-cdk/aws-eks/lib/k8s-patch.ts index 3aa2eb8c36255..7d99bd3b6a428 100644 --- a/packages/@aws-cdk/aws-eks/lib/k8s-patch.ts +++ b/packages/@aws-cdk/aws-eks/lib/k8s-patch.ts @@ -3,10 +3,6 @@ import { Construct } from 'constructs'; import { ICluster } from './cluster'; import { KubectlProvider } from './kubectl-provider'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Properties for KubernetesPatch */ @@ -71,7 +67,7 @@ export enum PatchType { * Kubernetes resource. * @see https://kubernetes.io/docs/tasks/run-application/update-api-object-kubectl-patch/ */ -export class KubernetesPatch extends CoreConstruct { +export class KubernetesPatch extends Construct { constructor(scope: Construct, id: string, props: KubernetesPatchProps) { super(scope, id); diff --git a/packages/@aws-cdk/aws-eks/lib/kubectl-provider.ts b/packages/@aws-cdk/aws-eks/lib/kubectl-provider.ts index b5bd8ed51b876..4f3647d40a432 100644 --- a/packages/@aws-cdk/aws-eks/lib/kubectl-provider.ts +++ b/packages/@aws-cdk/aws-eks/lib/kubectl-provider.ts @@ -8,10 +8,6 @@ import { KubectlLayer } from '@aws-cdk/lambda-layer-kubectl'; import { Construct } from 'constructs'; import { ICluster, Cluster } from './cluster'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - export interface KubectlProviderProps { /** * The cluster to control. @@ -55,7 +51,7 @@ export class KubectlProvider extends NestedStack { public readonly handlerRole: iam.IRole; public constructor(scope: Construct, id: string, props: KubectlProviderProps) { - super(scope as CoreConstruct, id); + super(scope, id); const cluster = props.cluster; diff --git a/packages/@aws-cdk/aws-eks/lib/private/bottlerocket.ts b/packages/@aws-cdk/aws-eks/lib/private/bottlerocket.ts index d2e88ec815630..952b308d7e160 100644 --- a/packages/@aws-cdk/aws-eks/lib/private/bottlerocket.ts +++ b/packages/@aws-cdk/aws-eks/lib/private/bottlerocket.ts @@ -1,6 +1,6 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as ssm from '@aws-cdk/aws-ssm'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Properties for BottleRocketImage diff --git a/packages/@aws-cdk/aws-eks/lib/service-account.ts b/packages/@aws-cdk/aws-eks/lib/service-account.ts index c49e2a944a765..9917911500b24 100644 --- a/packages/@aws-cdk/aws-eks/lib/service-account.ts +++ b/packages/@aws-cdk/aws-eks/lib/service-account.ts @@ -4,10 +4,6 @@ import { Construct } from 'constructs'; import { ICluster } from './cluster'; import { KubernetesManifest } from './k8s-manifest'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Options for `ServiceAccount` */ @@ -38,7 +34,7 @@ export interface ServiceAccountProps extends ServiceAccountOptions { /** * Service Account */ -export class ServiceAccount extends CoreConstruct implements IPrincipal { +export class ServiceAccount extends Construct implements IPrincipal { /** * The role which is linked to the service account. */ diff --git a/packages/@aws-cdk/aws-eks/package.json b/packages/@aws-cdk/aws-eks/package.json index 7e4f0e2ddf090..75f27d19325db 100644 --- a/packages/@aws-cdk/aws-eks/package.json +++ b/packages/@aws-cdk/aws-eks/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-eks", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::EKS", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -94,7 +95,7 @@ "@aws-cdk/custom-resources": "0.0.0", "@aws-cdk/lambda-layer-awscli": "0.0.0", "@aws-cdk/lambda-layer-kubectl": "0.0.0", - "constructs": "^3.2.0", + "constructs": "10.0.0-pre.5", "yaml": "1.10.2" }, "bundledDependencies": [ @@ -110,7 +111,7 @@ "@aws-cdk/aws-ssm": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", - "constructs": "^3.2.0", + "constructs": "10.0.0-pre.5", "@aws-cdk/lambda-layer-awscli": "0.0.0", "@aws-cdk/lambda-layer-kubectl": "0.0.0" }, diff --git a/packages/@aws-cdk/aws-eks/test/pinger/pinger.ts b/packages/@aws-cdk/aws-eks/test/pinger/pinger.ts index 1165da1ca90df..ca44febede42a 100644 --- a/packages/@aws-cdk/aws-eks/test/pinger/pinger.ts +++ b/packages/@aws-cdk/aws-eks/test/pinger/pinger.ts @@ -4,16 +4,12 @@ import { CustomResource, Token, Duration } from '@aws-cdk/core'; import * as cr from '@aws-cdk/custom-resources'; import { Construct } from 'constructs'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - export interface PingerProps { readonly url: string; readonly securityGroup?: ec2.SecurityGroup; readonly vpc?: ec2.IVpc; } -export class Pinger extends CoreConstruct { +export class Pinger extends Construct { private _resource: CustomResource; diff --git a/packages/@aws-cdk/aws-eks/test/test.cluster.ts b/packages/@aws-cdk/aws-eks/test/test.cluster.ts index 46554d34dceb0..4318a714e4ddb 100644 --- a/packages/@aws-cdk/aws-eks/test/test.cluster.ts +++ b/packages/@aws-cdk/aws-eks/test/test.cluster.ts @@ -8,7 +8,7 @@ import * as kms from '@aws-cdk/aws-kms'; import * as lambda from '@aws-cdk/aws-lambda'; import * as cdk from '@aws-cdk/core'; import * as cdk8s from 'cdk8s'; -import * as constructs from 'constructs'; +import { Construct } from 'constructs'; import { Test } from 'nodeunit'; import * as YAML from 'yaml'; import * as eks from '../lib'; @@ -285,7 +285,7 @@ export = { }); // create a plain construct, not a cdk8s chart - const someConstruct = new constructs.Construct(stack, 'SomeConstruct'); + const someConstruct = new Construct(stack, 'SomeConstruct'); test.throws(() => cluster.addCdk8sChart('chart', someConstruct), /Invalid cdk8s chart. Must contain a \'toJson\' method, but found undefined/); test.done(); @@ -302,7 +302,7 @@ export = { }); // create a plain construct, not a cdk8s chart - const someConstruct = new cdk.Construct(stack, 'SomeConstruct'); + const someConstruct = new Construct(stack, 'SomeConstruct'); test.throws(() => cluster.addCdk8sChart('chart', someConstruct), /Invalid cdk8s chart. Must contain a \'toJson\' method, but found undefined/); test.done(); @@ -376,7 +376,7 @@ export = { class ClusterStack extends cdk.Stack { public eksCluster: eks.Cluster; - constructor(scope: constructs.Construct, id: string, props: { sg: ec2.ISecurityGroup, vpc: ec2.IVpc }) { + constructor(scope: Construct, id: string, props: { sg: ec2.ISecurityGroup, vpc: ec2.IVpc }) { super(scope, id); this.eksCluster = new eks.Cluster(this, 'Cluster', { version: CLUSTER_VERSION, @@ -392,7 +392,7 @@ export = { public readonly securityGroup: ec2.ISecurityGroup; public readonly vpc: ec2.IVpc; - constructor(scope: constructs.Construct, id: string) { + constructor(scope: Construct, id: string) { super(scope, id); this.vpc = new ec2.Vpc(this, 'Vpc'); this.securityGroup = new ec2.SecurityGroup(this, 'SecurityGroup', { vpc: this.vpc }); @@ -415,7 +415,7 @@ export = { class ClusterStack extends cdk.Stack { public eksCluster: eks.Cluster; - constructor(scope: constructs.Construct, id: string, props?: cdk.StackProps) { + constructor(scope: Construct, id: string, props?: cdk.StackProps) { super(scope, id, props); this.eksCluster = new eks.Cluster(this, 'Cluster', { version: CLUSTER_VERSION, @@ -425,7 +425,7 @@ export = { } class ManifestStack extends cdk.Stack { - constructor(scope: constructs.Construct, id: string, props: cdk.StackProps & { cluster: eks.Cluster }) { + constructor(scope: Construct, id: string, props: cdk.StackProps & { cluster: eks.Cluster }) { super(scope, id, props); // this role creates a dependency between this stack and the cluster stack @@ -467,7 +467,7 @@ export = { class ClusterStack extends cdk.Stack { public eksCluster: eks.Cluster; - constructor(scope: constructs.Construct, id: string, props?: cdk.StackProps) { + constructor(scope: Construct, id: string, props?: cdk.StackProps) { super(scope, id, props); this.eksCluster = new eks.Cluster(this, 'Cluster', { version: CLUSTER_VERSION, @@ -477,7 +477,7 @@ export = { } class ChartStack extends cdk.Stack { - constructor(scope: constructs.Construct, id: string, props: cdk.StackProps & { cluster: eks.Cluster }) { + constructor(scope: Construct, id: string, props: cdk.StackProps & { cluster: eks.Cluster }) { super(scope, id, props); // this role creates a dependency between this stack and the cluster stack @@ -510,7 +510,7 @@ export = { class ClusterStack extends cdk.Stack { public eksCluster: eks.Cluster; - constructor(scope: constructs.Construct, id: string, props?: cdk.StackProps) { + constructor(scope: Construct, id: string, props?: cdk.StackProps) { super(scope, id, props); this.eksCluster = new eks.Cluster(this, 'Cluster', { version: CLUSTER_VERSION, @@ -520,7 +520,7 @@ export = { } class ChartStack extends cdk.Stack { - constructor(scope: constructs.Construct, id: string, props: cdk.StackProps & { cluster: eks.Cluster }) { + constructor(scope: Construct, id: string, props: cdk.StackProps & { cluster: eks.Cluster }) { super(scope, id, props); const resource = new cdk.CfnResource(this, 'resource', { type: 'MyType' }); @@ -544,7 +544,7 @@ export = { class ClusterStack extends cdk.Stack { public eksCluster: eks.Cluster; - constructor(scope: constructs.Construct, id: string, props?: cdk.StackProps) { + constructor(scope: Construct, id: string, props?: cdk.StackProps) { super(scope, id, props); this.eksCluster = new eks.Cluster(this, 'Cluster', { version: CLUSTER_VERSION, @@ -557,7 +557,7 @@ export = { public group: asg.AutoScalingGroup; - constructor(scope: constructs.Construct, id: string, props: cdk.StackProps & { cluster: eks.Cluster }) { + constructor(scope: Construct, id: string, props: cdk.StackProps & { cluster: eks.Cluster }) { super(scope, id, props); // the role is create in this stack implicitly by the ASG @@ -591,7 +591,7 @@ export = { class ClusterStack extends cdk.Stack { public eksCluster: eks.Cluster; - constructor(scope: constructs.Construct, id: string, props?: cdk.StackProps) { + constructor(scope: Construct, id: string, props?: cdk.StackProps) { super(scope, id, props); this.eksCluster = new eks.Cluster(this, 'EKSCluster', { version: CLUSTER_VERSION, @@ -601,7 +601,7 @@ export = { } class AppStack extends cdk.Stack { - constructor(scope: constructs.Construct, id: string, props: cdk.StackProps & { cluster: eks.Cluster }) { + constructor(scope: Construct, id: string, props: cdk.StackProps & { cluster: eks.Cluster }) { super(scope, id, props); new eks.ServiceAccount(this, 'testAccount', { cluster: props.cluster, name: 'test-account', namespace: 'test' }); diff --git a/packages/@aws-cdk/aws-eks/test/test.k8s-patch.ts b/packages/@aws-cdk/aws-eks/test/test.k8s-patch.ts index 24dabbbf0c1a2..f8fe93ab5c3ec 100644 --- a/packages/@aws-cdk/aws-eks/test/test.k8s-patch.ts +++ b/packages/@aws-cdk/aws-eks/test/test.k8s-patch.ts @@ -44,7 +44,7 @@ export = { })); // also make sure a dependency on the barrier is added to the patch construct. - test.deepEqual(patch.node.dependencies.map(d => Names.nodeUniqueId(d.target.node)), ['MyClusterKubectlReadyBarrier7547948A']); + test.deepEqual(patch.node.dependencies.map(d => Names.nodeUniqueId(d.node)), ['MyClusterKubectlReadyBarrier7547948A']); test.done(); }, diff --git a/packages/@aws-cdk/aws-elasticache/package.json b/packages/@aws-cdk/aws-elasticache/package.json index f0b728276adda..bd4db2a137739 100644 --- a/packages/@aws-cdk/aws-elasticache/package.json +++ b/packages/@aws-cdk/aws-elasticache/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-elasticache", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::ElastiCache", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -78,12 +79,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-elasticbeanstalk/package.json b/packages/@aws-cdk/aws-elasticbeanstalk/package.json index 31472f9e21d51..a5b4b426dccfd 100644 --- a/packages/@aws-cdk/aws-elasticbeanstalk/package.json +++ b/packages/@aws-cdk/aws-elasticbeanstalk/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-elasticbeanstalk", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::ElasticBeanstalk", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -78,12 +79,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-elasticloadbalancing/package.json b/packages/@aws-cdk/aws-elasticloadbalancing/package.json index 24f25fb2470f8..ffbfe9afc857d 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancing/package.json +++ b/packages/@aws-cdk/aws-elasticloadbalancing/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-elasticloadbalancing", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::ElasticLoadBalancing", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,13 +81,13 @@ "dependencies": { "@aws-cdk/aws-ec2": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-ec2": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2-actions/package.json b/packages/@aws-cdk/aws-elasticloadbalancingv2-actions/package.json index dc606985d7c17..dea126b2c6251 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2-actions/package.json +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2-actions/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-elasticloadbalancingv2-actions", "version": "0.0.0", + "private": true, "description": "Integration actions for AWS ElasticLoadBalancingV2", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -75,7 +76,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-cognito": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -84,7 +85,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-cognito": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2-targets/package.json b/packages/@aws-cdk/aws-elasticloadbalancingv2-targets/package.json index 51ae07a4caaa7..d69fb006f511b 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2-targets/package.json +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2-targets/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-elasticloadbalancingv2-targets", "version": "0.0.0", + "private": true, "description": "Integration targets for AWS ElasticLoadBalancingV2", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -75,7 +76,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -84,7 +85,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener-action.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener-action.ts index 91d839a605d74..d4f62b0f21da3 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener-action.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener-action.ts @@ -1,4 +1,5 @@ -import { Duration, IConstruct, SecretValue, Tokenization } from '@aws-cdk/core'; +import { Duration, SecretValue, Tokenization } from '@aws-cdk/core'; +import { IConstruct } from 'constructs'; import { CfnListener } from '../elasticloadbalancingv2.generated'; import { IListenerAction } from '../shared/listener-action'; import { IApplicationListener } from './application-listener'; @@ -6,7 +7,7 @@ import { IApplicationTargetGroup } from './application-target-group'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * What to do when a client makes a request to a listener @@ -445,4 +446,4 @@ class TargetGroupListenerAction extends ListenerAction { tg.registerListener(listener, associatingConstruct); } } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener-certificate.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener-certificate.ts index 2ff867a4721a2..2b10788cc9d21 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener-certificate.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener-certificate.ts @@ -3,10 +3,6 @@ import { CfnListenerCertificate } from '../elasticloadbalancingv2.generated'; import { IListenerCertificate } from '../shared/listener-certificate'; import { IApplicationListener } from './application-listener'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Properties for adding a set of certificates to a listener */ @@ -39,7 +35,7 @@ export interface ApplicationListenerCertificateProps { /** * Add certificates to a listener */ -export class ApplicationListenerCertificate extends CoreConstruct { +export class ApplicationListenerCertificate extends Construct { constructor(scope: Construct, id: string, props: ApplicationListenerCertificateProps) { super(scope, id); diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener-rule.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener-rule.ts index 7a3bb91cb3457..ea002207e13e5 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener-rule.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener-rule.ts @@ -7,10 +7,6 @@ import { ListenerAction } from './application-listener-action'; import { IApplicationTargetGroup } from './application-target-group'; import { ListenerCondition } from './conditions'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Basic properties for defining a rule on a listener */ @@ -201,7 +197,7 @@ export interface RedirectResponse { /** * Define a new listener rule */ -export class ApplicationListenerRule extends CoreConstruct { +export class ApplicationListenerRule extends Construct { /** * The ARN of this rule */ @@ -267,6 +263,8 @@ export class ApplicationListenerRule extends CoreConstruct { } this.listenerRuleArn = resource.ref; + + this.node.addValidation({ validate: () => this.validateListenerRule() }); } /** @@ -357,7 +355,7 @@ export class ApplicationListenerRule extends CoreConstruct { /** * Validate the rule */ - protected validate() { + private validateListenerRule() { if (this.action === undefined) { return ['Listener rule needs at least one action']; } diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener.ts index f0876cd2cc082..a3fd04c5f86c9 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener.ts @@ -463,8 +463,8 @@ export class ApplicationListener extends BaseListener implements IApplicationLis /** * Validate this listener. */ - protected validate(): string[] { - const errors = super.validate(); + protected validateListener(): string[] { + const errors = super.validateListener(); if (this.protocol === ApplicationProtocol.HTTPS && this.certificateArns.length === 0) { errors.push('HTTPS Listener needs at least one certificate (call addCertificates)'); } diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-target-group.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-target-group.ts index e7a6b2eef27d1..14e0855e0988e 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-target-group.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-target-group.ts @@ -13,10 +13,6 @@ import { determineProtocolAndPort } from '../shared/util'; import { IApplicationListener } from './application-listener'; import { HttpCodeTarget } from './application-load-balancer'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Properties for defining an Application Target Group */ @@ -213,7 +209,7 @@ export class ApplicationTargetGroup extends TargetGroupBase implements IApplicat listener.registerConnectable(member.connectable, member.portRange); } this.listeners.push(listener); - this.loadBalancerAttachedDependencies.add((associatingConstruct || listener) as CoreConstruct); + this.loadBalancerAttachedDependencies.add(associatingConstruct ?? listener); } /** @@ -358,8 +354,8 @@ export class ApplicationTargetGroup extends TargetGroupBase implements IApplicat }); } - protected validate(): string[] { - const ret = super.validate(); + protected validateTargetGroup(): string[] { + const ret = super.validateTargetGroup(); if (this.targetType !== undefined && this.targetType !== TargetType.LAMBDA && (this.protocol === undefined || this.port === undefined)) { diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-listener-action.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-listener-action.ts index cc86ca0458ef7..0259fcd27cdc4 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-listener-action.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-listener-action.ts @@ -6,7 +6,7 @@ import { INetworkTargetGroup } from './network-target-group'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * What to do when a client makes a request to a listener @@ -156,4 +156,4 @@ class TargetGroupListenerAction extends NetworkListenerAction { tg.registerListener(listener); } } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-target-group.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-target-group.ts index 3c2e3cb574609..654d68abc3637 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-target-group.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-target-group.ts @@ -139,8 +139,8 @@ export class NetworkTargetGroup extends TargetGroupBase implements INetworkTarge return loadBalancerNameFromListenerArn(this.listeners[0].listenerArn); } - protected validate(): string[] { - const ret = super.validate(); + protected validateTargetGroup(): string[] { + const ret = super.validateTargetGroup(); const healthCheck: HealthCheck = this.healthCheck || {}; diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/base-listener.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/base-listener.ts index db52671e5a368..da4174c157820 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/base-listener.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/base-listener.ts @@ -112,12 +112,13 @@ export abstract class BaseListener extends Resource { }); this.listenerArn = resource.ref; + this.node.addValidation({ validate: () => this.validateListener() }); } /** * Validate this listener */ - protected validate(): string[] { + protected validateListener(): string[] { if (!this.defaultAction) { return ['Listener needs at least one default action or target group (call addTargetGroups or addAction)']; } diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/base-target-group.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/base-target-group.ts index 5e569fd8213ca..cdc34537f6613 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/base-target-group.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/base-target-group.ts @@ -1,14 +1,10 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as cdk from '@aws-cdk/core'; -import { Construct } from 'constructs'; +import { Construct, IConstruct } from 'constructs'; import { CfnTargetGroup } from '../elasticloadbalancingv2.generated'; import { Protocol, TargetType } from './enums'; import { Attributes, renderAttributes } from './util'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Basic properties of both Application and Network Target Groups */ @@ -149,7 +145,7 @@ export interface HealthCheck { /** * Define the target of a load balancer */ -export abstract class TargetGroupBase extends CoreConstruct implements ITargetGroup { +export abstract class TargetGroupBase extends Construct implements ITargetGroup { /** * The ARN of the target group */ @@ -273,6 +269,8 @@ export abstract class TargetGroupBase extends CoreConstruct implements ITargetGr this.loadBalancerArns = this.resource.attrLoadBalancerArns.toString(); this.targetGroupName = this.resource.attrTargetGroupName; this.defaultPort = additionalProps.port; + + this.node.addValidation({ validate: () => this.validateTargetGroup() }); } /** @@ -316,8 +314,8 @@ export abstract class TargetGroupBase extends CoreConstruct implements ITargetGr } } - protected validate(): string[] { - const ret = super.validate(); + protected validateTargetGroup(): string[] { + const ret = new Array(); if (this.targetType === undefined && this.targetsJson.length === 0) { cdk.Annotations.of(this).addWarning("When creating an empty TargetGroup, you should specify a 'targetType' (this warning may become an error in the future)."); @@ -364,7 +362,7 @@ export interface TargetGroupImportProps extends TargetGroupAttributes { /** * A target group */ -export interface ITargetGroup extends cdk.IConstruct { +export interface ITargetGroup extends IConstruct { /** * ARN of the target group */ diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/imported.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/imported.ts index 59594c636d118..76979b2f62548 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/imported.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/imported.ts @@ -2,14 +2,10 @@ import * as cdk from '@aws-cdk/core'; import { Construct } from 'constructs'; import { ITargetGroup, TargetGroupImportProps } from './base-target-group'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Base internal class for existing target groups */ -export abstract class ImportedTargetGroupBase extends CoreConstruct implements ITargetGroup { +export abstract class ImportedTargetGroupBase extends Construct implements ITargetGroup { /** * ARN of the target group */ diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/package.json b/packages/@aws-cdk/aws-elasticloadbalancingv2/package.json index 745b87fb4453f..b2282ea14ee4f 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/package.json +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-elasticloadbalancingv2", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::ElasticLoadBalancingV2", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -88,7 +89,7 @@ "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -101,7 +102,7 @@ "@aws-cdk/cloud-assembly-schema": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.2.0", + "constructs": "10.0.0-pre.5", "@aws-cdk/region-info": "0.0.0" }, "engines": { diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/listener.test.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/listener.test.ts index e29e5a7837895..05c733cf273d7 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/listener.test.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/listener.test.ts @@ -111,14 +111,14 @@ describe('tests', () => { const lb = new elbv2.ApplicationLoadBalancer(stack, 'LB', { vpc }); // WHEN - lb.addListener('Listener', { + const listener = lb.addListener('Listener', { port: 443, defaultTargetGroups: [new elbv2.ApplicationTargetGroup(stack, 'Group', { vpc, port: 80 })], }); // THEN - const errors = cdk.ConstructNode.validate(stack.node); - expect(errors.map(e => e.message)).toEqual(['HTTPS Listener needs at least one certificate (call addCertificates)']); + const errors = listener.node.validate(); + expect(errors).toEqual(['HTTPS Listener needs at least one certificate (call addCertificates)']); }); test('HTTPS listener can add certificate after construction', () => { @@ -473,7 +473,7 @@ describe('tests', () => { }); // THEN - const validationErrors: string[] = (group as any).validate(); + const validationErrors: string[] = group.node.validate(); expect(validationErrors).toEqual(["Health check protocol 'TCP' is not supported. Must be one of [HTTP, HTTPS]"]); }); diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/helpers.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/helpers.ts index 6378f8ac0c8ed..1df29adf5d6ba 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/helpers.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/helpers.ts @@ -1,17 +1,13 @@ import * as ec2 from '@aws-cdk/aws-ec2'; -import * as constructs from 'constructs'; +import { Construct } from 'constructs'; import * as elbv2 from '../lib'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - export class FakeSelfRegisteringTarget extends Construct implements elbv2.IApplicationLoadBalancerTarget, elbv2.INetworkLoadBalancerTarget, ec2.IConnectable { public readonly securityGroup: ec2.SecurityGroup; public readonly connections: ec2.Connections; - constructor(scope: constructs.Construct, id: string, vpc: ec2.Vpc) { + constructor(scope: Construct, id: string, vpc: ec2.Vpc) { super(scope, id); this.securityGroup = new ec2.SecurityGroup(this, 'SG', { vpc }); this.connections = new ec2.Connections({ diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/integ.alb.dualstack.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/integ.alb.dualstack.ts index c0db7655b9d86..fa45ed6a3ca25 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/integ.alb.dualstack.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/integ.alb.dualstack.ts @@ -1,6 +1,7 @@ #!/usr/bin/env node import * as ec2 from '@aws-cdk/aws-ec2'; import * as cdk from '@aws-cdk/core'; +import { IConstruct } from 'constructs'; import * as elbv2 from '../lib'; /* IPv6 workaround found here: https://github.com/aws/aws-cdk/issues/894 */ @@ -37,7 +38,7 @@ const ipv6Block = new ec2.CfnVPCCidrBlock( // Get the vpc's internet gateway so we can create default routes for the // public subnets. -const internetGateway = valueOrDie( +const internetGateway = valueOrDie( vpc.node.children.find(c => c instanceof ec2.CfnInternetGateway), new Error('Couldnt find an internet gateway'), ); @@ -53,7 +54,7 @@ vpc.publicSubnets.forEach((subnet, idx) => { // Find a CfnSubnet (raw cloudformation resources) child to the public // subnet nodes. - const cfnSubnet = valueOrDie( + const cfnSubnet = valueOrDie( subnet.node.children.find(c => c instanceof ec2.CfnSubnet), new Error('Couldnt find a CfnSubnet'), ); diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/nlb/listener.test.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/nlb/listener.test.ts index d40197d00a280..378d22dc8ade5 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/nlb/listener.test.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/nlb/listener.test.ts @@ -267,7 +267,7 @@ describe('tests', () => { }, }); - const validationErrors: string[] = (targetGroup as any).validate(); + const validationErrors: string[] = targetGroup.node.validate(); const intervalError = validationErrors.find((err) => /Health check interval '60' not supported. Must be one of the following values/.test(err)); expect(intervalError).toBeDefined(); }); @@ -290,7 +290,7 @@ describe('tests', () => { }); // THEN - const validationErrors: string[] = (targetGroup as any).validate(); + const validationErrors: string[] = targetGroup.node.validate(); expect(validationErrors).toEqual(["Health check protocol 'UDP' is not supported. Must be one of [HTTP, HTTPS, TCP]"]); }); @@ -313,7 +313,7 @@ describe('tests', () => { }); // THEN - const validationErrors: string[] = (targetGroup as any).validate(); + const validationErrors: string[] = targetGroup.node.validate(); expect(validationErrors).toEqual([ "'TCP' health checks do not support the path property. Must be one of [HTTP, HTTPS]", ]); @@ -338,7 +338,7 @@ describe('tests', () => { }); // THEN - const validationErrors: string[] = (targetGroup as any).validate(); + const validationErrors: string[] = targetGroup.node.validate(); expect(validationErrors).toEqual([ 'Custom health check timeouts are not supported for Network Load Balancer health checks. Expected 6 seconds for HTTP, got 10', ]); diff --git a/packages/@aws-cdk/aws-elasticsearch/lib/elasticsearch-access-policy.ts b/packages/@aws-cdk/aws-elasticsearch/lib/elasticsearch-access-policy.ts index bb5a530211719..88a45a1dd191d 100644 --- a/packages/@aws-cdk/aws-elasticsearch/lib/elasticsearch-access-policy.ts +++ b/packages/@aws-cdk/aws-elasticsearch/lib/elasticsearch-access-policy.ts @@ -1,9 +1,6 @@ import * as iam from '@aws-cdk/aws-iam'; import * as cr from '@aws-cdk/custom-resources'; - -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Construction properties for ElasticsearchAccessPolicy diff --git a/packages/@aws-cdk/aws-elasticsearch/lib/log-group-resource-policy.ts b/packages/@aws-cdk/aws-elasticsearch/lib/log-group-resource-policy.ts index e53eb9a913540..0a88658e1cf42 100644 --- a/packages/@aws-cdk/aws-elasticsearch/lib/log-group-resource-policy.ts +++ b/packages/@aws-cdk/aws-elasticsearch/lib/log-group-resource-policy.ts @@ -1,9 +1,6 @@ import * as iam from '@aws-cdk/aws-iam'; import * as cr from '@aws-cdk/custom-resources'; - -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Construction properties for LogGroupResourcePolicy diff --git a/packages/@aws-cdk/aws-elasticsearch/package.json b/packages/@aws-cdk/aws-elasticsearch/package.json index df7d8934559ea..5d0a0790ce58c 100644 --- a/packages/@aws-cdk/aws-elasticsearch/package.json +++ b/packages/@aws-cdk/aws-elasticsearch/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-elasticsearch", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::Elasticsearch", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -88,7 +89,7 @@ "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -102,7 +103,7 @@ "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-emr/package.json b/packages/@aws-cdk/aws-emr/package.json index 0865f9a31783d..8a6edd5a5931e 100644 --- a/packages/@aws-cdk/aws-emr/package.json +++ b/packages/@aws-cdk/aws-emr/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-emr", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::EMR", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -78,12 +79,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-emrcontainers/package.json b/packages/@aws-cdk/aws-emrcontainers/package.json index c1e102c6a81e6..13b4b19fc59cb 100644 --- a/packages/@aws-cdk/aws-emrcontainers/package.json +++ b/packages/@aws-cdk/aws-emrcontainers/package.json @@ -81,10 +81,12 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" @@ -96,5 +98,6 @@ }, "publishConfig": { "tag": "latest" - } + }, + "private": true } diff --git a/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts b/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts index c3bed0dc2c048..caf6a701c731c 100644 --- a/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts +++ b/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts @@ -6,6 +6,10 @@ import * as cdk from '@aws-cdk/core'; import { ContainerOverride } from './ecs-task-properties'; import { singletonEventRole } from './util'; +// keep this import separate from other imports to reduce chance for merge conflicts with v2-main +// eslint-disable-next-line no-duplicate-imports, import/order +import { Construct } from 'constructs'; + /** * Properties to define an ECS Event Task */ @@ -138,7 +142,7 @@ export class EcsTask implements events.IRuleTarget { return; } - if (!cdk.Construct.isConstruct(this.taskDefinition)) { + if (!Construct.isConstruct(this.taskDefinition)) { throw new Error('Cannot create a security group for ECS task. ' + 'The task definition in ECS task is not a Construct. ' + 'Please pass a taskDefinition as a Construct in EcsTaskProps.'); diff --git a/packages/@aws-cdk/aws-events-targets/lib/log-group-resource-policy.ts b/packages/@aws-cdk/aws-events-targets/lib/log-group-resource-policy.ts index 8938fc1362fbb..eb45c9d234144 100644 --- a/packages/@aws-cdk/aws-events-targets/lib/log-group-resource-policy.ts +++ b/packages/@aws-cdk/aws-events-targets/lib/log-group-resource-policy.ts @@ -1,10 +1,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as cdk from '@aws-cdk/core'; import * as cr from '@aws-cdk/custom-resources'; - -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Properties to configure a log group resource policy diff --git a/packages/@aws-cdk/aws-events-targets/lib/log-group.ts b/packages/@aws-cdk/aws-events-targets/lib/log-group.ts index d437adaf2375c..0250c29ea85b3 100644 --- a/packages/@aws-cdk/aws-events-targets/lib/log-group.ts +++ b/packages/@aws-cdk/aws-events-targets/lib/log-group.ts @@ -29,7 +29,7 @@ export class CloudWatchLogGroup implements events.IRuleTarget { */ public bind(_rule: events.IRule, _id?: string): events.RuleTargetConfig { // Use a custom resource to set the log group resource policy since it is not supported by CDK and cfn. - const resourcePolicyId = `EventsLogGroupPolicy${_rule.node.uniqueId}`; + const resourcePolicyId = `EventsLogGroupPolicy${cdk.Names.nodeUniqueId(_rule.node)}`; const logGroupStack = cdk.Stack.of(this.logGroup); diff --git a/packages/@aws-cdk/aws-events-targets/lib/util.ts b/packages/@aws-cdk/aws-events-targets/lib/util.ts index 069b04a8c5131..bcf288ee0cc4c 100644 --- a/packages/@aws-cdk/aws-events-targets/lib/util.ts +++ b/packages/@aws-cdk/aws-events-targets/lib/util.ts @@ -2,11 +2,12 @@ import * as events from '@aws-cdk/aws-events'; import * as iam from '@aws-cdk/aws-iam'; import * as lambda from '@aws-cdk/aws-lambda'; import * as sqs from '@aws-cdk/aws-sqs'; -import { Annotations, ConstructNode, IConstruct, Names, Token, TokenComparison } from '@aws-cdk/core'; +import { Annotations, Names, Token, TokenComparison } from '@aws-cdk/core'; +import { IConstruct, Node as ConstructNode } from 'constructs'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Obtain the Role for the EventBridge event @@ -19,7 +20,7 @@ export function singletonEventRole(scope: IConstruct, policyStatements: iam.Poli const existing = scope.node.tryFindChild(id) as iam.IRole; if (existing) { return existing; } - const role = new iam.Role(scope as Construct, id, { + const role = new iam.Role(scope, id, { assumedBy: new iam.ServicePrincipal('events.amazonaws.com'), }); @@ -92,4 +93,4 @@ export function addToDeadLetterQueueResourcePolicy(rule: events.IRule, queue: sq */ function sameEnvDimension(dim1: string, dim2: string) { return [TokenComparison.SAME, TokenComparison.BOTH_UNRESOLVED].includes(Token.compareStrings(dim1, dim2)); -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/aws-events-targets/package.json b/packages/@aws-cdk/aws-events-targets/package.json index a4eee23c9a028..18020859d6011 100644 --- a/packages/@aws-cdk/aws-events-targets/package.json +++ b/packages/@aws-cdk/aws-events-targets/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-events-targets", "version": "0.0.0", + "private": true, "description": "Event targets for Amazon EventBridge", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -99,7 +100,7 @@ "@aws-cdk/aws-stepfunctions": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -120,7 +121,7 @@ "@aws-cdk/aws-stepfunctions": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-events/lib/rule.ts b/packages/@aws-cdk/aws-events/lib/rule.ts index 2c71054b60828..9836ca6b511e0 100644 --- a/packages/@aws-cdk/aws-events/lib/rule.ts +++ b/packages/@aws-cdk/aws-events/lib/rule.ts @@ -149,6 +149,8 @@ export class Rule extends Resource implements IRule { for (const target of props.targets || []) { this.addTarget(target); } + + this.node.addValidation({ validate: () => this.validateRule() }); } /** @@ -263,7 +265,7 @@ export class Rule extends Resource implements IRule { return self._renderEventPattern(); } - // we need to override validate(), as it uses the + // we need to override validateRule(), as it uses the // value of the eventPattern field, // which might be empty in the case of the copied rule // (as the patterns in the original might be added through addEventPattern(), @@ -271,7 +273,7 @@ export class Rule extends Resource implements IRule { // Anyway, even if the original rule is invalid, // we would get duplicate errors if we didn't override this, // which is probably a bad idea in and of itself - protected validate(): string[] { + protected validateRule(): string[] { return []; } } @@ -371,7 +373,7 @@ export class Rule extends Resource implements IRule { return out; } - protected validate() { + protected validateRule() { if (Object.keys(this.eventPattern).length === 0 && !this.scheduleExpression) { return ['Either \'eventPattern\' or \'schedule\' must be defined']; } diff --git a/packages/@aws-cdk/aws-events/lib/target.ts b/packages/@aws-cdk/aws-events/lib/target.ts index 1f7de7e82b36a..ea74ac0f97057 100644 --- a/packages/@aws-cdk/aws-events/lib/target.ts +++ b/packages/@aws-cdk/aws-events/lib/target.ts @@ -1,5 +1,5 @@ import * as iam from '@aws-cdk/aws-iam'; -import { IConstruct } from '@aws-cdk/core'; +import { IConstruct } from 'constructs'; import { CfnRule } from './events.generated'; import { RuleTargetInput } from './input'; import { IRule } from './rule-ref'; diff --git a/packages/@aws-cdk/aws-events/package.json b/packages/@aws-cdk/aws-events/package.json index 4c8d4fe304598..d36ec43898711 100644 --- a/packages/@aws-cdk/aws-events/package.json +++ b/packages/@aws-cdk/aws-events/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-events", "version": "0.0.0", + "private": true, "description": "Amazon EventBridge Construct Library", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -82,13 +83,13 @@ "dependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-events/test/test.rule.ts b/packages/@aws-cdk/aws-events/test/test.rule.ts index 72fe340242924..6a8fcd8311230 100644 --- a/packages/@aws-cdk/aws-events/test/test.rule.ts +++ b/packages/@aws-cdk/aws-events/test/test.rule.ts @@ -1,6 +1,7 @@ import { expect, haveResource, haveResourceLike } from '@aws-cdk/assert'; import * as iam from '@aws-cdk/aws-iam'; import * as cdk from '@aws-cdk/core'; +import { Construct, IConstruct } from 'constructs'; import { Test } from 'nodeunit'; import { EventBus, EventField, IRule, IRuleTarget, RuleTargetConfig, RuleTargetInput, Schedule } from '../lib'; import { Rule } from '../lib/rule'; @@ -515,7 +516,7 @@ export = { const rule = new Rule(sourceStack, 'Rule'); const targetStack = new cdk.Stack(app, 'TargetStack', { env: { region: 'us-west-2' } }); - const resource = new cdk.Construct(targetStack, 'Resource'); + const resource = new Construct(targetStack, 'Resource'); test.throws(() => { rule.addTarget(new SomeTarget('T', resource)); @@ -599,7 +600,7 @@ export = { const targetAccount = '234567890123'; const targetStack = new cdk.Stack(app, 'TargetStack', { env: { account: targetAccount } }); - const resource = new cdk.Construct(targetStack, 'Resource'); + const resource = new Construct(targetStack, 'Resource'); test.throws(() => { rule.addTarget(new SomeTarget('T', resource)); @@ -616,7 +617,7 @@ export = { const rule = new Rule(sourceStack, 'Rule'); const targetStack = new cdk.Stack(app, 'TargetStack'); - const resource = new cdk.Construct(targetStack, 'Resource'); + const resource = new Construct(targetStack, 'Resource'); test.throws(() => { rule.addTarget(new SomeTarget('T', resource)); @@ -634,7 +635,7 @@ export = { const targetAccount = '234567890123'; const targetStack = new cdk.Stack(app, 'TargetStack', { env: { account: targetAccount } }); - const resource = new cdk.Construct(targetStack, 'Resource'); + const resource = new Construct(targetStack, 'Resource'); test.throws(() => { rule.addTarget(new SomeTarget('T', resource)); @@ -652,7 +653,7 @@ export = { const targetApp = new cdk.App(); const targetAccount = '234567890123'; const targetStack = new cdk.Stack(targetApp, 'TargetStack', { env: { account: targetAccount, region: 'us-west-2' } }); - const resource = new cdk.Construct(targetStack, 'Resource'); + const resource = new Construct(targetStack, 'Resource'); test.throws(() => { rule.addTarget(new SomeTarget('T', resource)); @@ -684,8 +685,8 @@ export = { region: 'us-west-2', }, }); - const resource1 = new cdk.Construct(targetStack, 'Resource1'); - const resource2 = new cdk.Construct(targetStack, 'Resource2'); + const resource1 = new Construct(targetStack, 'Resource1'); + const resource2 = new Construct(targetStack, 'Resource2'); rule.addTarget(new SomeTarget('T1', resource1)); rule.addTarget(new SomeTarget('T2', resource2)); @@ -772,7 +773,7 @@ export = { region: 'us-west-2', }, }); - const resource = new cdk.Construct(targetStack, 'Resource1'); + const resource = new Construct(targetStack, 'Resource1'); rule.addTarget(new SomeTarget('T', resource)); @@ -802,7 +803,7 @@ export = { class SomeTarget implements IRuleTarget { // eslint-disable-next-line cdk/no-core-construct - public constructor(private readonly id?: string, private readonly resource?: cdk.IConstruct) { + public constructor(private readonly id?: string, private readonly resource?: IConstruct) { } public bind(): RuleTargetConfig { diff --git a/packages/@aws-cdk/aws-eventschemas/package.json b/packages/@aws-cdk/aws-eventschemas/package.json index c141a1a389382..363bbf3ced446 100644 --- a/packages/@aws-cdk/aws-eventschemas/package.json +++ b/packages/@aws-cdk/aws-eventschemas/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-eventschemas", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::EventSchemas", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,11 +81,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-fms/package.json b/packages/@aws-cdk/aws-fms/package.json index 352a762f1e877..3c5036fa882d8 100644 --- a/packages/@aws-cdk/aws-fms/package.json +++ b/packages/@aws-cdk/aws-fms/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-fms", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::FMS", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,11 +81,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-fsx/package.json b/packages/@aws-cdk/aws-fsx/package.json index f004ef50dc8b4..f5f047d276961 100644 --- a/packages/@aws-cdk/aws-fsx/package.json +++ b/packages/@aws-cdk/aws-fsx/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-fsx", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::FSx", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -84,14 +85,14 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/aws-ec2": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-gamelift/package.json b/packages/@aws-cdk/aws-gamelift/package.json index 9ce7dd38156cb..d48b4db2ac94c 100644 --- a/packages/@aws-cdk/aws-gamelift/package.json +++ b/packages/@aws-cdk/aws-gamelift/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-gamelift", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::GameLift", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -78,12 +79,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-globalaccelerator/lib/accelerator-security-group.ts b/packages/@aws-cdk/aws-globalaccelerator/lib/accelerator-security-group.ts index 9197613d69b61..8eacb59432b30 100644 --- a/packages/@aws-cdk/aws-globalaccelerator/lib/accelerator-security-group.ts +++ b/packages/@aws-cdk/aws-globalaccelerator/lib/accelerator-security-group.ts @@ -1,11 +1,10 @@ import { ISecurityGroup, SecurityGroup, IVpc } from '@aws-cdk/aws-ec2'; - import { AwsCustomResource, AwsCustomResourcePolicy, PhysicalResourceId } from '@aws-cdk/custom-resources'; import { EndpointGroup } from '../lib'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * The security group used by a Global Accelerator to send traffic to resources in a VPC. diff --git a/packages/@aws-cdk/aws-globalaccelerator/lib/endpoint-group.ts b/packages/@aws-cdk/aws-globalaccelerator/lib/endpoint-group.ts index b5c96bcd547ba..e496994c6eb59 100644 --- a/packages/@aws-cdk/aws-globalaccelerator/lib/endpoint-group.ts +++ b/packages/@aws-cdk/aws-globalaccelerator/lib/endpoint-group.ts @@ -3,10 +3,6 @@ import { Construct } from 'constructs'; import * as ga from './globalaccelerator.generated'; import { IListener } from './listener'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * The interface of the EndpointGroup */ @@ -117,7 +113,7 @@ export interface EndpointGroupProps { /** * The class for endpoint configuration */ -export class EndpointConfiguration extends CoreConstruct { +export class EndpointConfiguration extends Construct { /** * The property containing all the configuration to be rendered */ diff --git a/packages/@aws-cdk/aws-globalaccelerator/package.json b/packages/@aws-cdk/aws-globalaccelerator/package.json index 44d8895ed30a3..f6d2577b6ba85 100644 --- a/packages/@aws-cdk/aws-globalaccelerator/package.json +++ b/packages/@aws-cdk/aws-globalaccelerator/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-globalaccelerator", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::GlobalAccelerator", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -84,12 +85,12 @@ "@aws-cdk/aws-ec2": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/aws-ec2": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0", + "constructs": "10.0.0-pre.5", "@aws-cdk/custom-resources": "0.0.0" }, "engines": { diff --git a/packages/@aws-cdk/aws-glue/package.json b/packages/@aws-cdk/aws-glue/package.json index 3f6a8fa63ceba..8a573c465d401 100644 --- a/packages/@aws-cdk/aws-glue/package.json +++ b/packages/@aws-cdk/aws-glue/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-glue", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::Glue", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -86,7 +87,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -95,7 +96,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-greengrass/package.json b/packages/@aws-cdk/aws-greengrass/package.json index 666c2f02b99f3..adde04b29820e 100644 --- a/packages/@aws-cdk/aws-greengrass/package.json +++ b/packages/@aws-cdk/aws-greengrass/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-greengrass", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::Greengrass", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,11 +81,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-greengrassv2/package.json b/packages/@aws-cdk/aws-greengrassv2/package.json index 68d9557122c34..987d4944b3471 100644 --- a/packages/@aws-cdk/aws-greengrassv2/package.json +++ b/packages/@aws-cdk/aws-greengrassv2/package.json @@ -80,11 +80,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" @@ -96,5 +96,6 @@ }, "publishConfig": { "tag": "latest" - } + }, + "private": true } diff --git a/packages/@aws-cdk/aws-guardduty/package.json b/packages/@aws-cdk/aws-guardduty/package.json index 2d772252718cb..147d479d51661 100644 --- a/packages/@aws-cdk/aws-guardduty/package.json +++ b/packages/@aws-cdk/aws-guardduty/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-guardduty", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::GuardDuty", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -78,12 +79,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-iam/lib/grant.ts b/packages/@aws-cdk/aws-iam/lib/grant.ts index 6529db181c712..783f87f776441 100644 --- a/packages/@aws-cdk/aws-iam/lib/grant.ts +++ b/packages/@aws-cdk/aws-iam/lib/grant.ts @@ -1,4 +1,5 @@ import * as cdk from '@aws-cdk/core'; +import { IConstruct } from 'constructs'; import { PolicyStatement } from './policy-statement'; import { IGrantable, IPrincipal } from './principals'; @@ -61,7 +62,7 @@ export interface GrantOnPrincipalOptions extends CommonGrantOptions { * * @default - the construct in which this construct is defined */ - readonly scope?: cdk.IConstruct; + readonly scope?: IConstruct; } /** @@ -280,7 +281,7 @@ export class Grant implements cdk.IDependable { * * The same as construct.node.addDependency(grant), but slightly nicer to read. */ - public applyBefore(...constructs: cdk.IConstruct[]) { + public applyBefore(...constructs: IConstruct[]) { for (const construct of constructs) { construct.node.addDependency(this); } @@ -342,7 +343,7 @@ export interface AddToResourcePolicyResult { export class CompositeDependable implements cdk.IDependable { constructor(...dependables: cdk.IDependable[]) { cdk.DependableTrait.implement(this, { - get dependencyRoots(): cdk.IConstruct[] { + get dependencyRoots(): IConstruct[] { return Array.prototype.concat.apply([], dependables.map(d => cdk.DependableTrait.get(d).dependencyRoots)); }, }); diff --git a/packages/@aws-cdk/aws-iam/lib/managed-policy.ts b/packages/@aws-cdk/aws-iam/lib/managed-policy.ts index cc8bddc0e8a17..9734da7353eb4 100644 --- a/packages/@aws-cdk/aws-iam/lib/managed-policy.ts +++ b/packages/@aws-cdk/aws-iam/lib/managed-policy.ts @@ -254,6 +254,8 @@ export class ManagedPolicy extends Resource implements IManagedPolicy { resource: 'policy', resourceName: this.physicalName, }); + + this.node.addValidation({ validate: () => this.validateManagedPolicy() }); } /** @@ -287,7 +289,7 @@ export class ManagedPolicy extends Resource implements IManagedPolicy { this.groups.push(group); } - protected validate(): string[] { + private validateManagedPolicy(): string[] { const result = new Array(); // validate that the policy document is not empty diff --git a/packages/@aws-cdk/aws-iam/lib/permissions-boundary.ts b/packages/@aws-cdk/aws-iam/lib/permissions-boundary.ts index 7b4320462a1ac..777d00f3363f2 100644 --- a/packages/@aws-cdk/aws-iam/lib/permissions-boundary.ts +++ b/packages/@aws-cdk/aws-iam/lib/permissions-boundary.ts @@ -1,4 +1,5 @@ -import { Node, IConstruct } from 'constructs'; +import { Aspects } from '@aws-cdk/core'; +import { IConstruct } from 'constructs'; import { CfnRole, CfnUser } from './iam.generated'; import { IManagedPolicy } from './managed-policy'; @@ -29,7 +30,7 @@ export class PermissionsBoundary { * closest to the Role wins. */ public apply(boundaryPolicy: IManagedPolicy) { - Node.of(this.scope).applyAspect({ + Aspects.of(this.scope).add({ visit(node: IConstruct) { if (node instanceof CfnRole || node instanceof CfnUser) { node.permissionsBoundary = boundaryPolicy.managedPolicyArn; @@ -42,7 +43,7 @@ export class PermissionsBoundary { * Remove previously applied Permissions Boundaries */ public clear() { - Node.of(this.scope).applyAspect({ + Aspects.of(this.scope).add({ visit(node: IConstruct) { if (node instanceof CfnRole || node instanceof CfnUser) { node.permissionsBoundary = undefined; diff --git a/packages/@aws-cdk/aws-iam/lib/policy.ts b/packages/@aws-cdk/aws-iam/lib/policy.ts index 60862dca07c56..2de04f0990b73 100644 --- a/packages/@aws-cdk/aws-iam/lib/policy.ts +++ b/packages/@aws-cdk/aws-iam/lib/policy.ts @@ -177,6 +177,8 @@ export class Policy extends Resource implements IPolicy { if (props.statements) { props.statements.forEach(p => this.addStatements(p)); } + + this.node.addValidation({ validate: () => this.validatePolicy() }); } /** @@ -223,7 +225,7 @@ export class Policy extends Resource implements IPolicy { return this._policyName; } - protected validate(): string[] { + private validatePolicy(): string[] { const result = new Array(); // validate that the policy document is not empty diff --git a/packages/@aws-cdk/aws-iam/lib/role.ts b/packages/@aws-cdk/aws-iam/lib/role.ts index 9b81e4f174152..f830be0d20bcc 100644 --- a/packages/@aws-cdk/aws-iam/lib/role.ts +++ b/packages/@aws-cdk/aws-iam/lib/role.ts @@ -356,6 +356,8 @@ export class Role extends Resource implements IRole { } return result; } + + this.node.addValidation({ validate: () => this.validateRole() }); } /** @@ -430,9 +432,9 @@ export class Role extends Resource implements IRole { return this.immutableRole; } - protected validate(): string[] { - const errors = super.validate(); - errors.push(...this.assumeRolePolicy?.validateForResourcePolicy() || []); + private validateRole(): string[] { + const errors = new Array(); + errors.push(...this.assumeRolePolicy?.validateForResourcePolicy() ?? []); for (const policy of Object.values(this.inlinePolicies)) { errors.push(...policy.validateForIdentityPolicy()); } diff --git a/packages/@aws-cdk/aws-iam/package.json b/packages/@aws-cdk/aws-iam/package.json index 76cd09b7b2d9a..075254dcbfc39 100644 --- a/packages/@aws-cdk/aws-iam/package.json +++ b/packages/@aws-cdk/aws-iam/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-iam", "version": "0.0.0", + "private": true, "description": "CDK routines for easily assigning correct and minimal IAM permissions", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -89,12 +90,12 @@ "dependencies": { "@aws-cdk/core": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "engines": { diff --git a/packages/@aws-cdk/aws-iam/test/example.attaching.lit.ts b/packages/@aws-cdk/aws-iam/test/example.attaching.lit.ts index f85f7514c91b6..19940453d684c 100644 --- a/packages/@aws-cdk/aws-iam/test/example.attaching.lit.ts +++ b/packages/@aws-cdk/aws-iam/test/example.attaching.lit.ts @@ -1,17 +1,13 @@ -import * as cdk from '@aws-cdk/core'; -import * as constructs from 'constructs'; +import { SecretValue } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Group, Policy, User } from '../lib'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - export class ExampleConstruct extends Construct { - constructor(scope: constructs.Construct, id: string) { + constructor(scope: Construct, id: string) { super(scope, id); /// !show - const user = new User(this, 'MyUser', { password: cdk.SecretValue.plainText('1234') }); + const user = new User(this, 'MyUser', { password: SecretValue.plainText('1234') }); const group = new Group(this, 'MyGroup'); const policy = new Policy(this, 'MyPolicy'); diff --git a/packages/@aws-cdk/aws-iam/test/example.external-id.lit.ts b/packages/@aws-cdk/aws-iam/test/example.external-id.lit.ts index f13fae1c0837b..35db3c5d49da8 100644 --- a/packages/@aws-cdk/aws-iam/test/example.external-id.lit.ts +++ b/packages/@aws-cdk/aws-iam/test/example.external-id.lit.ts @@ -1,12 +1,8 @@ -import * as constructs from 'constructs'; +import { Construct } from 'constructs'; import * as iam from '../lib'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - export class ExampleConstruct extends Construct { - constructor(scope: constructs.Construct, id: string) { + constructor(scope: Construct, id: string) { super(scope, id); /// !show diff --git a/packages/@aws-cdk/aws-iam/test/example.managedpolicy.lit.ts b/packages/@aws-cdk/aws-iam/test/example.managedpolicy.lit.ts index 6e2859ad24a60..1229c040d5962 100644 --- a/packages/@aws-cdk/aws-iam/test/example.managedpolicy.lit.ts +++ b/packages/@aws-cdk/aws-iam/test/example.managedpolicy.lit.ts @@ -1,12 +1,8 @@ -import * as constructs from 'constructs'; +import { Construct } from 'constructs'; import { Group, ManagedPolicy } from '../lib'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - export class ExampleConstruct extends Construct { - constructor(scope: constructs.Construct, id: string) { + constructor(scope: Construct, id: string) { super(scope, id); /// !show diff --git a/packages/@aws-cdk/aws-iam/test/example.role.lit.ts b/packages/@aws-cdk/aws-iam/test/example.role.lit.ts index 0a2c6eb9ecb48..74ed4c9e02057 100644 --- a/packages/@aws-cdk/aws-iam/test/example.role.lit.ts +++ b/packages/@aws-cdk/aws-iam/test/example.role.lit.ts @@ -1,12 +1,8 @@ -import * as constructs from 'constructs'; +import { Construct } from 'constructs'; import { PolicyStatement, Role, ServicePrincipal } from '../lib'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - export class ExampleConstruct extends Construct { - constructor(scope: constructs.Construct, id: string) { + constructor(scope: Construct, id: string) { super(scope, id); /// !show diff --git a/packages/@aws-cdk/aws-iam/test/immutable-role.test.ts b/packages/@aws-cdk/aws-iam/test/immutable-role.test.ts index 343c437c494e4..30c03badd8e96 100644 --- a/packages/@aws-cdk/aws-iam/test/immutable-role.test.ts +++ b/packages/@aws-cdk/aws-iam/test/immutable-role.test.ts @@ -4,7 +4,7 @@ import * as iam from '../lib'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /* eslint-disable quote-props */ @@ -117,4 +117,4 @@ describe('ImmutableRole', () => { new Construct(immutableRole as unknown as Construct, 'Child'); new Construct(mutableRole.withoutPolicyUpdates() as unknown as Construct, 'Child2'); }); -}); \ No newline at end of file +}); diff --git a/packages/@aws-cdk/aws-imagebuilder/package.json b/packages/@aws-cdk/aws-imagebuilder/package.json index 25cf2f2c92657..68ff44b814653 100644 --- a/packages/@aws-cdk/aws-imagebuilder/package.json +++ b/packages/@aws-cdk/aws-imagebuilder/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-imagebuilder", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::ImageBuilder", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,10 +80,12 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-inspector/package.json b/packages/@aws-cdk/aws-inspector/package.json index a94beb9c3ab2e..cec3ae49936f7 100644 --- a/packages/@aws-cdk/aws-inspector/package.json +++ b/packages/@aws-cdk/aws-inspector/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-inspector", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::Inspector", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -78,12 +79,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-iot/package.json b/packages/@aws-cdk/aws-iot/package.json index baec64baf8142..503a093afbf3c 100644 --- a/packages/@aws-cdk/aws-iot/package.json +++ b/packages/@aws-cdk/aws-iot/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-iot", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::IoT", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -78,12 +79,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-iot1click/package.json b/packages/@aws-cdk/aws-iot1click/package.json index 4000a6cd6721d..2f0e0a6e0c585 100644 --- a/packages/@aws-cdk/aws-iot1click/package.json +++ b/packages/@aws-cdk/aws-iot1click/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-iot1click", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::IoT1Click", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,11 +80,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-iotanalytics/package.json b/packages/@aws-cdk/aws-iotanalytics/package.json index e3b33ffa331b8..eb34ee2586323 100644 --- a/packages/@aws-cdk/aws-iotanalytics/package.json +++ b/packages/@aws-cdk/aws-iotanalytics/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-iotanalytics", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::IoTAnalytics", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,11 +81,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-iotevents/package.json b/packages/@aws-cdk/aws-iotevents/package.json index d0ecd71421f76..b160a8b0c5e3f 100644 --- a/packages/@aws-cdk/aws-iotevents/package.json +++ b/packages/@aws-cdk/aws-iotevents/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-iotevents", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::IoTEvents", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,11 +81,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-iotsitewise/package.json b/packages/@aws-cdk/aws-iotsitewise/package.json index e7301a75e3f49..9e1c8f4465824 100644 --- a/packages/@aws-cdk/aws-iotsitewise/package.json +++ b/packages/@aws-cdk/aws-iotsitewise/package.json @@ -3,6 +3,7 @@ "version": "0.0.0", "description": "The CDK Construct Library for AWS::IoTSiteWise", "main": "lib/index.js", + "private": true, "types": "lib/index.d.ts", "jsii": { "outdir": "dist", @@ -79,10 +80,12 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-iotthingsgraph/package.json b/packages/@aws-cdk/aws-iotthingsgraph/package.json index 59c5396d37c79..e133a986091df 100644 --- a/packages/@aws-cdk/aws-iotthingsgraph/package.json +++ b/packages/@aws-cdk/aws-iotthingsgraph/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-iotthingsgraph", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::IoTThingsGraph", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,11 +81,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-iotwireless/package.json b/packages/@aws-cdk/aws-iotwireless/package.json index df0a35c2bd8fe..ebb44c51be4ce 100644 --- a/packages/@aws-cdk/aws-iotwireless/package.json +++ b/packages/@aws-cdk/aws-iotwireless/package.json @@ -79,10 +79,12 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" @@ -94,5 +96,6 @@ }, "publishConfig": { "tag": "latest" - } + }, + "private": true } diff --git a/packages/@aws-cdk/aws-ivs/package.json b/packages/@aws-cdk/aws-ivs/package.json index ce179233a9efa..ccdc036ea4b44 100644 --- a/packages/@aws-cdk/aws-ivs/package.json +++ b/packages/@aws-cdk/aws-ivs/package.json @@ -3,6 +3,7 @@ "version": "0.0.0", "description": "The CDK Construct Library for AWS::IVS", "main": "lib/index.js", + "private": true, "types": "lib/index.d.ts", "jsii": { "outdir": "dist", @@ -91,11 +92,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-kendra/package.json b/packages/@aws-cdk/aws-kendra/package.json index 0ce7d188ea30f..771af33541ad3 100644 --- a/packages/@aws-cdk/aws-kendra/package.json +++ b/packages/@aws-cdk/aws-kendra/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-kendra", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::Kendra", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,10 +80,12 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-kinesis/package.json b/packages/@aws-cdk/aws-kinesis/package.json index 3c7fd281d363b..a37951ea0af8f 100644 --- a/packages/@aws-cdk/aws-kinesis/package.json +++ b/packages/@aws-cdk/aws-kinesis/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-kinesis", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::Kinesis", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -83,7 +84,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -91,7 +92,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-kinesisanalytics-flink/lib/application-code.ts b/packages/@aws-cdk/aws-kinesisanalytics-flink/lib/application-code.ts index c7d7b49180086..2f72734ed9e47 100644 --- a/packages/@aws-cdk/aws-kinesisanalytics-flink/lib/application-code.ts +++ b/packages/@aws-cdk/aws-kinesisanalytics-flink/lib/application-code.ts @@ -1,7 +1,7 @@ import * as ka from '@aws-cdk/aws-kinesisanalytics'; import * as s3 from '@aws-cdk/aws-s3'; import * as s3_assets from '@aws-cdk/aws-s3-assets'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * The return type of {@link ApplicationCode.bind}. This represents diff --git a/packages/@aws-cdk/aws-kinesisanalytics-flink/package.json b/packages/@aws-cdk/aws-kinesisanalytics-flink/package.json index 2d28b8fd4df7e..96821af4d3d51 100644 --- a/packages/@aws-cdk/aws-kinesisanalytics-flink/package.json +++ b/packages/@aws-cdk/aws-kinesisanalytics-flink/package.json @@ -79,7 +79,7 @@ "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-s3-assets": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -91,7 +91,7 @@ "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-s3-assets": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" @@ -114,5 +114,6 @@ }, "publishConfig": { "tag": "latest" - } + }, + "private": true } diff --git a/packages/@aws-cdk/aws-kinesisanalytics/package.json b/packages/@aws-cdk/aws-kinesisanalytics/package.json index c6b67502056e0..da1635dfd166c 100644 --- a/packages/@aws-cdk/aws-kinesisanalytics/package.json +++ b/packages/@aws-cdk/aws-kinesisanalytics/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-kinesisanalytics", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::KinesisAnalytics", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,12 +82,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-kinesisfirehose/package.json b/packages/@aws-cdk/aws-kinesisfirehose/package.json index ae2d309ed8e24..1154e77c42023 100644 --- a/packages/@aws-cdk/aws-kinesisfirehose/package.json +++ b/packages/@aws-cdk/aws-kinesisfirehose/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-kinesisfirehose", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::KinesisFirehose", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -78,12 +79,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-kms/lib/key.ts b/packages/@aws-cdk/aws-kms/lib/key.ts index 2176d28f5b5bc..b556e1aaa5f19 100644 --- a/packages/@aws-cdk/aws-kms/lib/key.ts +++ b/packages/@aws-cdk/aws-kms/lib/key.ts @@ -92,6 +92,12 @@ abstract class KeyBase extends Resource implements IKey { */ private readonly aliases: Alias[] = []; + constructor(scope: Construct, id: string) { + super(scope, id); + + this.node.addValidation({ validate: () => this.policy?.validateForResourcePolicy() ?? [] }); + } + /** * Defines a new alias for the key. */ @@ -123,12 +129,6 @@ abstract class KeyBase extends Resource implements IKey { return { statementAdded: true, policyDependable: this.policy }; } - protected validate(): string[] { - const errors = super.validate(); - errors.push(...this.policy?.validateForResourcePolicy() || []); - return errors; - } - /** * Grant the indicated permissions on this key to the given principal * diff --git a/packages/@aws-cdk/aws-kms/package.json b/packages/@aws-cdk/aws-kms/package.json index 272c610530357..c0e456c7e8290 100644 --- a/packages/@aws-cdk/aws-kms/package.json +++ b/packages/@aws-cdk/aws-kms/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-kms", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::KMS", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -81,14 +82,14 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-kms/test/alias.test.ts b/packages/@aws-cdk/aws-kms/test/alias.test.ts index 6c4356a7e8f36..b9bfa898decd2 100644 --- a/packages/@aws-cdk/aws-kms/test/alias.test.ts +++ b/packages/@aws-cdk/aws-kms/test/alias.test.ts @@ -6,7 +6,7 @@ import { IKey, Key } from '../lib/key'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; test('default alias', () => { const app = new App(); diff --git a/packages/@aws-cdk/aws-lakeformation/package.json b/packages/@aws-cdk/aws-lakeformation/package.json index 8c3f72401111d..f8ecf1f86eee7 100644 --- a/packages/@aws-cdk/aws-lakeformation/package.json +++ b/packages/@aws-cdk/aws-lakeformation/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-lakeformation", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::LakeFormation", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,11 +81,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-lambda-destinations/lib/event-bridge.ts b/packages/@aws-cdk/aws-lambda-destinations/lib/event-bridge.ts index 9cdcc5c86a83b..fce0478f3cc58 100644 --- a/packages/@aws-cdk/aws-lambda-destinations/lib/event-bridge.ts +++ b/packages/@aws-cdk/aws-lambda-destinations/lib/event-bridge.ts @@ -4,7 +4,7 @@ import { Stack } from '@aws-cdk/core'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Use an Event Bridge event bus as a Lambda destination. diff --git a/packages/@aws-cdk/aws-lambda-destinations/lib/lambda.ts b/packages/@aws-cdk/aws-lambda-destinations/lib/lambda.ts index 319546471473d..e573319523c78 100644 --- a/packages/@aws-cdk/aws-lambda-destinations/lib/lambda.ts +++ b/packages/@aws-cdk/aws-lambda-destinations/lib/lambda.ts @@ -1,12 +1,11 @@ import * as events from '@aws-cdk/aws-events'; import * as targets from '@aws-cdk/aws-events-targets'; import * as lambda from '@aws-cdk/aws-lambda'; - import { EventBridgeDestination } from './event-bridge'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Options for a Lambda destination diff --git a/packages/@aws-cdk/aws-lambda-destinations/lib/sns.ts b/packages/@aws-cdk/aws-lambda-destinations/lib/sns.ts index 02dac90734625..3029269b0e115 100644 --- a/packages/@aws-cdk/aws-lambda-destinations/lib/sns.ts +++ b/packages/@aws-cdk/aws-lambda-destinations/lib/sns.ts @@ -1,6 +1,6 @@ import * as lambda from '@aws-cdk/aws-lambda'; import * as sns from '@aws-cdk/aws-sns'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Use a SNS topic as a Lambda destination diff --git a/packages/@aws-cdk/aws-lambda-destinations/lib/sqs.ts b/packages/@aws-cdk/aws-lambda-destinations/lib/sqs.ts index 873e43f56f05d..fde015e2eacc2 100644 --- a/packages/@aws-cdk/aws-lambda-destinations/lib/sqs.ts +++ b/packages/@aws-cdk/aws-lambda-destinations/lib/sqs.ts @@ -1,6 +1,6 @@ import * as lambda from '@aws-cdk/aws-lambda'; import * as sqs from '@aws-cdk/aws-sqs'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Use a SQS queue as a Lambda destination diff --git a/packages/@aws-cdk/aws-lambda-destinations/package.json b/packages/@aws-cdk/aws-lambda-destinations/package.json index 096ee2f6fc12f..19eb2039089c5 100644 --- a/packages/@aws-cdk/aws-lambda-destinations/package.json +++ b/packages/@aws-cdk/aws-lambda-destinations/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-lambda-destinations", "version": "0.0.0", + "private": true, "description": "CDK Destinations Constructs for AWS Lambda", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -76,7 +77,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -86,7 +87,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-lambda-event-sources/lib/kafka.ts b/packages/@aws-cdk/aws-lambda-event-sources/lib/kafka.ts index f0782964d93ce..56e6b2a64ce26 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/lib/kafka.ts +++ b/packages/@aws-cdk/aws-lambda-event-sources/lib/kafka.ts @@ -5,12 +5,9 @@ import * as lambda from '@aws-cdk/aws-lambda'; import * as msk from '@aws-cdk/aws-msk'; import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; import { Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { StreamEventSource, StreamEventSourceProps } from './stream'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - /** * Properties for a Kafka event source */ @@ -147,7 +144,7 @@ export class SelfManagedKafkaEventSource extends StreamEventSource { } public bind(target: lambda.IFunction) { - if (!Construct.isConstruct(target)) { throw new Error('Function is not a construct. Unexpected error.'); } + if (!(target instanceof Construct)) { throw new Error('Function is not a construct. Unexpected error.'); } target.addEventSourceMapping( this.mappingId(target), this.enrichMappingOptions({ diff --git a/packages/@aws-cdk/aws-lambda-event-sources/package.json b/packages/@aws-cdk/aws-lambda-event-sources/package.json index 33906c1f5219e..f3f925729c8ee 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/package.json +++ b/packages/@aws-cdk/aws-lambda-event-sources/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-lambda-event-sources", "version": "0.0.0", + "private": true, "description": "Event sources for AWS Lambda", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -85,7 +86,7 @@ "@aws-cdk/aws-sns-subscriptions": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -104,7 +105,7 @@ "@aws-cdk/aws-sns-subscriptions": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-lambda-nodejs/lib/function.ts b/packages/@aws-cdk/aws-lambda-nodejs/lib/function.ts index afa3d93d21a9b..be740c40bab78 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/lib/function.ts +++ b/packages/@aws-cdk/aws-lambda-nodejs/lib/function.ts @@ -1,14 +1,11 @@ import * as fs from 'fs'; import * as path from 'path'; import * as lambda from '@aws-cdk/aws-lambda'; +import { Construct } from 'constructs'; import { Bundling } from './bundling'; import { BundlingOptions } from './types'; import { callsites, findUp, LockFile, nodeMajorVersion } from './util'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - /** * Properties for a NodejsFunction */ diff --git a/packages/@aws-cdk/aws-lambda-nodejs/package.json b/packages/@aws-cdk/aws-lambda-nodejs/package.json index c411d343615fe..9f2739eeb1c33 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/package.json +++ b/packages/@aws-cdk/aws-lambda-nodejs/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-lambda-nodejs", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS Lambda in Node.js", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -73,13 +74,13 @@ "dependencies": { "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-lambda-python/lib/function.ts b/packages/@aws-cdk/aws-lambda-python/lib/function.ts index 733c115c0383d..fc26d61aa83eb 100644 --- a/packages/@aws-cdk/aws-lambda-python/lib/function.ts +++ b/packages/@aws-cdk/aws-lambda-python/lib/function.ts @@ -2,12 +2,9 @@ import * as fs from 'fs'; import * as path from 'path'; import * as lambda from '@aws-cdk/aws-lambda'; import { AssetHashType } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { bundle } from './bundling'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - /** * Properties for a PythonFunction */ diff --git a/packages/@aws-cdk/aws-lambda-python/lib/layer.ts b/packages/@aws-cdk/aws-lambda-python/lib/layer.ts index 3299781bb413c..9fe5576a7fce3 100644 --- a/packages/@aws-cdk/aws-lambda-python/lib/layer.ts +++ b/packages/@aws-cdk/aws-lambda-python/lib/layer.ts @@ -1,11 +1,8 @@ import * as path from 'path'; import * as lambda from '@aws-cdk/aws-lambda'; +import { Construct } from 'constructs'; import { bundle } from './bundling'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - /** * Properties for PythonLayerVersion */ diff --git a/packages/@aws-cdk/aws-lambda-python/package.json b/packages/@aws-cdk/aws-lambda-python/package.json index f22b2076ee43f..738779bfaea2d 100644 --- a/packages/@aws-cdk/aws-lambda-python/package.json +++ b/packages/@aws-cdk/aws-lambda-python/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-lambda-python", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS Lambda in Python", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -71,14 +72,14 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/aws-ec2": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/aws-ec2": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-lambda/lib/code.ts b/packages/@aws-cdk/aws-lambda/lib/code.ts index b78859bf3515c..6557a6786065a 100644 --- a/packages/@aws-cdk/aws-lambda/lib/code.ts +++ b/packages/@aws-cdk/aws-lambda/lib/code.ts @@ -4,10 +4,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as s3 from '@aws-cdk/aws-s3'; import * as s3_assets from '@aws-cdk/aws-s3-assets'; import * as cdk from '@aws-cdk/core'; - -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Represents the Lambda Handler Code. diff --git a/packages/@aws-cdk/aws-lambda/lib/destination.ts b/packages/@aws-cdk/aws-lambda/lib/destination.ts index 8e2917ab827fc..1a80c06b0a0e9 100644 --- a/packages/@aws-cdk/aws-lambda/lib/destination.ts +++ b/packages/@aws-cdk/aws-lambda/lib/destination.ts @@ -1,9 +1,8 @@ - import { IFunction } from './function-base'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * A destination configuration diff --git a/packages/@aws-cdk/aws-lambda/lib/function-base.ts b/packages/@aws-cdk/aws-lambda/lib/function-base.ts index 3ea52d5c3433b..aea400205cfc3 100644 --- a/packages/@aws-cdk/aws-lambda/lib/function-base.ts +++ b/packages/@aws-cdk/aws-lambda/lib/function-base.ts @@ -1,7 +1,8 @@ import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; -import { ConstructNode, IResource, Resource, Token } from '@aws-cdk/core'; +import { IResource, Resource, Token } from '@aws-cdk/core'; +import { Node } from 'constructs'; import { AliasOptions } from './alias'; import { EventInvokeConfig, EventInvokeConfigOptions } from './event-invoke-config'; import { IEventSource } from './event-source'; @@ -54,7 +55,7 @@ export interface IFunction extends IResource, ec2.IConnectable, iam.IGrantable { /** * The construct node where permissions are attached. */ - readonly permissionsNode: ConstructNode; + readonly permissionsNode: Node; /** * Adds an event source that maps to this AWS Lambda function. @@ -201,7 +202,7 @@ export abstract class FunctionBase extends Resource implements IFunction { /** * The construct node where permissions are attached. */ - public abstract readonly permissionsNode: ConstructNode; + public abstract readonly permissionsNode: Node; /** * Whether the addPermission() call adds any permissions @@ -360,7 +361,7 @@ export abstract class FunctionBase extends Resource implements IFunction { * For use internally for constructs, when the tree is set up in non-standard ways. Ex: SingletonFunction. * @internal */ - protected _functionNode(): ConstructNode { + protected _functionNode(): Node { return this.node; } diff --git a/packages/@aws-cdk/aws-lambda/lib/permission.ts b/packages/@aws-cdk/aws-lambda/lib/permission.ts index 65264d0c96a7f..f0d50810ab36e 100644 --- a/packages/@aws-cdk/aws-lambda/lib/permission.ts +++ b/packages/@aws-cdk/aws-lambda/lib/permission.ts @@ -1,5 +1,5 @@ import * as iam from '@aws-cdk/aws-iam'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Represents a permission statement that can be added to a Lambda's resource policy diff --git a/packages/@aws-cdk/aws-lambda/lib/private/scalable-function-attribute.ts b/packages/@aws-cdk/aws-lambda/lib/private/scalable-function-attribute.ts index 34ceb28ad861f..b04a1964e015d 100644 --- a/packages/@aws-cdk/aws-lambda/lib/private/scalable-function-attribute.ts +++ b/packages/@aws-cdk/aws-lambda/lib/private/scalable-function-attribute.ts @@ -4,7 +4,7 @@ import { IScalableFunctionAttribute, UtilizationScalingOptions } from '../scalab // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * A scalable lambda alias attribute diff --git a/packages/@aws-cdk/aws-lambda/lib/scalable-attribute-api.ts b/packages/@aws-cdk/aws-lambda/lib/scalable-attribute-api.ts index e64fcbd5a8ca7..de1501cdee0f1 100644 --- a/packages/@aws-cdk/aws-lambda/lib/scalable-attribute-api.ts +++ b/packages/@aws-cdk/aws-lambda/lib/scalable-attribute-api.ts @@ -1,6 +1,5 @@ import * as appscaling from '@aws-cdk/aws-applicationautoscaling'; -import { IConstruct } from '@aws-cdk/core'; - +import { IConstruct } from 'constructs'; /** * Interface for scalable attributes diff --git a/packages/@aws-cdk/aws-lambda/lib/singleton-lambda.ts b/packages/@aws-cdk/aws-lambda/lib/singleton-lambda.ts index 170f1f3e37573..6092e1c51d567 100644 --- a/packages/@aws-cdk/aws-lambda/lib/singleton-lambda.ts +++ b/packages/@aws-cdk/aws-lambda/lib/singleton-lambda.ts @@ -1,6 +1,6 @@ import * as iam from '@aws-cdk/aws-iam'; import * as cdk from '@aws-cdk/core'; -import { Construct } from 'constructs'; +import { Construct, IConstruct, Node } from 'constructs'; import { Function as LambdaFunction, FunctionProps } from './function'; import { FunctionBase } from './function-base'; import { Version } from './lambda-version'; @@ -45,7 +45,7 @@ export class SingletonFunction extends FunctionBase { public readonly functionName: string; public readonly functionArn: string; public readonly role?: iam.IRole; - public readonly permissionsNode: cdk.ConstructNode; + public readonly permissionsNode: Node; protected readonly canCreatePermissions: boolean; private lambdaFunction: LambdaFunction; @@ -91,7 +91,7 @@ export class SingletonFunction extends FunctionBase { * The SingletonFunction construct cannot be added as a dependency of another construct using * node.addDependency(). Use this method instead to declare this as a dependency of another construct. */ - public dependOn(down: cdk.IConstruct) { + public dependOn(down: IConstruct) { down.node.addDependency(this.lambdaFunction); } @@ -104,7 +104,7 @@ export class SingletonFunction extends FunctionBase { * Returns the construct tree node that corresponds to the lambda function. * @internal */ - protected _functionNode(): cdk.ConstructNode { + protected _functionNode(): Node { return this.lambdaFunction.node; } diff --git a/packages/@aws-cdk/aws-lambda/package.json b/packages/@aws-cdk/aws-lambda/package.json index 6eab5cd11b870..fca2936895480 100644 --- a/packages/@aws-cdk/aws-lambda/package.json +++ b/packages/@aws-cdk/aws-lambda/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-lambda", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::Lambda", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -103,7 +104,7 @@ "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -124,7 +125,7 @@ "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-licensemanager/package.json b/packages/@aws-cdk/aws-licensemanager/package.json index 951f8982392ab..fd1eb346bbd4f 100644 --- a/packages/@aws-cdk/aws-licensemanager/package.json +++ b/packages/@aws-cdk/aws-licensemanager/package.json @@ -79,10 +79,12 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" @@ -94,5 +96,6 @@ }, "publishConfig": { "tag": "latest" - } + }, + "private": true } diff --git a/packages/@aws-cdk/aws-logs-destinations/lib/kinesis.ts b/packages/@aws-cdk/aws-logs-destinations/lib/kinesis.ts index e4f57f5d4b33f..3b2e3097a8985 100644 --- a/packages/@aws-cdk/aws-logs-destinations/lib/kinesis.ts +++ b/packages/@aws-cdk/aws-logs-destinations/lib/kinesis.ts @@ -1,7 +1,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as kinesis from '@aws-cdk/aws-kinesis'; import * as logs from '@aws-cdk/aws-logs'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Use a Kinesis stream as the destination for a log subscription diff --git a/packages/@aws-cdk/aws-logs-destinations/lib/lambda.ts b/packages/@aws-cdk/aws-logs-destinations/lib/lambda.ts index c88c3134d16ab..6aaade9860135 100644 --- a/packages/@aws-cdk/aws-logs-destinations/lib/lambda.ts +++ b/packages/@aws-cdk/aws-logs-destinations/lib/lambda.ts @@ -1,7 +1,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as lambda from '@aws-cdk/aws-lambda'; import * as logs from '@aws-cdk/aws-logs'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Use a Lamda Function as the destination for a log subscription diff --git a/packages/@aws-cdk/aws-logs-destinations/package.json b/packages/@aws-cdk/aws-logs-destinations/package.json index a4edf4ce3473b..72aaf143e782b 100644 --- a/packages/@aws-cdk/aws-logs-destinations/package.json +++ b/packages/@aws-cdk/aws-logs-destinations/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-logs-destinations", "version": "0.0.0", + "private": true, "description": "Log Destinations for AWS CloudWatch Logs", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -75,7 +76,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -84,7 +85,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-logs/lib/cross-account-destination.ts b/packages/@aws-cdk/aws-logs/lib/cross-account-destination.ts index 2d024ad8e88e1..16aec4ef97e2b 100644 --- a/packages/@aws-cdk/aws-logs/lib/cross-account-destination.ts +++ b/packages/@aws-cdk/aws-logs/lib/cross-account-destination.ts @@ -5,10 +5,6 @@ import { ILogGroup } from './log-group'; import { CfnDestination } from './logs.generated'; import { ILogSubscriptionDestination, LogSubscriptionDestinationConfig } from './subscription-filter'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Properties for a CrossAccountDestination */ @@ -97,7 +93,7 @@ export class CrossAccountDestination extends cdk.Resource implements ILogSubscri this.policyDocument.addStatements(statement); } - public bind(_scope: CoreConstruct, _sourceLogGroup: ILogGroup): LogSubscriptionDestinationConfig { + public bind(_scope: Construct, _sourceLogGroup: ILogGroup): LogSubscriptionDestinationConfig { return { arn: this.destinationArn }; } diff --git a/packages/@aws-cdk/aws-logs/lib/log-retention.ts b/packages/@aws-cdk/aws-logs/lib/log-retention.ts index 4056c0a0f09c9..844cfd5c36188 100644 --- a/packages/@aws-cdk/aws-logs/lib/log-retention.ts +++ b/packages/@aws-cdk/aws-logs/lib/log-retention.ts @@ -5,10 +5,6 @@ import * as cdk from '@aws-cdk/core'; import { Construct } from 'constructs'; import { RetentionDays } from './log-group'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Construction properties for a LogRetention. */ @@ -69,7 +65,7 @@ export interface LogRetentionRetryOptions { * Log group can be created in the region that is different from stack region by * specifying `logGroupRegion` */ -export class LogRetention extends CoreConstruct { +export class LogRetention extends Construct { /** * The ARN of the LogGroup. @@ -128,7 +124,7 @@ export class LogRetention extends CoreConstruct { /** * Private provider Lambda function to support the log retention custom resource. */ -class LogRetentionFunction extends CoreConstruct { +class LogRetentionFunction extends Construct { public readonly functionArn: cdk.Reference; constructor(scope: Construct, id: string, props: LogRetentionProps) { @@ -173,7 +169,7 @@ class LogRetentionFunction extends CoreConstruct { if (cdk.CfnResource.isCfnResource(child)) { resource.addDependsOn(child); } - if (cdk.Construct.isConstruct(child) && child.node.defaultChild && cdk.CfnResource.isCfnResource(child.node.defaultChild)) { + if (Construct.isConstruct(child) && child.node.defaultChild && cdk.CfnResource.isCfnResource(child.node.defaultChild)) { resource.addDependsOn(child.node.defaultChild); } }); diff --git a/packages/@aws-cdk/aws-logs/lib/subscription-filter.ts b/packages/@aws-cdk/aws-logs/lib/subscription-filter.ts index 290534ea97f97..099094032d3a1 100644 --- a/packages/@aws-cdk/aws-logs/lib/subscription-filter.ts +++ b/packages/@aws-cdk/aws-logs/lib/subscription-filter.ts @@ -4,10 +4,6 @@ import { Construct } from 'constructs'; import { ILogGroup, SubscriptionFilterOptions } from './log-group'; import { CfnSubscriptionFilter } from './logs.generated'; -// v2 - keep this section separate to reduce merge conflicts when merging forwrad into v2 branch -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Interface for classes that can be the destination of a log Subscription */ @@ -22,7 +18,7 @@ export interface ILogSubscriptionDestination { * The destination may reconfigure its own permissions in response to this * function call. */ - bind(scope: CoreConstruct, sourceLogGroup: ILogGroup): LogSubscriptionDestinationConfig; + bind(scope: Construct, sourceLogGroup: ILogGroup): LogSubscriptionDestinationConfig; } /** diff --git a/packages/@aws-cdk/aws-logs/package.json b/packages/@aws-cdk/aws-logs/package.json index b5bded382ba10..37b4b97c342c5 100644 --- a/packages/@aws-cdk/aws-logs/package.json +++ b/packages/@aws-cdk/aws-logs/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-logs", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::Logs", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -88,7 +89,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-s3-assets": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -97,7 +98,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-s3-assets": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-lookoutvision/package.json b/packages/@aws-cdk/aws-lookoutvision/package.json index 0a812168e8241..a0814219c8732 100644 --- a/packages/@aws-cdk/aws-lookoutvision/package.json +++ b/packages/@aws-cdk/aws-lookoutvision/package.json @@ -81,10 +81,12 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" @@ -96,5 +98,6 @@ }, "publishConfig": { "tag": "latest" - } + }, + "private": true } diff --git a/packages/@aws-cdk/aws-macie/package.json b/packages/@aws-cdk/aws-macie/package.json index 7e2851d383765..09f4858b23fc3 100644 --- a/packages/@aws-cdk/aws-macie/package.json +++ b/packages/@aws-cdk/aws-macie/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-macie", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::Macie", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,10 +80,12 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-managedblockchain/package.json b/packages/@aws-cdk/aws-managedblockchain/package.json index c94f2391242fb..79cece1d537f0 100644 --- a/packages/@aws-cdk/aws-managedblockchain/package.json +++ b/packages/@aws-cdk/aws-managedblockchain/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-managedblockchain", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::ManagedBlockchain", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,11 +81,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-mediaconnect/package.json b/packages/@aws-cdk/aws-mediaconnect/package.json index dbfd544d52dd2..cfce1515657d4 100644 --- a/packages/@aws-cdk/aws-mediaconnect/package.json +++ b/packages/@aws-cdk/aws-mediaconnect/package.json @@ -79,10 +79,12 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" @@ -94,5 +96,6 @@ }, "publishConfig": { "tag": "latest" - } + }, + "private": true } diff --git a/packages/@aws-cdk/aws-mediaconvert/package.json b/packages/@aws-cdk/aws-mediaconvert/package.json index 938a726f92183..a6560107ffec8 100644 --- a/packages/@aws-cdk/aws-mediaconvert/package.json +++ b/packages/@aws-cdk/aws-mediaconvert/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-mediaconvert", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::MediaConvert", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,11 +81,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-medialive/package.json b/packages/@aws-cdk/aws-medialive/package.json index 16ecfadc7c1bb..e67b424bff02d 100644 --- a/packages/@aws-cdk/aws-medialive/package.json +++ b/packages/@aws-cdk/aws-medialive/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-medialive", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::MediaLive", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,11 +81,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-mediapackage/package.json b/packages/@aws-cdk/aws-mediapackage/package.json index 40913de5b816e..6074b7a4a099e 100644 --- a/packages/@aws-cdk/aws-mediapackage/package.json +++ b/packages/@aws-cdk/aws-mediapackage/package.json @@ -4,6 +4,7 @@ "description": "The CDK Construct Library for AWS::MediaPackage", "main": "lib/index.js", "types": "lib/index.d.ts", + "private": true, "jsii": { "outdir": "dist", "projectReferences": true, @@ -79,10 +80,12 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-mediastore/package.json b/packages/@aws-cdk/aws-mediastore/package.json index 46878264355f9..fb864d580dc34 100644 --- a/packages/@aws-cdk/aws-mediastore/package.json +++ b/packages/@aws-cdk/aws-mediastore/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-mediastore", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::MediaStore", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,11 +81,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-msk/package.json b/packages/@aws-cdk/aws-msk/package.json index efa91da07d39f..117d80e38cfed 100644 --- a/packages/@aws-cdk/aws-msk/package.json +++ b/packages/@aws-cdk/aws-msk/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-msk", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::MSK", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,11 +81,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-mwaa/package.json b/packages/@aws-cdk/aws-mwaa/package.json index 17a5ba80b55f1..42c8dba38c116 100644 --- a/packages/@aws-cdk/aws-mwaa/package.json +++ b/packages/@aws-cdk/aws-mwaa/package.json @@ -79,10 +79,12 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" @@ -94,5 +96,6 @@ }, "publishConfig": { "tag": "latest" - } + }, + "private": true } diff --git a/packages/@aws-cdk/aws-neptune/package.json b/packages/@aws-cdk/aws-neptune/package.json index 5afe6d91322a2..97784911a0a9d 100644 --- a/packages/@aws-cdk/aws-neptune/package.json +++ b/packages/@aws-cdk/aws-neptune/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-neptune", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::Neptune", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -83,14 +84,14 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/aws-ec2": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-networkfirewall/package.json b/packages/@aws-cdk/aws-networkfirewall/package.json index 8c218072fe92b..4c3439e727d3e 100644 --- a/packages/@aws-cdk/aws-networkfirewall/package.json +++ b/packages/@aws-cdk/aws-networkfirewall/package.json @@ -79,10 +79,12 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" @@ -94,5 +96,6 @@ }, "publishConfig": { "tag": "latest" - } + }, + "private": true } diff --git a/packages/@aws-cdk/aws-networkmanager/package.json b/packages/@aws-cdk/aws-networkmanager/package.json index 9c38f74d32916..4d057afbae379 100644 --- a/packages/@aws-cdk/aws-networkmanager/package.json +++ b/packages/@aws-cdk/aws-networkmanager/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-networkmanager", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::NetworkManager", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,10 +80,12 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-opsworks/package.json b/packages/@aws-cdk/aws-opsworks/package.json index b00cff3b7056e..01033346485b3 100644 --- a/packages/@aws-cdk/aws-opsworks/package.json +++ b/packages/@aws-cdk/aws-opsworks/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-opsworks", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::OpsWorks", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -78,12 +79,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-opsworkscm/package.json b/packages/@aws-cdk/aws-opsworkscm/package.json index 3c102533e89dc..21ba46f89d3cd 100644 --- a/packages/@aws-cdk/aws-opsworkscm/package.json +++ b/packages/@aws-cdk/aws-opsworkscm/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-opsworkscm", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::OpsWorksCM", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,11 +81,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-pinpoint/package.json b/packages/@aws-cdk/aws-pinpoint/package.json index ed7fe94c40090..f2ceb51355fc5 100644 --- a/packages/@aws-cdk/aws-pinpoint/package.json +++ b/packages/@aws-cdk/aws-pinpoint/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-pinpoint", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::Pinpoint", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,11 +81,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-pinpointemail/package.json b/packages/@aws-cdk/aws-pinpointemail/package.json index 5f98fa3d04e24..7b5d7ab1417bf 100644 --- a/packages/@aws-cdk/aws-pinpointemail/package.json +++ b/packages/@aws-cdk/aws-pinpointemail/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-pinpointemail", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::PinpointEmail", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,11 +81,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-qldb/package.json b/packages/@aws-cdk/aws-qldb/package.json index 257716f07faea..73cc4fb0a6a1e 100644 --- a/packages/@aws-cdk/aws-qldb/package.json +++ b/packages/@aws-cdk/aws-qldb/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-qldb", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::QLDB", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,11 +81,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-quicksight/package.json b/packages/@aws-cdk/aws-quicksight/package.json index 14526eb10a35a..263b0a0b2b833 100644 --- a/packages/@aws-cdk/aws-quicksight/package.json +++ b/packages/@aws-cdk/aws-quicksight/package.json @@ -81,10 +81,12 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" @@ -96,5 +98,6 @@ }, "publishConfig": { "tag": "latest" - } + }, + "private": true } diff --git a/packages/@aws-cdk/aws-ram/package.json b/packages/@aws-cdk/aws-ram/package.json index 2ca7d27497147..1b38be083e323 100644 --- a/packages/@aws-cdk/aws-ram/package.json +++ b/packages/@aws-cdk/aws-ram/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-ram", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::RAM", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,11 +81,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-rds/lib/cluster-engine.ts b/packages/@aws-cdk/aws-rds/lib/cluster-engine.ts index 7e75162761a33..11a3e72531d3e 100644 --- a/packages/@aws-cdk/aws-rds/lib/cluster-engine.ts +++ b/packages/@aws-cdk/aws-rds/lib/cluster-engine.ts @@ -1,13 +1,10 @@ import * as iam from '@aws-cdk/aws-iam'; import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; +import { Construct } from 'constructs'; import { IEngine } from './engine'; import { EngineVersion } from './engine-version'; import { IParameterGroup, ParameterGroup } from './parameter-group'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - /** * The extra options passed to the {@link IClusterEngine.bindToCluster} method. */ diff --git a/packages/@aws-cdk/aws-rds/lib/instance-engine.ts b/packages/@aws-cdk/aws-rds/lib/instance-engine.ts index 3b35ad1c87ce1..12f1c15f69e29 100644 --- a/packages/@aws-cdk/aws-rds/lib/instance-engine.ts +++ b/packages/@aws-cdk/aws-rds/lib/instance-engine.ts @@ -1,13 +1,10 @@ import * as iam from '@aws-cdk/aws-iam'; import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; +import { Construct } from 'constructs'; import { IEngine } from './engine'; import { EngineVersion } from './engine-version'; import { IOptionGroup, OptionGroup } from './option-group'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - /** * The options passed to {@link IInstanceEngine.bind}. */ diff --git a/packages/@aws-cdk/aws-rds/lib/private/util.ts b/packages/@aws-cdk/aws-rds/lib/private/util.ts index df9ace2dbd3bc..5419adcd7b1c5 100644 --- a/packages/@aws-cdk/aws-rds/lib/private/util.ts +++ b/packages/@aws-cdk/aws-rds/lib/private/util.ts @@ -7,7 +7,7 @@ import { Credentials } from '../props'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * The default set of characters we exclude from generated passwords for database users. diff --git a/packages/@aws-cdk/aws-rds/package.json b/packages/@aws-cdk/aws-rds/package.json index 685b5c399b240..049134ecca2a5 100644 --- a/packages/@aws-cdk/aws-rds/package.json +++ b/packages/@aws-cdk/aws-rds/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-rds", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::RDS", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -91,7 +92,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -104,7 +105,7 @@ "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-redshift/package.json b/packages/@aws-cdk/aws-redshift/package.json index cede50f836f54..2aa6b04d95ddc 100644 --- a/packages/@aws-cdk/aws-redshift/package.json +++ b/packages/@aws-cdk/aws-redshift/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-redshift", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::Redshift", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -84,7 +85,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -94,7 +95,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-resourcegroups/package.json b/packages/@aws-cdk/aws-resourcegroups/package.json index bd1848d6681e9..1c113590a9f06 100644 --- a/packages/@aws-cdk/aws-resourcegroups/package.json +++ b/packages/@aws-cdk/aws-resourcegroups/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-resourcegroups", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::ResourceGroups", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,10 +80,12 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-robomaker/package.json b/packages/@aws-cdk/aws-robomaker/package.json index be52d60f6a739..4a5fc45cc1d7f 100644 --- a/packages/@aws-cdk/aws-robomaker/package.json +++ b/packages/@aws-cdk/aws-robomaker/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-robomaker", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::RoboMaker", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,11 +81,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-route53-patterns/lib/website-redirect.ts b/packages/@aws-cdk/aws-route53-patterns/lib/website-redirect.ts index db63b7327a75d..4a9ad0f7bd88c 100644 --- a/packages/@aws-cdk/aws-route53-patterns/lib/website-redirect.ts +++ b/packages/@aws-cdk/aws-route53-patterns/lib/website-redirect.ts @@ -7,10 +7,6 @@ import { BlockPublicAccess, Bucket, RedirectProtocol } from '@aws-cdk/aws-s3'; import { RemovalPolicy, Stack, Token } from '@aws-cdk/core'; import { Construct } from 'constructs'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Properties to configure an HTTPS Redirect */ @@ -55,7 +51,7 @@ export interface HttpsRedirectProps { * Allows creating a domainA -> domainB redirect using CloudFront and S3. * You can specify multiple domains to be redirected. */ -export class HttpsRedirect extends CoreConstruct { +export class HttpsRedirect extends Construct { constructor(scope: Construct, id: string, props: HttpsRedirectProps) { super(scope, id); diff --git a/packages/@aws-cdk/aws-route53-patterns/package.json b/packages/@aws-cdk/aws-route53-patterns/package.json index b10d3e4ceb714..7cd26744955f2 100644 --- a/packages/@aws-cdk/aws-route53-patterns/package.json +++ b/packages/@aws-cdk/aws-route53-patterns/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-route53-patterns", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS Route53 patterns", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,7 +80,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -91,7 +92,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-route53-targets/lib/cloudfront-target.ts b/packages/@aws-cdk/aws-route53-targets/lib/cloudfront-target.ts index d11e0c9de2324..6dd08982301f6 100644 --- a/packages/@aws-cdk/aws-route53-targets/lib/cloudfront-target.ts +++ b/packages/@aws-cdk/aws-route53-targets/lib/cloudfront-target.ts @@ -1,6 +1,7 @@ import * as cloudfront from '@aws-cdk/aws-cloudfront'; import * as route53 from '@aws-cdk/aws-route53'; -import { Aws, CfnMapping, IConstruct, Stack } from '@aws-cdk/core'; +import { Aws, CfnMapping, Stack } from '@aws-cdk/core'; +import { IConstruct } from 'constructs'; /** * Use a CloudFront Distribution as an alias record target diff --git a/packages/@aws-cdk/aws-route53-targets/package.json b/packages/@aws-cdk/aws-route53-targets/package.json index d98999baaab6a..3c69660e67b74 100644 --- a/packages/@aws-cdk/aws-route53-targets/package.json +++ b/packages/@aws-cdk/aws-route53-targets/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-route53-targets", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS Route53 Alias Targets", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -85,7 +86,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -102,7 +103,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-route53/lib/record-set.ts b/packages/@aws-cdk/aws-route53/lib/record-set.ts index a86195f1d0055..27cf9b7548928 100644 --- a/packages/@aws-cdk/aws-route53/lib/record-set.ts +++ b/packages/@aws-cdk/aws-route53/lib/record-set.ts @@ -9,10 +9,6 @@ import { determineFullyQualifiedDomainName } from './util'; const CROSS_ACCOUNT_ZONE_DELEGATION_RESOURCE_TYPE = 'Custom::CrossAccountZoneDelegation'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * A record set */ @@ -598,7 +594,7 @@ export interface CrossAccountZoneDelegationRecordProps { /** * A Cross Account Zone Delegation record */ -export class CrossAccountZoneDelegationRecord extends CoreConstruct { +export class CrossAccountZoneDelegationRecord extends Construct { constructor(scope: Construct, id: string, props: CrossAccountZoneDelegationRecordProps) { super(scope, id); diff --git a/packages/@aws-cdk/aws-route53/lib/util.ts b/packages/@aws-cdk/aws-route53/lib/util.ts index d703c77348538..05844a5fd2c6e 100644 --- a/packages/@aws-cdk/aws-route53/lib/util.ts +++ b/packages/@aws-cdk/aws-route53/lib/util.ts @@ -3,7 +3,7 @@ import { IHostedZone } from './hosted-zone-ref'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Validates a zone name is valid by Route53 specifc naming rules, diff --git a/packages/@aws-cdk/aws-route53/lib/vpc-endpoint-service-domain-name.ts b/packages/@aws-cdk/aws-route53/lib/vpc-endpoint-service-domain-name.ts index 9098503b625f4..0576a9f89ddc9 100644 --- a/packages/@aws-cdk/aws-route53/lib/vpc-endpoint-service-domain-name.ts +++ b/packages/@aws-cdk/aws-route53/lib/vpc-endpoint-service-domain-name.ts @@ -5,10 +5,6 @@ import { AwsCustomResource, AwsCustomResourcePolicy, PhysicalResourceId } from ' import { Construct } from 'constructs'; import { IPublicHostedZone, TxtRecord } from '../lib'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Properties to configure a VPC Endpoint Service domain name */ @@ -38,7 +34,7 @@ export interface VpcEndpointServiceDomainNameProps { /** * A Private DNS configuration for a VPC endpoint service. */ -export class VpcEndpointServiceDomainName extends CoreConstruct { +export class VpcEndpointServiceDomainName extends Construct { // Track all domain names created, so someone doesn't accidentally associate two domains with a single service private static readonly endpointServices: IVpcEndpointService[] = []; diff --git a/packages/@aws-cdk/aws-route53/package.json b/packages/@aws-cdk/aws-route53/package.json index 9a22737d55347..c4af430d4b864 100644 --- a/packages/@aws-cdk/aws-route53/package.json +++ b/packages/@aws-cdk/aws-route53/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-route53", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::Route53", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -88,7 +89,7 @@ "@aws-cdk/core": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -98,7 +99,7 @@ "@aws-cdk/core": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-route53resolver/package.json b/packages/@aws-cdk/aws-route53resolver/package.json index 79142ad18b7ef..62a72e99360f0 100644 --- a/packages/@aws-cdk/aws-route53resolver/package.json +++ b/packages/@aws-cdk/aws-route53resolver/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-route53resolver", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::Route53Resolver", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,11 +80,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-s3-assets/lib/asset.ts b/packages/@aws-cdk/aws-s3-assets/lib/asset.ts index 510834a61c634..3cd21d4fe9d1e 100644 --- a/packages/@aws-cdk/aws-s3-assets/lib/asset.ts +++ b/packages/@aws-cdk/aws-s3-assets/lib/asset.ts @@ -8,10 +8,6 @@ import * as cxapi from '@aws-cdk/cx-api'; import { Construct } from 'constructs'; import { toSymlinkFollow } from './compat'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct as CoreConstruct } from '@aws-cdk/core'; - export interface AssetOptions extends assets.CopyOptions, cdk.AssetOptions { /** * A list of principals that should be able to read this asset from S3. @@ -55,7 +51,7 @@ export interface AssetProps extends AssetOptions { * An asset represents a local file or directory, which is automatically uploaded to S3 * and then can be referenced within a CDK application. */ -export class Asset extends CoreConstruct implements cdk.IAsset { +export class Asset extends Construct implements cdk.IAsset { /** * Attribute that represents the name of the bucket this asset exists in. */ diff --git a/packages/@aws-cdk/aws-s3-assets/package.json b/packages/@aws-cdk/aws-s3-assets/package.json index 6d03905f64f85..cb769d7acea6f 100644 --- a/packages/@aws-cdk/aws-s3-assets/package.json +++ b/packages/@aws-cdk/aws-s3-assets/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-s3-assets", "version": "0.0.0", + "private": true, "description": "Deploy local files and directories to S3", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -82,7 +83,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -92,7 +93,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-s3-deployment/lib/bucket-deployment.ts b/packages/@aws-cdk/aws-s3-deployment/lib/bucket-deployment.ts index 4ca33864952f3..127525a06ebbd 100644 --- a/packages/@aws-cdk/aws-s3-deployment/lib/bucket-deployment.ts +++ b/packages/@aws-cdk/aws-s3-deployment/lib/bucket-deployment.ts @@ -9,10 +9,6 @@ import { AwsCliLayer } from '@aws-cdk/lambda-layer-awscli'; import { Construct } from 'constructs'; import { ISource, SourceConfig } from './source'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct as CoreConstruct } from '@aws-cdk/core'; - export interface BucketDeploymentProps { /** * The sources from which to deploy the contents of this bucket. @@ -179,7 +175,7 @@ export interface BucketDeploymentProps { readonly vpcSubnets?: ec2.SubnetSelection; } -export class BucketDeployment extends CoreConstruct { +export class BucketDeployment extends Construct { constructor(scope: Construct, id: string, props: BucketDeploymentProps) { super(scope, id); diff --git a/packages/@aws-cdk/aws-s3-deployment/lib/source.ts b/packages/@aws-cdk/aws-s3-deployment/lib/source.ts index 558c32556c25c..3add67057797a 100644 --- a/packages/@aws-cdk/aws-s3-deployment/lib/source.ts +++ b/packages/@aws-cdk/aws-s3-deployment/lib/source.ts @@ -1,10 +1,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as s3 from '@aws-cdk/aws-s3'; import * as s3_assets from '@aws-cdk/aws-s3-assets'; - -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; export interface SourceConfig { /** diff --git a/packages/@aws-cdk/aws-s3-deployment/package.json b/packages/@aws-cdk/aws-s3-deployment/package.json index e92226c156359..ad3a98ca75a0d 100644 --- a/packages/@aws-cdk/aws-s3-deployment/package.json +++ b/packages/@aws-cdk/aws-s3-deployment/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-s3-deployment", "version": "0.0.0", + "private": true, "description": "Constructs for deploying contents to S3 buckets", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -94,7 +95,7 @@ "@aws-cdk/aws-s3-assets": "0.0.0", "@aws-cdk/lambda-layer-awscli": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -106,7 +107,7 @@ "@aws-cdk/aws-s3-assets": "0.0.0", "@aws-cdk/lambda-layer-awscli": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-s3-notifications/lib/lambda.ts b/packages/@aws-cdk/aws-s3-notifications/lib/lambda.ts index 183512a996e26..d74b48483d0ed 100644 --- a/packages/@aws-cdk/aws-s3-notifications/lib/lambda.ts +++ b/packages/@aws-cdk/aws-s3-notifications/lib/lambda.ts @@ -5,7 +5,7 @@ import { CfnResource, Names, Stack } from '@aws-cdk/core'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Use a Lambda function as a bucket notification destination @@ -17,7 +17,7 @@ export class LambdaDestination implements s3.IBucketNotificationDestination { public bind(_scope: Construct, bucket: s3.IBucket): s3.BucketNotificationDestinationConfig { const permissionId = `AllowBucketNotificationsTo${Names.nodeUniqueId(this.fn.permissionsNode)}`; - if (!Construct.isConstruct(bucket)) { + if (!(bucket instanceof Construct)) { throw new Error(`LambdaDestination for function ${Names.nodeUniqueId(this.fn.permissionsNode)} can only be configured on a bucket construct (Bucket ${bucket.bucketName})`); } diff --git a/packages/@aws-cdk/aws-s3-notifications/lib/sns.ts b/packages/@aws-cdk/aws-s3-notifications/lib/sns.ts index 955d3c4eb2c54..38a83e6e2f445 100644 --- a/packages/@aws-cdk/aws-s3-notifications/lib/sns.ts +++ b/packages/@aws-cdk/aws-s3-notifications/lib/sns.ts @@ -1,7 +1,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as s3 from '@aws-cdk/aws-s3'; import * as sns from '@aws-cdk/aws-sns'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Use an SNS topic as a bucket notification destination diff --git a/packages/@aws-cdk/aws-s3-notifications/lib/sqs.ts b/packages/@aws-cdk/aws-s3-notifications/lib/sqs.ts index 330a941a9ae86..88c5bab7a767c 100644 --- a/packages/@aws-cdk/aws-s3-notifications/lib/sqs.ts +++ b/packages/@aws-cdk/aws-s3-notifications/lib/sqs.ts @@ -1,7 +1,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as s3 from '@aws-cdk/aws-s3'; import * as sqs from '@aws-cdk/aws-sqs'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Use an SQS queue as a bucket notification destination diff --git a/packages/@aws-cdk/aws-s3-notifications/package.json b/packages/@aws-cdk/aws-s3-notifications/package.json index 00d38a536ca6a..782c06bfe8bcc 100644 --- a/packages/@aws-cdk/aws-s3-notifications/package.json +++ b/packages/@aws-cdk/aws-s3-notifications/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-s3-notifications", "version": "0.0.0", + "private": true, "description": "Bucket Notifications API for AWS S3", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -75,7 +76,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -85,7 +86,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-s3/lib/bucket.ts b/packages/@aws-cdk/aws-s3/lib/bucket.ts index ef1cda8a32f1b..79bf1f1d36a92 100644 --- a/packages/@aws-cdk/aws-s3/lib/bucket.ts +++ b/packages/@aws-cdk/aws-s3/lib/bucket.ts @@ -4,7 +4,7 @@ import * as events from '@aws-cdk/aws-events'; import * as iam from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; import { - Fn, IResource, Lazy, RemovalPolicy, Resource, Stack, Token, + Fn, IResource, Lazy, RemovalPolicy, Resource, ResourceProps, Stack, Token, CustomResource, CustomResourceProvider, CustomResourceProviderRuntime, FeatureFlags, } from '@aws-cdk/core'; import * as cxapi from '@aws-cdk/cx-api'; @@ -412,6 +412,12 @@ abstract class BucketBase extends Resource implements IBucket { */ protected abstract disallowPublicAccess?: boolean; + constructor(scope: Construct, id: string, props: ResourceProps = {}) { + super(scope, id, props); + + this.node.addValidation({ validate: () => this.policy?.document.validateForResourcePolicy() ?? [] }); + } + /** * Define a CloudWatch event that triggers when something happens to this repository * @@ -512,12 +518,6 @@ abstract class BucketBase extends Resource implements IBucket { return { statementAdded: false }; } - protected validate(): string[] { - const errors = super.validate(); - errors.push(...this.policy?.document.validateForResourcePolicy() || []); - return errors; - } - /** * The https URL of an S3 object. Specify `regional: false` at the options * for non-regional URLs. For example: diff --git a/packages/@aws-cdk/aws-s3/lib/destination.ts b/packages/@aws-cdk/aws-s3/lib/destination.ts index 021aa80a803c4..d8b8e1aa55e85 100644 --- a/packages/@aws-cdk/aws-s3/lib/destination.ts +++ b/packages/@aws-cdk/aws-s3/lib/destination.ts @@ -1,10 +1,7 @@ import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { IBucket } from './bucket'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - /** * Implemented by constructs that can be used as bucket notification destinations. */ diff --git a/packages/@aws-cdk/aws-s3/lib/notifications-resource/notifications-resource-handler.ts b/packages/@aws-cdk/aws-s3/lib/notifications-resource/notifications-resource-handler.ts index b013bc0ebd5b8..48ac9d2341abe 100644 --- a/packages/@aws-cdk/aws-s3/lib/notifications-resource/notifications-resource-handler.ts +++ b/packages/@aws-cdk/aws-s3/lib/notifications-resource/notifications-resource-handler.ts @@ -1,9 +1,6 @@ import * as iam from '@aws-cdk/aws-iam'; import * as cdk from '@aws-cdk/core'; - -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * A Lambda-based custom resource handler that provisions S3 bucket diff --git a/packages/@aws-cdk/aws-s3/lib/notifications-resource/notifications-resource.ts b/packages/@aws-cdk/aws-s3/lib/notifications-resource/notifications-resource.ts index 3c2194ddf7eb9..ce00ad0696ee4 100644 --- a/packages/@aws-cdk/aws-s3/lib/notifications-resource/notifications-resource.ts +++ b/packages/@aws-cdk/aws-s3/lib/notifications-resource/notifications-resource.ts @@ -1,12 +1,9 @@ import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Bucket, EventType, NotificationKeyFilter } from '../bucket'; import { BucketNotificationDestinationType, IBucketNotificationDestination } from '../destination'; import { NotificationsResourceHandler } from './notifications-resource-handler'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - interface NotificationsProps { /** * The bucket to manage notifications for. diff --git a/packages/@aws-cdk/aws-s3/package.json b/packages/@aws-cdk/aws-s3/package.json index 23d3345e1bfd5..82d01f9b15b91 100644 --- a/packages/@aws-cdk/aws-s3/package.json +++ b/packages/@aws-cdk/aws-s3/package.json @@ -4,6 +4,7 @@ "description": "The CDK Construct Library for AWS::S3", "main": "lib/index.js", "types": "lib/index.d.ts", + "private": true, "jsii": { "outdir": "dist", "targets": { @@ -83,8 +84,8 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", - "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5", + "@aws-cdk/cx-api": "0.0.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -92,8 +93,8 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", - "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5", + "@aws-cdk/cx-api": "0.0.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-s3outposts/package.json b/packages/@aws-cdk/aws-s3outposts/package.json index 7965518ea1d24..4c2236ec82a9c 100644 --- a/packages/@aws-cdk/aws-s3outposts/package.json +++ b/packages/@aws-cdk/aws-s3outposts/package.json @@ -81,10 +81,12 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" @@ -95,6 +97,7 @@ "announce": false }, "publishConfig": { - "tag": "latest" - } + "tag": "next" + }, + "private": true } diff --git a/packages/@aws-cdk/aws-sagemaker/package.json b/packages/@aws-cdk/aws-sagemaker/package.json index 532be18efa37d..7f0067785578f 100644 --- a/packages/@aws-cdk/aws-sagemaker/package.json +++ b/packages/@aws-cdk/aws-sagemaker/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-sagemaker", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::SageMaker", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,11 +80,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-sam/package.json b/packages/@aws-cdk/aws-sam/package.json index 52991896dcda8..8443a08f8c025 100644 --- a/packages/@aws-cdk/aws-sam/package.json +++ b/packages/@aws-cdk/aws-sam/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-sam", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for the AWS Serverless Application Model (SAM) resources", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -82,11 +83,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-sdb/package.json b/packages/@aws-cdk/aws-sdb/package.json index 9c1660f111f4b..5290b811a977b 100644 --- a/packages/@aws-cdk/aws-sdb/package.json +++ b/packages/@aws-cdk/aws-sdb/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-sdb", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::SDB", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -78,12 +79,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-secretsmanager/lib/secret-rotation.ts b/packages/@aws-cdk/aws-secretsmanager/lib/secret-rotation.ts index 0d0ed6e75c348..e41be73c14448 100644 --- a/packages/@aws-cdk/aws-secretsmanager/lib/secret-rotation.ts +++ b/packages/@aws-cdk/aws-secretsmanager/lib/secret-rotation.ts @@ -5,10 +5,6 @@ import { Duration, Names, Stack, Token } from '@aws-cdk/core'; import { Construct } from 'constructs'; import { ISecret } from './secret'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Options for a SecretRotationApplication */ @@ -211,7 +207,7 @@ export interface SecretRotationProps { /** * Secret rotation for a service or database */ -export class SecretRotation extends CoreConstruct { +export class SecretRotation extends Construct { constructor(scope: Construct, id: string, props: SecretRotationProps) { super(scope, id); diff --git a/packages/@aws-cdk/aws-secretsmanager/lib/secret.ts b/packages/@aws-cdk/aws-secretsmanager/lib/secret.ts index 92ca9cad73ee2..023f84ccd8435 100644 --- a/packages/@aws-cdk/aws-secretsmanager/lib/secret.ts +++ b/packages/@aws-cdk/aws-secretsmanager/lib/secret.ts @@ -1,6 +1,6 @@ import * as iam from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; -import { FeatureFlags, Fn, IResource, RemovalPolicy, Resource, SecretValue, Stack, Token } from '@aws-cdk/core'; +import { FeatureFlags, Fn, IResource, RemovalPolicy, Resource, ResourceProps, SecretValue, Stack, Token } from '@aws-cdk/core'; import * as cxapi from '@aws-cdk/cx-api'; import { IConstruct, Construct } from 'constructs'; import { ResourcePolicy } from './policy'; @@ -178,6 +178,12 @@ abstract class SecretBase extends Resource implements ISecret { private policy?: ResourcePolicy; + constructor(scope: Construct, id: string, props: ResourceProps = {}) { + super(scope, id, props); + + this.node.addValidation({ validate: () => this.policy?.document.validateForResourcePolicy() ?? [] }); + } + public get secretFullArn(): string | undefined { return this.secretArn; } public grantRead(grantee: iam.IGrantable, versionStages?: string[]): iam.Grant { @@ -251,12 +257,6 @@ abstract class SecretBase extends Resource implements ISecret { return { statementAdded: false }; } - protected validate(): string[] { - const errors = super.validate(); - errors.push(...this.policy?.document.validateForResourcePolicy() || []); - return errors; - } - public denyAccountRootDelete() { this.addToResourcePolicy(new iam.PolicyStatement({ actions: ['secretsmanager:DeleteSecret'], diff --git a/packages/@aws-cdk/aws-secretsmanager/package.json b/packages/@aws-cdk/aws-secretsmanager/package.json index fbd131bf94e89..330f611f8b8ca 100644 --- a/packages/@aws-cdk/aws-secretsmanager/package.json +++ b/packages/@aws-cdk/aws-secretsmanager/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-secretsmanager", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::SecretsManager", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -86,7 +87,7 @@ "@aws-cdk/aws-sam": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/aws-ec2": "0.0.0", @@ -96,7 +97,7 @@ "@aws-cdk/aws-sam": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-securityhub/package.json b/packages/@aws-cdk/aws-securityhub/package.json index 32dc742b38c9c..5310f40f08bbf 100644 --- a/packages/@aws-cdk/aws-securityhub/package.json +++ b/packages/@aws-cdk/aws-securityhub/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-securityhub", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::SecurityHub", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,11 +81,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-servicecatalog/package.json b/packages/@aws-cdk/aws-servicecatalog/package.json index 546f615a66693..beb454e6e104a 100644 --- a/packages/@aws-cdk/aws-servicecatalog/package.json +++ b/packages/@aws-cdk/aws-servicecatalog/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-servicecatalog", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::ServiceCatalog", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -78,12 +79,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-servicecatalogappregistry/package.json b/packages/@aws-cdk/aws-servicecatalogappregistry/package.json index 8887c8c0682d6..37901b3a879bb 100644 --- a/packages/@aws-cdk/aws-servicecatalogappregistry/package.json +++ b/packages/@aws-cdk/aws-servicecatalogappregistry/package.json @@ -81,10 +81,12 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" @@ -96,5 +98,6 @@ }, "publishConfig": { "tag": "latest" - } + }, + "private": true } diff --git a/packages/@aws-cdk/aws-servicediscovery/package.json b/packages/@aws-cdk/aws-servicediscovery/package.json index 4af44ea9879e1..3a330799a2ffd 100644 --- a/packages/@aws-cdk/aws-servicediscovery/package.json +++ b/packages/@aws-cdk/aws-servicediscovery/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-servicediscovery", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::ServiceDiscovery", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -86,7 +87,7 @@ "@aws-cdk/aws-elasticloadbalancingv2": "0.0.0", "@aws-cdk/aws-route53": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -94,7 +95,7 @@ "@aws-cdk/aws-elasticloadbalancingv2": "0.0.0", "@aws-cdk/aws-route53": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-ses-actions/package.json b/packages/@aws-cdk/aws-ses-actions/package.json index ea141e0c8d37f..1004fd2fc4b8b 100644 --- a/packages/@aws-cdk/aws-ses-actions/package.json +++ b/packages/@aws-cdk/aws-ses-actions/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-ses-actions", "version": "0.0.0", + "private": true, "description": "Receipt rule actions for AWS SES", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -78,7 +79,7 @@ "@aws-cdk/aws-ses": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -89,7 +90,7 @@ "@aws-cdk/aws-ses": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-ses/lib/receipt-filter.ts b/packages/@aws-cdk/aws-ses/lib/receipt-filter.ts index 81ee76d5adbff..5112ed881486b 100644 --- a/packages/@aws-cdk/aws-ses/lib/receipt-filter.ts +++ b/packages/@aws-cdk/aws-ses/lib/receipt-filter.ts @@ -2,10 +2,6 @@ import { Resource } from '@aws-cdk/core'; import { Construct } from 'constructs'; import { CfnReceiptFilter } from './ses.generated'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core' - /** * The policy for the receipt filter. */ @@ -82,7 +78,7 @@ export interface WhiteListReceiptFilterProps { /** * A white list receipt filter. */ -export class WhiteListReceiptFilter extends CoreConstruct { +export class WhiteListReceiptFilter extends Construct { constructor(scope: Construct, id: string, props: WhiteListReceiptFilterProps) { super(scope, id); diff --git a/packages/@aws-cdk/aws-ses/lib/receipt-rule.ts b/packages/@aws-cdk/aws-ses/lib/receipt-rule.ts index 7f6f1fe914a6b..cc8d3be77e758 100644 --- a/packages/@aws-cdk/aws-ses/lib/receipt-rule.ts +++ b/packages/@aws-cdk/aws-ses/lib/receipt-rule.ts @@ -7,10 +7,6 @@ import { IReceiptRuleAction } from './receipt-rule-action'; import { IReceiptRuleSet } from './receipt-rule-set'; import { CfnReceiptRule } from './ses.generated'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * A receipt rule. */ @@ -169,7 +165,7 @@ export interface DropSpamReceiptRuleProps extends ReceiptRuleProps { * * @see https://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-action-lambda-example-functions.html */ -export class DropSpamReceiptRule extends CoreConstruct { +export class DropSpamReceiptRule extends Construct { public readonly rule: ReceiptRule; constructor(scope: Construct, id: string, props: DropSpamReceiptRuleProps) { diff --git a/packages/@aws-cdk/aws-ses/package.json b/packages/@aws-cdk/aws-ses/package.json index c4fac8762a988..0c99733e8dddf 100644 --- a/packages/@aws-cdk/aws-ses/package.json +++ b/packages/@aws-cdk/aws-ses/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-ses", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::SES", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -82,14 +83,14 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-signer/package.json b/packages/@aws-cdk/aws-signer/package.json index 2baa7ffe143bc..40abc53583a5a 100644 --- a/packages/@aws-cdk/aws-signer/package.json +++ b/packages/@aws-cdk/aws-signer/package.json @@ -80,11 +80,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" @@ -96,5 +96,6 @@ }, "publishConfig": { "tag": "latest" - } + }, + "private": true } diff --git a/packages/@aws-cdk/aws-sns-subscriptions/lib/lambda.ts b/packages/@aws-cdk/aws-sns-subscriptions/lib/lambda.ts index aa7581653d5ba..77cec0e8951a4 100644 --- a/packages/@aws-cdk/aws-sns-subscriptions/lib/lambda.ts +++ b/packages/@aws-cdk/aws-sns-subscriptions/lib/lambda.ts @@ -6,7 +6,7 @@ import { SubscriptionProps } from './subscription'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Properties for a Lambda subscription @@ -27,7 +27,7 @@ export class LambdaSubscription implements sns.ITopicSubscription { public bind(topic: sns.ITopic): sns.TopicSubscriptionConfig { // Create subscription under *consuming* construct to make sure it ends up // in the correct stack in cases of cross-stack subscriptions. - if (!Construct.isConstruct(this.fn)) { + if (!(this.fn instanceof Construct)) { throw new Error('The supplied lambda Function object must be an instance of Construct'); } diff --git a/packages/@aws-cdk/aws-sns-subscriptions/lib/sqs.ts b/packages/@aws-cdk/aws-sns-subscriptions/lib/sqs.ts index 4a41c5e43feb2..9651d3aa242fc 100644 --- a/packages/@aws-cdk/aws-sns-subscriptions/lib/sqs.ts +++ b/packages/@aws-cdk/aws-sns-subscriptions/lib/sqs.ts @@ -6,7 +6,7 @@ import { SubscriptionProps } from './subscription'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Properties for an SQS subscription @@ -35,7 +35,7 @@ export class SqsSubscription implements sns.ITopicSubscription { public bind(topic: sns.ITopic): sns.TopicSubscriptionConfig { // Create subscription under *consuming* construct to make sure it ends up // in the correct stack in cases of cross-stack subscriptions. - if (!Construct.isConstruct(this.queue)) { + if (!(this.queue instanceof Construct)) { throw new Error('The supplied Queue object must be an instance of Construct'); } diff --git a/packages/@aws-cdk/aws-sns-subscriptions/package.json b/packages/@aws-cdk/aws-sns-subscriptions/package.json index 354b1c386b44e..87d690eed3e27 100644 --- a/packages/@aws-cdk/aws-sns-subscriptions/package.json +++ b/packages/@aws-cdk/aws-sns-subscriptions/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-sns-subscriptions", "version": "0.0.0", + "private": true, "description": "CDK Subscription Constructs for AWS SNS", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -75,7 +76,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -84,7 +85,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-sns/lib/subscriber.ts b/packages/@aws-cdk/aws-sns/lib/subscriber.ts index d63667dde46e5..8cac6b4f5d223 100644 --- a/packages/@aws-cdk/aws-sns/lib/subscriber.ts +++ b/packages/@aws-cdk/aws-sns/lib/subscriber.ts @@ -1,10 +1,9 @@ - import { SubscriptionOptions } from './subscription'; import { ITopic } from './topic-base'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Subscription configuration diff --git a/packages/@aws-cdk/aws-sns/lib/topic-base.ts b/packages/@aws-cdk/aws-sns/lib/topic-base.ts index db262ef87e068..b13a2eb6ac4b5 100644 --- a/packages/@aws-cdk/aws-sns/lib/topic-base.ts +++ b/packages/@aws-cdk/aws-sns/lib/topic-base.ts @@ -1,12 +1,12 @@ import * as iam from '@aws-cdk/aws-iam'; -import { IResource, Resource, Token } from '@aws-cdk/core'; +import { IResource, Resource, ResourceProps, Token } from '@aws-cdk/core'; import { TopicPolicy } from './policy'; import { ITopicSubscription } from './subscriber'; import { Subscription } from './subscription'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Represents an SNS topic @@ -63,6 +63,12 @@ export abstract class TopicBase extends Resource implements ITopic { private policy?: TopicPolicy; + constructor(scope: Construct, id: string, props: ResourceProps = {}) { + super(scope, id, props); + + this.node.addValidation({ validate: () => this.policy?.document.validateForResourcePolicy() ?? [] }); + } + /** * Subscribe some endpoint to this topic */ @@ -106,12 +112,6 @@ export abstract class TopicBase extends Resource implements ITopic { return { statementAdded: false }; } - protected validate(): string[] { - const errors = super.validate(); - errors.push(...this.policy?.document.validateForResourcePolicy() || []); - return errors; - } - /** * Grant topic publishing permissions to the given identity */ diff --git a/packages/@aws-cdk/aws-sns/package.json b/packages/@aws-cdk/aws-sns/package.json index 4b60a53f24c35..b7d1b867d1dd6 100644 --- a/packages/@aws-cdk/aws-sns/package.json +++ b/packages/@aws-cdk/aws-sns/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-sns", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::SNS", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -89,7 +90,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -99,7 +100,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-sqs/lib/queue-base.ts b/packages/@aws-cdk/aws-sqs/lib/queue-base.ts index 162c149aec2ad..a40e7c58498f1 100644 --- a/packages/@aws-cdk/aws-sqs/lib/queue-base.ts +++ b/packages/@aws-cdk/aws-sqs/lib/queue-base.ts @@ -1,6 +1,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; -import { IResource, Resource } from '@aws-cdk/core'; +import { IResource, Resource, ResourceProps } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { QueuePolicy } from './policy'; /** @@ -134,6 +135,12 @@ export abstract class QueueBase extends Resource implements IQueue { private policy?: QueuePolicy; + constructor(scope: Construct, id: string, props: ResourceProps = {}) { + super(scope, id, props); + + this.node.addValidation({ validate: () => this.policy?.document.validateForResourcePolicy() ?? [] }); + } + /** * Adds a statement to the IAM resource policy associated with this queue. * @@ -154,12 +161,6 @@ export abstract class QueueBase extends Resource implements IQueue { return { statementAdded: false }; } - protected validate(): string[] { - const errors = super.validate(); - errors.push(...this.policy?.document.validateForResourcePolicy() || []); - return errors; - } - /** * Grant permissions to consume messages from a queue * diff --git a/packages/@aws-cdk/aws-sqs/package.json b/packages/@aws-cdk/aws-sqs/package.json index 7b610c64bb71c..34b0c646798d5 100644 --- a/packages/@aws-cdk/aws-sqs/package.json +++ b/packages/@aws-cdk/aws-sqs/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-sqs", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::SQS", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -85,7 +86,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -93,7 +94,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-ssm/lib/parameter.ts b/packages/@aws-cdk/aws-ssm/lib/parameter.ts index 416454c1ef8cc..8c409a9bcee5f 100644 --- a/packages/@aws-cdk/aws-ssm/lib/parameter.ts +++ b/packages/@aws-cdk/aws-ssm/lib/parameter.ts @@ -3,7 +3,7 @@ import * as kms from '@aws-cdk/aws-kms'; import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import { CfnDynamicReference, CfnDynamicReferenceService, CfnParameter, - Construct as CompatConstruct, ContextProvider, Fn, IResource, Resource, Stack, Token, + ContextProvider, Fn, IResource, Resource, Stack, Token, } from '@aws-cdk/core'; import { Construct } from 'constructs'; import * as ssm from './ssm.generated'; @@ -325,7 +325,7 @@ export class StringParameter extends ParameterBase implements IStringParameter { const stringValue = attrs.version ? new CfnDynamicReference(CfnDynamicReferenceService.SSM, `${attrs.parameterName}:${attrs.version}`).toString() - : new CfnParameter(scope as CompatConstruct, `${id}.Parameter`, { type: `AWS::SSM::Parameter::Value<${type}>`, default: attrs.parameterName }).valueAsString; + : new CfnParameter(scope, `${id}.Parameter`, { type: `AWS::SSM::Parameter::Value<${type}>`, default: attrs.parameterName }).valueAsString; class Import extends ParameterBase { public readonly parameterName = attrs.parameterName; @@ -361,7 +361,7 @@ export class StringParameter extends ParameterBase implements IStringParameter { * Requires that the stack this scope is defined in will have explicit * account/region information. Otherwise, it will fail during synthesis. */ - public static valueFromLookup(scope: CompatConstruct, parameterName: string): string { + public static valueFromLookup(scope: Construct, parameterName: string): string { const value = ContextProvider.getValue(scope, { provider: cxschema.ContextProvider.SSM_PARAMETER_PROVIDER, props: { parameterName }, diff --git a/packages/@aws-cdk/aws-ssm/package.json b/packages/@aws-cdk/aws-ssm/package.json index 234d166c9152f..ac37a10230e47 100644 --- a/packages/@aws-cdk/aws-ssm/package.json +++ b/packages/@aws-cdk/aws-ssm/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-ssm", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::SSM", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -83,7 +84,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -91,7 +92,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-sso/package.json b/packages/@aws-cdk/aws-sso/package.json index af088e448aff9..579063dbd916f 100644 --- a/packages/@aws-cdk/aws-sso/package.json +++ b/packages/@aws-cdk/aws-sso/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-sso", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::SSO", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,10 +80,12 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/package.json b/packages/@aws-cdk/aws-stepfunctions-tasks/package.json index b18cd8fc7704c..8aa8b66db9561 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/package.json +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-stepfunctions-tasks", "version": "0.0.0", + "private": true, "description": "Task integrations for AWS StepFunctions", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -94,7 +95,7 @@ "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/aws-stepfunctions": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -120,7 +121,7 @@ "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/aws-stepfunctions": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/state-machine-fragment.ts b/packages/@aws-cdk/aws-stepfunctions/lib/state-machine-fragment.ts index 0103ceb735499..91515ec034ec8 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/state-machine-fragment.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/state-machine-fragment.ts @@ -1,12 +1,9 @@ +import { Construct } from 'constructs'; import { Chain } from './chain'; import { Parallel, ParallelProps } from './states/parallel'; import { State } from './states/state'; import { IChainable, INextable } from './types'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; - /** * Base class for reusable state machine fragments */ diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/states/map.ts b/packages/@aws-cdk/aws-stepfunctions/lib/states/map.ts index e3f6e4800991f..ad188deb7e11d 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/states/map.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/states/map.ts @@ -168,7 +168,7 @@ export class Map extends State implements INextable { /** * Validate this state */ - protected validate(): string[] { + protected validateState(): string[] { const errors: string[] = []; if (this.iteration === undefined) { diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/states/parallel.ts b/packages/@aws-cdk/aws-stepfunctions/lib/states/parallel.ts index 70ac5819a6888..a45ad6c03cd41 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/states/parallel.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/states/parallel.ts @@ -123,7 +123,7 @@ export class Parallel extends State implements INextable { /** * Validate this state */ - protected validate(): string[] { + protected validateState(): string[] { if (this.branches.length === 0) { return ['Parallel must have at least one branch']; } diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/states/state.ts b/packages/@aws-cdk/aws-stepfunctions/lib/states/state.ts index 42a4c8e9bf1b5..23b4ebc60b0c5 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/states/state.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/states/state.ts @@ -4,10 +4,6 @@ import { JsonPath } from '../fields'; import { StateGraph } from '../state-graph'; import { CatchProps, Errors, IChainable, INextable, RetryProps } from '../types'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Properties shared by all states */ @@ -63,7 +59,7 @@ export interface StateProps { /** * Base class for all other state classes */ -export abstract class State extends CoreConstruct implements IChainable { +export abstract class State extends Construct implements IChainable { /** * Add a prefix to the stateId of all States found in a construct tree */ @@ -187,6 +183,15 @@ export abstract class State extends CoreConstruct implements IChainable { this.parameters = props.parameters; this.outputPath = props.outputPath; this.resultPath = props.resultPath; + + this.node.addValidation({ validate: () => this.validateState() }); + } + + /** + * Allows the state to validate itself. + */ + protected validateState(): string[] { + return []; } public get id() { diff --git a/packages/@aws-cdk/aws-stepfunctions/package.json b/packages/@aws-cdk/aws-stepfunctions/package.json index 80035201f8b36..caa3a3950ab1c 100644 --- a/packages/@aws-cdk/aws-stepfunctions/package.json +++ b/packages/@aws-cdk/aws-stepfunctions/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-stepfunctions", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::StepFunctions", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -84,7 +85,7 @@ "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -94,7 +95,7 @@ "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-stepfunctions/test/states-language.test.ts b/packages/@aws-cdk/aws-stepfunctions/test/states-language.test.ts index 326bfeaf17ba1..b2f792bed9d5e 100644 --- a/packages/@aws-cdk/aws-stepfunctions/test/states-language.test.ts +++ b/packages/@aws-cdk/aws-stepfunctions/test/states-language.test.ts @@ -1,6 +1,6 @@ import '@aws-cdk/assert/jest'; import * as cdk from '@aws-cdk/core'; -import * as constructs from 'constructs'; +import { Construct } from 'constructs'; import * as stepfunctions from '../lib'; describe('States Language', () => { @@ -579,7 +579,7 @@ describe('States Language', () => { test('No duplicate state IDs', () => { // GIVEN const stack = new cdk.Stack(); - const intermediateParent = new cdk.Construct(stack, 'Parent'); + const intermediateParent = new Construct(stack, 'Parent'); const state1 = new stepfunctions.Pass(stack, 'State'); const state2 = new stepfunctions.Pass(intermediateParent, 'State'); @@ -593,7 +593,7 @@ describe('States Language', () => { test('No duplicate state IDs even across Parallel branches', () => { // GIVEN const stack = new cdk.Stack(); - const intermediateParent = new cdk.Construct(stack, 'Parent'); + const intermediateParent = new Construct(stack, 'Parent'); const state1 = new stepfunctions.Pass(stack, 'State'); const state2 = new stepfunctions.Pass(intermediateParent, 'State'); @@ -693,7 +693,7 @@ describe('States Language', () => { class ReusableStateMachine extends stepfunctions.StateMachineFragment { public readonly startState: stepfunctions.State; public readonly endStates: stepfunctions.INextable[]; - constructor(scope: constructs.Construct, id: string) { + constructor(scope: Construct, id: string) { super(scope, id); const choice = new stepfunctions.Choice(this, 'Choice') @@ -710,7 +710,7 @@ class SimpleChain extends stepfunctions.StateMachineFragment { public readonly endStates: stepfunctions.INextable[]; private readonly task2: stepfunctions.Task; - constructor(scope: constructs.Construct, id: string) { + constructor(scope: Construct, id: string) { super(scope, id); const task1 = new stepfunctions.Task(this, 'Task1', { task: new FakeTask() }); diff --git a/packages/@aws-cdk/aws-synthetics/lib/code.ts b/packages/@aws-cdk/aws-synthetics/lib/code.ts index dd75815098ec1..0fa8501a842ab 100644 --- a/packages/@aws-cdk/aws-synthetics/lib/code.ts +++ b/packages/@aws-cdk/aws-synthetics/lib/code.ts @@ -2,7 +2,7 @@ import * as fs from 'fs'; import * as path from 'path'; import * as s3 from '@aws-cdk/aws-s3'; import * as s3_assets from '@aws-cdk/aws-s3-assets'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * The code the canary should execute diff --git a/packages/@aws-cdk/aws-synthetics/package.json b/packages/@aws-cdk/aws-synthetics/package.json index 3b15e2a0b8ffb..9cdc4a093993f 100644 --- a/packages/@aws-cdk/aws-synthetics/package.json +++ b/packages/@aws-cdk/aws-synthetics/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-synthetics", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::Synthetics", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -85,7 +86,7 @@ "@aws-cdk/aws-s3-assets": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/aws-cloudwatch": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", @@ -93,7 +94,7 @@ "@aws-cdk/aws-s3-assets": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-cloudwatch": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-timestream/package.json b/packages/@aws-cdk/aws-timestream/package.json index c432583d5cbdb..644196759b1cc 100644 --- a/packages/@aws-cdk/aws-timestream/package.json +++ b/packages/@aws-cdk/aws-timestream/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-timestream", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::Timestream", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -79,10 +80,12 @@ "pkglint": "0.0.0" }, "dependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "peerDependencies": { - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-transfer/package.json b/packages/@aws-cdk/aws-transfer/package.json index b70fc5929c4c0..3c529d6b06db3 100644 --- a/packages/@aws-cdk/aws-transfer/package.json +++ b/packages/@aws-cdk/aws-transfer/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-transfer", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::Transfer", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,11 +81,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-waf/package.json b/packages/@aws-cdk/aws-waf/package.json index ced3ca7dc741b..2f21d2511c7bd 100644 --- a/packages/@aws-cdk/aws-waf/package.json +++ b/packages/@aws-cdk/aws-waf/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-waf", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::WAF", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -78,12 +79,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-wafregional/package.json b/packages/@aws-cdk/aws-wafregional/package.json index 8e165fd4169f8..3028dd92898f1 100644 --- a/packages/@aws-cdk/aws-wafregional/package.json +++ b/packages/@aws-cdk/aws-wafregional/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-wafregional", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::WAFRegional", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -78,12 +79,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-wafv2/package.json b/packages/@aws-cdk/aws-wafv2/package.json index 7bae0807f8209..72655d905353b 100644 --- a/packages/@aws-cdk/aws-wafv2/package.json +++ b/packages/@aws-cdk/aws-wafv2/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-wafv2", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::WAFv2", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -80,11 +81,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-workspaces/package.json b/packages/@aws-cdk/aws-workspaces/package.json index d2a3313f491dd..ad37b1a7b89c7 100644 --- a/packages/@aws-cdk/aws-workspaces/package.json +++ b/packages/@aws-cdk/aws-workspaces/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/aws-workspaces", "version": "0.0.0", + "private": true, "description": "The CDK Construct Library for AWS::WorkSpaces", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -78,12 +79,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/cdk-assets-schema/package.json b/packages/@aws-cdk/cdk-assets-schema/package.json index 80be64f4b67d3..137d2ecae2298 100644 --- a/packages/@aws-cdk/cdk-assets-schema/package.json +++ b/packages/@aws-cdk/cdk-assets-schema/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/cdk-assets-schema", "version": "0.0.0", + "private": true, "description": "Schema definition for the Asset Manifest", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/packages/@aws-cdk/cloud-assembly-schema/package.json b/packages/@aws-cdk/cloud-assembly-schema/package.json index fdac837c6ca7a..cc8e03d745dcc 100644 --- a/packages/@aws-cdk/cloud-assembly-schema/package.json +++ b/packages/@aws-cdk/cloud-assembly-schema/package.json @@ -99,6 +99,6 @@ "jest": true }, "publishConfig": { - "tag": "latest" + "tag": "next" } } diff --git a/packages/@aws-cdk/cloudformation-diff/package.json b/packages/@aws-cdk/cloudformation-diff/package.json index f9b2c7342a84e..d0fd1e2c01aeb 100644 --- a/packages/@aws-cdk/cloudformation-diff/package.json +++ b/packages/@aws-cdk/cloudformation-diff/package.json @@ -57,6 +57,6 @@ "jest": true }, "publishConfig": { - "tag": "latest" + "tag": "next" } } diff --git a/packages/@aws-cdk/cloudformation-include/lib/cfn-include.ts b/packages/@aws-cdk/cloudformation-include/lib/cfn-include.ts index 5a54d36aefcc8..22a8bdb2d5fdb 100644 --- a/packages/@aws-cdk/cloudformation-include/lib/cfn-include.ts +++ b/packages/@aws-cdk/cloudformation-include/lib/cfn-include.ts @@ -4,10 +4,6 @@ import { Construct } from 'constructs'; import * as cfn_type_to_l1_mapping from './cfn-type-to-l1-mapping'; import * as futils from './file-utils'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Construction properties of {@link CfnInclude}. */ @@ -118,7 +114,7 @@ export class CfnInclude extends core.CfnElement { } // instantiate the Mappings - this.mappingsScope = new CoreConstruct(this, '$Mappings'); + this.mappingsScope = new Construct(this, '$Mappings'); for (const mappingName of Object.keys(this.template.Mappings || {})) { this.createMapping(mappingName); } @@ -129,13 +125,13 @@ export class CfnInclude extends core.CfnElement { } // instantiate the conditions - this.conditionsScope = new CoreConstruct(this, '$Conditions'); + this.conditionsScope = new Construct(this, '$Conditions'); for (const conditionName of Object.keys(this.template.Conditions || {})) { this.getOrCreateCondition(conditionName); } // instantiate the rules - this.rulesScope = new CoreConstruct(this, '$Rules'); + this.rulesScope = new Construct(this, '$Rules'); for (const ruleName of Object.keys(this.template.Rules || {})) { this.createRule(ruleName); } @@ -153,12 +149,12 @@ export class CfnInclude extends core.CfnElement { } // instantiate the Hooks - this.hooksScope = new CoreConstruct(this, '$Hooks'); + this.hooksScope = new Construct(this, '$Hooks'); for (const hookName of Object.keys(this.template.Hooks || {})) { this.createHook(hookName); } - const outputScope = new CoreConstruct(this, '$Ouputs'); + const outputScope = new Construct(this, '$Ouputs'); for (const logicalId of Object.keys(this.template.Outputs || {})) { this.createOutput(logicalId, outputScope); } diff --git a/packages/@aws-cdk/cloudformation-include/package.json b/packages/@aws-cdk/cloudformation-include/package.json index c913b93bcdf41..ba3e00e193126 100644 --- a/packages/@aws-cdk/cloudformation-include/package.json +++ b/packages/@aws-cdk/cloudformation-include/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/cloudformation-include", "version": "0.0.0", + "private": true, "description": "A package that facilitates working with existing CloudFormation templates in the CDK", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -211,7 +212,7 @@ "@aws-cdk/aws-workspaces": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/yaml-cfn": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "peerDependencies": { "@aws-cdk/alexa-ask": "0.0.0", @@ -360,7 +361,7 @@ "@aws-cdk/aws-workspaces": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/yaml-cfn": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "devDependencies": { "@aws-cdk/assert": "0.0.0", diff --git a/packages/@aws-cdk/core/lib/annotations.ts b/packages/@aws-cdk/core/lib/annotations.ts index f46c830c25757..d82048cd9ac1b 100644 --- a/packages/@aws-cdk/core/lib/annotations.ts +++ b/packages/@aws-cdk/core/lib/annotations.ts @@ -1,4 +1,5 @@ import * as cxschema from '@aws-cdk/cloud-assembly-schema'; +import * as cxapi from '@aws-cdk/cx-api'; import { IConstruct, Node } from 'constructs'; const DEPRECATIONS_SYMBOL = Symbol.for('@aws-cdk/core.deprecations'); @@ -15,8 +16,14 @@ export class Annotations { return new Annotations(scope); } + private readonly stackTraces: boolean; + private constructor(private readonly scope: IConstruct) { + const disableTrace = + scope.node.tryGetContext(cxapi.DISABLE_METADATA_STACK_TRACE) || + process.env.CDK_DISABLE_STACK_TRACE; + this.stackTraces = !disableTrace; } /** @@ -89,7 +96,7 @@ export class Annotations { * @param message The message itself */ private addMessage(level: string, message: string) { - Node.of(this.scope).addMetadata(level, message); + Node.of(this.scope).addMetadata(level, message, { stackTrace: this.stackTraces }); } /** diff --git a/packages/@aws-cdk/core/lib/aspect.ts b/packages/@aws-cdk/core/lib/aspect.ts index bde33e6724e9e..23722878e1493 100644 --- a/packages/@aws-cdk/core/lib/aspect.ts +++ b/packages/@aws-cdk/core/lib/aspect.ts @@ -1,4 +1,4 @@ -import { IConstruct } from './construct-compat'; +import { IConstruct } from 'constructs'; const ASPECTS_SYMBOL = Symbol('cdk-aspects'); @@ -17,7 +17,6 @@ export interface IAspect { * synthesis. */ export class Aspects { - /** * Returns the `Aspects` object associated with a construct scope. * @param scope The scope for which these aspects will apply. @@ -25,7 +24,7 @@ export class Aspects { public static of(scope: IConstruct): Aspects { let aspects = (scope as any)[ASPECTS_SYMBOL]; if (!aspects) { - aspects = new Aspects(scope); + aspects = new Aspects(); Object.defineProperty(scope, ASPECTS_SYMBOL, { value: aspects, @@ -36,23 +35,24 @@ export class Aspects { return aspects; } - // TODO(2.0): private readonly _aspects = new Array(); - private constructor(private readonly scope: IConstruct) { } + private readonly _aspects: IAspect[]; + + private constructor() { + this._aspects = []; + } /** * Adds an aspect to apply this scope before synthesis. * @param aspect The aspect to add. */ public add(aspect: IAspect) { - // TODO(2.0): this._aspects.push(aspect); - this.scope.node._actualNode.applyAspect(aspect); + this._aspects.push(aspect); } /** * The list of aspects which were directly applied on this scope. */ - public get aspects(): IAspect[] { - // TODO(2.0): return [ ...this._aspects ]; - return [...(this.scope.node._actualNode as any)._aspects]; // clone + public get all(): IAspect[] { + return [...this._aspects]; } } \ No newline at end of file diff --git a/packages/@aws-cdk/core/lib/asset-staging.ts b/packages/@aws-cdk/core/lib/asset-staging.ts index 6a34bd9b4b1ac..5432044b1e1d9 100644 --- a/packages/@aws-cdk/core/lib/asset-staging.ts +++ b/packages/@aws-cdk/core/lib/asset-staging.ts @@ -13,10 +13,6 @@ import { Cache } from './private/cache'; import { Stack } from './stack'; import { Stage } from './stage'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from './construct-compat'; - const ARCHIVE_EXTENSIONS = ['.zip', '.jar']; /** @@ -72,7 +68,7 @@ export interface AssetStagingProps extends FingerprintOptions, AssetOptions { * The file/directory are staged based on their content hash (fingerprint). This * means that only if content was changed, copy will happen. */ -export class AssetStaging extends CoreConstruct { +export class AssetStaging extends Construct { /** * The directory inside the bundling container into which the asset sources will be mounted. * @experimental diff --git a/packages/@aws-cdk/core/lib/cfn-element.ts b/packages/@aws-cdk/core/lib/cfn-element.ts index 5e2cf1602c614..8d048452baf6f 100644 --- a/packages/@aws-cdk/core/lib/cfn-element.ts +++ b/packages/@aws-cdk/core/lib/cfn-element.ts @@ -1,9 +1,5 @@ import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import { Construct, Node } from 'constructs'; - -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from './construct-compat'; import { Lazy } from './lazy'; const CFN_ELEMENT_SYMBOL = Symbol.for('@aws-cdk/core.CfnElement'); @@ -11,7 +7,7 @@ const CFN_ELEMENT_SYMBOL = Symbol.for('@aws-cdk/core.CfnElement'); /** * An element of a CloudFormation stack. */ -export abstract class CfnElement extends CoreConstruct { +export abstract class CfnElement extends Construct { /** * Returns `true` if a construct is a stack element (i.e. part of the * synthesized cloudformation template). @@ -64,7 +60,9 @@ export abstract class CfnElement extends CoreConstruct { displayHint: `${notTooLong(Node.of(this).path)}.LogicalID`, }); - Node.of(this).addMetadata(cxschema.ArtifactMetadataEntryType.LOGICAL_ID, this.logicalId, this.constructor); + this.node.addMetadata(cxschema.ArtifactMetadataEntryType.LOGICAL_ID, this.logicalId, { + traceFromFunction: this.constructor, + }); } /** diff --git a/packages/@aws-cdk/core/lib/cfn-json.ts b/packages/@aws-cdk/core/lib/cfn-json.ts index df6bc40ef9f9e..c4ef8f67a1b1b 100644 --- a/packages/@aws-cdk/core/lib/cfn-json.ts +++ b/packages/@aws-cdk/core/lib/cfn-json.ts @@ -7,10 +7,6 @@ import { IResolvable, IResolveContext } from './resolvable'; import { Stack } from './stack'; import { captureStackTrace } from './stack-trace'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from './construct-compat'; - export interface CfnJsonProps { /** * The value to resolve. Can be any JavaScript object, including tokens and @@ -33,7 +29,7 @@ export interface CfnJsonProps { * * This construct is backed by a custom resource. */ -export class CfnJson extends CoreConstruct implements IResolvable { +export class CfnJson extends Construct implements IResolvable { public readonly creationStack: string[] = []; /** diff --git a/packages/@aws-cdk/core/lib/cfn-output.ts b/packages/@aws-cdk/core/lib/cfn-output.ts index e296ecce34375..da1a81e507e75 100644 --- a/packages/@aws-cdk/core/lib/cfn-output.ts +++ b/packages/@aws-cdk/core/lib/cfn-output.ts @@ -57,6 +57,8 @@ export class CfnOutput extends CfnElement { this._value = props.value; this._condition = props.condition; this._exportName = props.exportName; + + this.node.addValidation({ validate: () => this.validateOutput() }); } /** @@ -164,7 +166,7 @@ export class CfnOutput extends CfnElement { }; } - protected validate(): string[] { + private validateOutput(): string[] { if (this._exportName && !Token.isUnresolved(this._exportName) && this._exportName.length > 255) { return [`Export name cannot exceed 255 characters (got ${this._exportName.length} characters)`]; } @@ -172,6 +174,7 @@ export class CfnOutput extends CfnElement { } } +/* eslint-disable import/order */ import { CfnCondition } from './cfn-condition'; import { Fn } from './cfn-fn'; import { Lazy } from './lazy'; diff --git a/packages/@aws-cdk/core/lib/cfn-pseudo.ts b/packages/@aws-cdk/core/lib/cfn-pseudo.ts index 7144b7edc2af1..98b59e193e98a 100644 --- a/packages/@aws-cdk/core/lib/cfn-pseudo.ts +++ b/packages/@aws-cdk/core/lib/cfn-pseudo.ts @@ -1,4 +1,4 @@ -import { Construct } from './construct-compat'; +import { Construct } from 'constructs'; import { CfnReference } from './private/cfn-reference'; import { Token } from './token'; diff --git a/packages/@aws-cdk/core/lib/construct-compat.ts b/packages/@aws-cdk/core/lib/construct-compat.ts deleted file mode 100644 index ac7873a837dde..0000000000000 --- a/packages/@aws-cdk/core/lib/construct-compat.ts +++ /dev/null @@ -1,556 +0,0 @@ -/** - * Constructs compatibility layer. - * - * This file includes types that shadow types in the "constructs" module in - * order to allow backwards-compatiblity in the AWS CDK v1.0 release line. - * - * There are pretty ugly hacks here, which mostly involve downcasting types to - * adhere to legacy AWS CDK APIs. - * - * This file, in its entirety, is expected to be removed in v2.0. - */ - -import * as cxapi from '@aws-cdk/cx-api'; -import * as constructs from 'constructs'; -import { Annotations } from './annotations'; -import { IAspect, Aspects } from './aspect'; -import { IDependable } from './dependency'; -import { Token } from './token'; - -const ORIGINAL_CONSTRUCT_NODE_SYMBOL = Symbol.for('@aws-cdk/core.ConstructNode'); -const CONSTRUCT_SYMBOL = Symbol.for('@aws-cdk/core.Construct'); - -/** - * Represents a construct. - */ -export interface IConstruct extends constructs.IConstruct, IDependable { - /** - * The construct tree node for this construct. - */ - readonly node: ConstructNode; -} - -/** - * Represents a single session of synthesis. Passed into `Construct.synthesize()` methods. - */ -export interface ISynthesisSession { - /** - * The output directory for this synthesis session. - */ - outdir: string; - - /** - * Cloud assembly builder. - */ - assembly: cxapi.CloudAssemblyBuilder; -} - -/** - * Represents the building block of the construct graph. - * - * All constructs besides the root construct must be created within the scope of - * another construct. - */ -export class Construct extends constructs.Construct implements IConstruct { - /** - * Return whether the given object is a Construct - */ - public static isConstruct(x: any): x is Construct { - return typeof x === 'object' && x !== null && CONSTRUCT_SYMBOL in x; - } - - /** - * The construct tree node associated with this construct. - */ - public readonly node: ConstructNode; - - constructor(scope: constructs.Construct, id: string) { - super(scope, id, { - nodeFactory: { - createNode: (h: constructs.Construct, s: constructs.IConstruct, i: string) => - new ConstructNode(h as Construct, s as IConstruct, i)._actualNode, - }, - }); - - if (Token.isUnresolved(id)) { - throw new Error(`Cannot use tokens in construct ID: ${id}`); - } - - Object.defineProperty(this, CONSTRUCT_SYMBOL, { value: true }); - this.node = ConstructNode._unwrap(constructs.Node.of(this)); - - const disableTrace = - this.node.tryGetContext(cxapi.DISABLE_METADATA_STACK_TRACE) || - this.node.tryGetContext(constructs.ConstructMetadata.DISABLE_STACK_TRACE_IN_METADATA) || - process.env.CDK_DISABLE_STACK_TRACE; - - if (disableTrace) { - this.node.setContext(cxapi.DISABLE_METADATA_STACK_TRACE, true); - this.node.setContext(constructs.ConstructMetadata.DISABLE_STACK_TRACE_IN_METADATA, true); - process.env.CDK_DISABLE_STACK_TRACE = '1'; - } - } - - /** - * Validate the current construct. - * - * This method can be implemented by derived constructs in order to perform - * validation logic. It is called on all constructs before synthesis. - * - * @returns An array of validation error messages, or an empty array if the construct is valid. - */ - protected onValidate(): string[] { - return this.validate(); - } - - /** - * Perform final modifications before synthesis - * - * This method can be implemented by derived constructs in order to perform - * final changes before synthesis. prepare() will be called after child - * constructs have been prepared. - * - * This is an advanced framework feature. Only use this if you - * understand the implications. - */ - protected onPrepare(): void { - this.prepare(); - } - - /** - * Allows this construct to emit artifacts into the cloud assembly during synthesis. - * - * This method is usually implemented by framework-level constructs such as `Stack` and `Asset` - * as they participate in synthesizing the cloud assembly. - * - * @param session The synthesis session. - */ - protected onSynthesize(session: constructs.ISynthesisSession): void { - this.synthesize({ - outdir: session.outdir, - assembly: session.assembly!, - }); - } - - /** - * Validate the current construct. - * - * This method can be implemented by derived constructs in order to perform - * validation logic. It is called on all constructs before synthesis. - * - * @returns An array of validation error messages, or an empty array if the construct is valid. - */ - protected validate(): string[] { - return []; - } - - /** - * Perform final modifications before synthesis - * - * This method can be implemented by derived constructs in order to perform - * final changes before synthesis. prepare() will be called after child - * constructs have been prepared. - * - * This is an advanced framework feature. Only use this if you - * understand the implications. - */ - protected prepare(): void { - return; - } - - /** - * Allows this construct to emit artifacts into the cloud assembly during synthesis. - * - * This method is usually implemented by framework-level constructs such as `Stack` and `Asset` - * as they participate in synthesizing the cloud assembly. - * - * @param session The synthesis session. - */ - protected synthesize(session: ISynthesisSession): void { - ignore(session); - } -} - -/** - * In what order to return constructs - */ -export enum ConstructOrder { - /** - * Depth-first, pre-order - */ - PREORDER, - - /** - * Depth-first, post-order (leaf nodes first) - */ - POSTORDER -} - -/** - * Options for synthesis. - * - * @deprecated use `app.synth()` or `stage.synth()` instead - */ -export interface SynthesisOptions extends cxapi.AssemblyBuildOptions { - /** - * The output directory into which to synthesize the cloud assembly. - * @default - creates a temporary directory - */ - readonly outdir?: string; - - /** - * Whether synthesis should skip the validation phase. - * @default false - */ - readonly skipValidation?: boolean; -} - -/** - * Represents the construct node in the scope tree. - */ -export class ConstructNode { - /** - * Separator used to delimit construct path components. - */ - public static readonly PATH_SEP = '/'; - - /** - * Returns the wrapping `@aws-cdk/core.ConstructNode` instance from a `constructs.ConstructNode`. - * - * @internal - */ - public static _unwrap(c: constructs.Node): ConstructNode { - const x = (c as any)[ORIGINAL_CONSTRUCT_NODE_SYMBOL]; - if (!x) { - throw new Error('invalid ConstructNode type'); - } - - return x; - } - - /** - * Synthesizes a CloudAssembly from a construct tree. - * @param node The root of the construct tree. - * @param options Synthesis options. - * @deprecated Use `app.synth()` or `stage.synth()` instead - */ - public static synth(node: ConstructNode, options: SynthesisOptions = { }): cxapi.CloudAssembly { - // eslint-disable-next-line @typescript-eslint/no-require-imports - const a: typeof import('././private/synthesis') = require('./private/synthesis'); - return a.synthesize(node.root, options); - } - - /** - * Invokes "prepare" on all constructs (depth-first, post-order) in the tree under `node`. - * @param node The root node - * @deprecated Use `app.synth()` instead - */ - public static prepare(node: ConstructNode) { - // eslint-disable-next-line @typescript-eslint/no-require-imports - const p: typeof import('./private/prepare-app') = require('./private/prepare-app'); - p.prepareApp(node.root); // resolve cross refs and nested stack assets. - return node._actualNode.prepare(); - } - - /** - * Invokes "validate" on all constructs in the tree (depth-first, pre-order) and returns - * the list of all errors. An empty list indicates that there are no errors. - * - * @param node The root node - */ - public static validate(node: ConstructNode): ValidationError[] { - return node._actualNode.validate().map(e => ({ source: e.source as Construct, message: e.message })); - } - - /** - * @internal - */ - public readonly _actualNode: constructs.Node; - - /** - * The Construct class that hosts this API. - */ - private readonly host: Construct; - - constructor(host: Construct, scope: IConstruct, id: string) { - this.host = host; - this._actualNode = new constructs.Node(host, scope, id); - - // store a back reference on _actualNode so we can our ConstructNode from it - Object.defineProperty(this._actualNode, ORIGINAL_CONSTRUCT_NODE_SYMBOL, { - value: this, - configurable: false, - enumerable: false, - }); - } - - /** - * Returns the scope in which this construct is defined. - * - * The value is `undefined` at the root of the construct scope tree. - */ - public get scope(): IConstruct | undefined { - return this._actualNode.scope as IConstruct; - } - - /** - * The id of this construct within the current scope. - * - * This is a a scope-unique id. To obtain an app-unique id for this construct, use `uniqueId`. - */ - public get id() { return this._actualNode.id; } - - /** - * The full, absolute path of this construct in the tree. - * - * Components are separated by '/'. - */ - public get path(): string { return this._actualNode.path; } - - /** - * A tree-global unique alphanumeric identifier for this construct. Includes - * all components of the tree. - * - * @deprecated use `node.addr` to obtain a consistent 42 character address for - * this node (see https://github.com/aws/constructs/pull/314) - */ - public get uniqueId(): string { return this._actualNode.uniqueId; } - - /** - * Returns an opaque tree-unique address for this construct. - * - * Addresses are 42 characters hexadecimal strings. They begin with "c8" - * followed by 40 lowercase hexadecimal characters (0-9a-f). - * - * Addresses are calculated using a SHA-1 of the components of the construct - * path. - * - * To enable refactorings of construct trees, constructs with the ID `Default` - * will be excluded from the calculation. In those cases constructs in the - * same tree may have the same addreess. - * - * @example c83a2846e506bcc5f10682b564084bca2d275709ee - */ - public get addr(): string { return this._actualNode.addr; } - - /** - * Return a direct child by id, or undefined - * - * @param id Identifier of direct child - * @returns the child if found, or undefined - */ - public tryFindChild(id: string): IConstruct | undefined { return this._actualNode.tryFindChild(id) as IConstruct; } - - /** - * Return a direct child by id - * - * Throws an error if the child is not found. - * - * @param id Identifier of direct child - * @returns Child with the given id. - */ - public findChild(id: string): IConstruct { return this._actualNode.findChild(id) as IConstruct; } - - /** - * Returns the child construct that has the id `Default` or `Resource"`. - * This is usually the construct that provides the bulk of the underlying functionality. - * Useful for modifications of the underlying construct that are not available at the higher levels. - * - * @throws if there is more than one child - * @returns a construct or undefined if there is no default child - */ - public get defaultChild(): IConstruct | undefined { return this._actualNode.defaultChild as IConstruct; } - - /** - * Override the defaultChild property. - * - * This should only be used in the cases where the correct - * default child is not named 'Resource' or 'Default' as it - * should be. - * - * If you set this to undefined, the default behavior of finding - * the child named 'Resource' or 'Default' will be used. - */ - public set defaultChild(value: IConstruct | undefined) { this._actualNode.defaultChild = value; } - - /** - * All direct children of this construct. - */ - public get children(): IConstruct[] { return this._actualNode.children as IConstruct[]; } - - /** - * Return this construct and all of its children in the given order - */ - public findAll(order: ConstructOrder = ConstructOrder.PREORDER): IConstruct[] { return this._actualNode.findAll(order) as IConstruct[]; } - - /** - * This can be used to set contextual values. - * Context must be set before any children are added, since children may consult context info during construction. - * If the key already exists, it will be overridden. - * @param key The context key - * @param value The context value - */ - public setContext(key: string, value: any) { - if (Token.isUnresolved(key)) { - throw new Error('Invalid context key: context keys can\'t include tokens'); - } - this._actualNode.setContext(key, value); - } - - /** - * Retrieves a value from tree context. - * - * Context is usually initialized at the root, but can be overridden at any point in the tree. - * - * @param key The context key - * @returns The context value or `undefined` if there is no context value for the key. - */ - public tryGetContext(key: string): any { - if (Token.isUnresolved(key)) { - throw new Error('Invalid context key: context keys can\'t include tokens'); - } - return this._actualNode.tryGetContext(key); - } - - /** - * An immutable array of metadata objects associated with this construct. - * This can be used, for example, to implement support for deprecation notices, source mapping, etc. - */ - public get metadata() { return this._actualNode.metadata as cxapi.MetadataEntry[]; } - - /** - * Adds a metadata entry to this construct. - * Entries are arbitrary values and will also include a stack trace to allow tracing back to - * the code location for when the entry was added. It can be used, for example, to include source - * mapping in CloudFormation templates to improve diagnostics. - * - * @param type a string denoting the type of metadata - * @param data the value of the metadata (can be a Token). If null/undefined, metadata will not be added. - * @param fromFunction a function under which to restrict the metadata entry's stack trace (defaults to this.addMetadata) - */ - public addMetadata(type: string, data: any, fromFunction?: any): void { this._actualNode.addMetadata(type, data, fromFunction); } - - /** - * DEPRECATED: Adds a { "info": } metadata entry to this construct. - * The toolkit will display the info message when apps are synthesized. - * @param message The info message. - * @deprecated use `Annotations.of(construct).addInfo()` - */ - public addInfo(message: string): void { - Annotations.of(this.host).addInfo(message); - } - - /** - * DEPRECATED: Adds a { "warning": } metadata entry to this construct. - * The toolkit will display the warning when an app is synthesized, or fail - * if run in --strict mode. - * @param message The warning message. - * @deprecated use `Annotations.of(construct).addWarning()` - */ - public addWarning(message: string): void { - Annotations.of(this.host).addWarning(message); - } - - /** - * DEPRECATED: Adds an { "error": } metadata entry to this construct. - * The toolkit will fail synthesis when errors are reported. - * @param message The error message. - * @deprecated use `Annotations.of(construct).addError()` - */ - public addError(message: string) { - Annotations.of(this.host).addError(message); - } - - /** - * DEPRECATED: Applies the aspect to this Constructs node - * - * @deprecated This API is going to be removed in the next major version of - * the AWS CDK. Please use `Aspects.of(scope).add()` instead. - */ - public applyAspect(aspect: IAspect): void { - Annotations.of(this.host).addDeprecation('@aws-cdk/core.ConstructNode.applyAspect', 'Use "Aspects.of(construct).add(aspect)" instead'); - Aspects.of(this.host).add(aspect); - } - - /** - * Add a validator to this construct Node - */ - public addValidation(validation: constructs.IValidation) { - this._actualNode.addValidation(validation); - } - - /** - * All parent scopes of this construct. - * - * @returns a list of parent scopes. The last element in the list will always - * be the current construct and the first element will be the root of the - * tree. - */ - public get scopes(): IConstruct[] { return this._actualNode.scopes as IConstruct[]; } - - /** - * @returns The root of the construct tree. - */ - public get root(): IConstruct { return this._actualNode.root as IConstruct; } - - /** - * Returns true if this construct or the scopes in which it is defined are - * locked. - */ - public get locked() { return this._actualNode.locked; } - - /** - * Add an ordering dependency on another Construct. - * - * All constructs in the dependency's scope will be deployed before any - * construct in this construct's scope. - */ - public addDependency(...dependencies: IDependable[]) { this._actualNode.addDependency(...dependencies); } - - /** - * Return all dependencies registered on this node or any of its children - */ - public get dependencies(): Dependency[] { return this._actualNode.dependencies as Dependency[]; } - - /** - * Remove the child with the given name, if present. - * - * @returns Whether a child with the given name was deleted. - * @experimental - */ - public tryRemoveChild(childName: string): boolean { return this._actualNode.tryRemoveChild(childName); } -} - -/** - * An error returned during the validation phase. - */ -export interface ValidationError { - /** - * The construct which emitted the error. - */ - readonly source: Construct; - - /** - * The error message. - */ - readonly message: string; -} - -/** - * A single dependency - */ -export interface Dependency { - /** - * Source the dependency - */ - readonly source: IConstruct; - - /** - * Target of the dependency - */ - readonly target: IConstruct; -} - -function ignore(_x: any) { - return; -} diff --git a/packages/@aws-cdk/core/lib/custom-resource-provider/custom-resource-provider.ts b/packages/@aws-cdk/core/lib/custom-resource-provider/custom-resource-provider.ts index c7f3776339907..6277c13544884 100644 --- a/packages/@aws-cdk/core/lib/custom-resource-provider/custom-resource-provider.ts +++ b/packages/@aws-cdk/core/lib/custom-resource-provider/custom-resource-provider.ts @@ -12,10 +12,6 @@ import { Token } from '../token'; const ENTRYPOINT_FILENAME = '__entrypoint__'; const ENTRYPOINT_NODEJS_SOURCE = path.join(__dirname, 'nodejs-entrypoint.js'); -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '../construct-compat'; - /** * Initialization properties for `CustomResourceProvider`. * @@ -105,7 +101,7 @@ export enum CustomResourceProviderRuntime { * * @experimental */ -export class CustomResourceProvider extends CoreConstruct { +export class CustomResourceProvider extends Construct { /** * Returns a stack-level singleton ARN (service token) for the custom resource * provider. diff --git a/packages/@aws-cdk/core/lib/dependency.ts b/packages/@aws-cdk/core/lib/dependency.ts index 382d5acae0a61..6e5c775958b9d 100644 --- a/packages/@aws-cdk/core/lib/dependency.ts +++ b/packages/@aws-cdk/core/lib/dependency.ts @@ -1,4 +1,4 @@ -import { IConstruct } from './construct-compat'; +import { IConstruct } from 'constructs'; /** * Trait marker for classes that can be depended upon diff --git a/packages/@aws-cdk/core/lib/feature-flags.ts b/packages/@aws-cdk/core/lib/feature-flags.ts index 926a60168732f..699cbe4e1e092 100644 --- a/packages/@aws-cdk/core/lib/feature-flags.ts +++ b/packages/@aws-cdk/core/lib/feature-flags.ts @@ -1,5 +1,5 @@ import * as cxapi from '@aws-cdk/cx-api'; -import { Construct } from '../lib/construct-compat'; +import { Construct } from 'constructs'; /** * Features that are implemented behind a flag in order to preserve backwards diff --git a/packages/@aws-cdk/core/lib/index.ts b/packages/@aws-cdk/core/lib/index.ts index 4aa0cda188201..2cad352835973 100644 --- a/packages/@aws-cdk/core/lib/index.ts +++ b/packages/@aws-cdk/core/lib/index.ts @@ -1,7 +1,6 @@ export * from './aspect'; export * from './tag-aspect'; -export * from './construct-compat'; export * from './token'; export * from './resolvable'; export * from './lazy'; diff --git a/packages/@aws-cdk/core/lib/names.ts b/packages/@aws-cdk/core/lib/names.ts index 2d204c298d9fe..e68b43b137bf0 100644 --- a/packages/@aws-cdk/core/lib/names.ts +++ b/packages/@aws-cdk/core/lib/names.ts @@ -1,5 +1,4 @@ import { Construct, Node } from 'constructs'; -import { ConstructNode } from './construct-compat'; import { makeUniqueId } from './private/uniqueid'; /** @@ -31,8 +30,8 @@ export class Names { * @param node The construct node * @returns a unique id based on the construct path */ - public static nodeUniqueId(node: ConstructNode): string { - const components = node.scopes.slice(1).map(c => c.node.id); + public static nodeUniqueId(node: Node): string { + const components = node.scopes.slice(1).map(c => Node.of(c).id); return components.length > 0 ? makeUniqueId(components) : ''; } diff --git a/packages/@aws-cdk/core/lib/nested-stack.ts b/packages/@aws-cdk/core/lib/nested-stack.ts index 648211aab22f0..c4c7de212983f 100644 --- a/packages/@aws-cdk/core/lib/nested-stack.ts +++ b/packages/@aws-cdk/core/lib/nested-stack.ts @@ -14,10 +14,6 @@ import { Stack } from './stack'; import { NestedStackSynthesizer } from './stack-synthesizers'; import { Token } from './token'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from './construct-compat'; - const NESTED_STACK_SYMBOL = Symbol.for('@aws-cdk/core.NestedStack'); /** @@ -121,8 +117,7 @@ export class NestedStack extends Stack { this._parentStack = parentStack; - // @deprecate: remove this in v2.0 (redundent) - const parentScope = new CoreConstruct(scope, id + '.NestedStack'); + const parentScope = new Construct(scope, id + '.NestedStack'); Object.defineProperty(this, NESTED_STACK_SYMBOL, { value: true }); diff --git a/packages/@aws-cdk/core/lib/private/asset-parameters.ts b/packages/@aws-cdk/core/lib/private/asset-parameters.ts index e72eee27462b0..90153a2cfce1e 100644 --- a/packages/@aws-cdk/core/lib/private/asset-parameters.ts +++ b/packages/@aws-cdk/core/lib/private/asset-parameters.ts @@ -1,5 +1,5 @@ +import { Construct } from 'constructs'; import { CfnParameter } from '../cfn-parameter'; -import { Construct } from '../construct-compat'; export class FileAssetParameters extends Construct { public readonly bucketNameParameter: CfnParameter; diff --git a/packages/@aws-cdk/core/lib/private/cfn-reference.ts b/packages/@aws-cdk/core/lib/private/cfn-reference.ts index 34c3da0138ae8..ba4da752e1b9d 100644 --- a/packages/@aws-cdk/core/lib/private/cfn-reference.ts +++ b/packages/@aws-cdk/core/lib/private/cfn-reference.ts @@ -1,3 +1,4 @@ +/* eslint-disable import/order */ import { Reference } from '../reference'; const CFN_REFERENCE_SYMBOL = Symbol.for('@aws-cdk/core.CfnReference'); @@ -174,8 +175,8 @@ export class CfnReference extends Reference { } } +import { Construct, IConstruct } from 'constructs'; import { CfnElement } from '../cfn-element'; -import { Construct, IConstruct } from '../construct-compat'; import { IResolvable, IResolveContext } from '../resolvable'; import { Stack } from '../stack'; import { Token } from '../token'; diff --git a/packages/@aws-cdk/core/lib/private/cfn-utils-provider.ts b/packages/@aws-cdk/core/lib/private/cfn-utils-provider.ts index 04a68394fe2f3..b710d9ca217ec 100644 --- a/packages/@aws-cdk/core/lib/private/cfn-utils-provider.ts +++ b/packages/@aws-cdk/core/lib/private/cfn-utils-provider.ts @@ -1,4 +1,4 @@ -import { Construct } from '../construct-compat'; +import { Construct } from 'constructs'; import { CustomResource } from '../custom-resource'; import { CustomResourceProvider, CustomResourceProviderRuntime } from '../custom-resource-provider'; import { CfnUtilsResourceType } from './cfn-utils-provider/consts'; @@ -44,4 +44,4 @@ export abstract class CfnUtils { return resource.getAttString('Value'); } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/core/lib/private/metadata-resource.ts b/packages/@aws-cdk/core/lib/private/metadata-resource.ts index 1cccc4f24ff3d..17818add1a3ee 100644 --- a/packages/@aws-cdk/core/lib/private/metadata-resource.ts +++ b/packages/@aws-cdk/core/lib/private/metadata-resource.ts @@ -1,10 +1,10 @@ import * as zlib from 'zlib'; import { RegionInfo } from '@aws-cdk/region-info'; +import { Construct } from 'constructs'; import { CfnCondition } from '../cfn-condition'; import { Fn } from '../cfn-fn'; import { Aws } from '../cfn-pseudo'; import { CfnResource } from '../cfn-resource'; -import { Construct } from '../construct-compat'; import { Lazy } from '../lazy'; import { Stack } from '../stack'; import { Token } from '../token'; diff --git a/packages/@aws-cdk/core/lib/private/prepare-app.ts b/packages/@aws-cdk/core/lib/private/prepare-app.ts index e90a40ff211f8..7e1959b4a4293 100644 --- a/packages/@aws-cdk/core/lib/private/prepare-app.ts +++ b/packages/@aws-cdk/core/lib/private/prepare-app.ts @@ -1,6 +1,5 @@ -import { ConstructOrder } from 'constructs'; +import { ConstructOrder, Dependable, IConstruct } from 'constructs'; import { CfnResource } from '../cfn-resource'; -import { IConstruct } from '../construct-compat'; import { Stack } from '../stack'; import { Stage } from '../stage'; import { resolveReferences } from './refs'; @@ -17,7 +16,7 @@ import { resolveReferences } from './refs'; */ export function prepareApp(root: IConstruct) { // apply dependencies between resources in depending subtrees - for (const dependency of root.node.dependencies) { + for (const dependency of findTransitiveDeps(root)) { const targetCfnResources = findCfnResources(dependency.target); const sourceCfnResources = findCfnResources(dependency.source); @@ -103,3 +102,33 @@ function findCfnResources(root: IConstruct): CfnResource[] { interface INestedStackPrivateApi { _prepareTemplateAsset(): boolean; } + +/** + * Return all dependencies registered on this node or any of its children + */ +function findTransitiveDeps(root: IConstruct): Dependency[] { + const found = new Map>(); // Deduplication map + const ret = new Array(); + + for (const source of root.node.findAll()) { + for (const dependable of source.node.dependencies) { + for (const target of Dependable.of(dependable).dependencyRoots) { + let foundTargets = found.get(source); + if (!foundTargets) { found.set(source, foundTargets = new Set()); } + + if (!foundTargets.has(target)) { + ret.push({ source, target }); + foundTargets.add(target); + } + } + } + } + + return ret; +} + + +interface Dependency { + readonly source: IConstruct; + readonly target: IConstruct; +} diff --git a/packages/@aws-cdk/core/lib/private/refs.ts b/packages/@aws-cdk/core/lib/private/refs.ts index 27618d6776f21..6c4a9cd12e219 100644 --- a/packages/@aws-cdk/core/lib/private/refs.ts +++ b/packages/@aws-cdk/core/lib/private/refs.ts @@ -2,10 +2,10 @@ // CROSS REFERENCES // ---------------------------------------------------- +import { IConstruct } from 'constructs'; import { CfnElement } from '../cfn-element'; import { CfnOutput } from '../cfn-output'; import { CfnParameter } from '../cfn-parameter'; -import { IConstruct } from '../construct-compat'; import { Names } from '../names'; import { Reference } from '../reference'; import { IResolvable } from '../resolvable'; @@ -253,4 +253,4 @@ function isNested(nested: Stack, parent: Stack): boolean { // recurse with the child's direct parent return isNested(nested.nestedStackParent, parent); -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/core/lib/private/resolve.ts b/packages/@aws-cdk/core/lib/private/resolve.ts index 5f9620ecb759c..77ab06ab10948 100644 --- a/packages/@aws-cdk/core/lib/private/resolve.ts +++ b/packages/@aws-cdk/core/lib/private/resolve.ts @@ -4,10 +4,6 @@ import { TokenizedStringFragments } from '../string-fragments'; import { containsListTokenElement, TokenString, unresolved } from './encoding'; import { TokenMap } from './token-map'; -// v2 - leave this as a separate section so it reduces merge conflicts when compat is removed -// eslint-disable-next-line import/order -import { IConstruct as ICoreConstruct } from '../construct-compat'; - // This file should not be exported to consumers, resolving should happen through Construct.resolve() const tokenMap = TokenMap.instance(); @@ -107,7 +103,7 @@ export function resolve(obj: any, options: IResolveOptions): any { const context: IResolveContext = { preparing: options.preparing, - scope: options.scope as ICoreConstruct, + scope: options.scope as IConstruct, registerPostProcessor(pp) { postProcessor = pp; }, resolve(x: any, changeOptions?: ResolveChangeContextOptions) { return resolve(x, { ...options, ...changeOptions, prefix: newPrefix }); }, }; diff --git a/packages/@aws-cdk/core/lib/private/runtime-info.ts b/packages/@aws-cdk/core/lib/private/runtime-info.ts index da4fbdcbe99d8..09962305a152f 100644 --- a/packages/@aws-cdk/core/lib/private/runtime-info.ts +++ b/packages/@aws-cdk/core/lib/private/runtime-info.ts @@ -1,4 +1,4 @@ -import { IConstruct } from '../construct-compat'; +import { IConstruct } from 'constructs'; import { Stack } from '../stack'; import { Stage } from '../stage'; diff --git a/packages/@aws-cdk/core/lib/private/synthesis.ts b/packages/@aws-cdk/core/lib/private/synthesis.ts index 737f11367e13f..6100c2e1c082a 100644 --- a/packages/@aws-cdk/core/lib/private/synthesis.ts +++ b/packages/@aws-cdk/core/lib/private/synthesis.ts @@ -1,14 +1,24 @@ import * as cxapi from '@aws-cdk/cx-api'; -import * as constructs from 'constructs'; +import { IConstruct } from 'constructs'; import { Annotations } from '../annotations'; import { Aspects, IAspect } from '../aspect'; -import { Construct, IConstruct, SynthesisOptions, ValidationError } from '../construct-compat'; import { Stack } from '../stack'; import { Stage, StageSynthesisOptions } from '../stage'; import { MetadataResource } from './metadata-resource'; import { prepareApp } from './prepare-app'; import { TreeMetadata } from './tree-metadata'; +/** + * Options for `synthesize()` + */ +export interface SynthesisOptions extends StageSynthesisOptions { + /** + * The output directory into which to synthesize the cloud assembly. + * @default - creates a temporary directory + */ + readonly outdir?: string; +} + export function synthesize(root: IConstruct, options: SynthesisOptions = { }): cxapi.CloudAssembly { // we start by calling "synth" on all nested assemblies (which will take care of all their children) synthNestedAssemblies(root, options); @@ -17,9 +27,6 @@ export function synthesize(root: IConstruct, options: SynthesisOptions = { }): c injectMetadataResources(root); - // This is mostly here for legacy purposes as the framework itself does not use prepare anymore. - prepareTree(root); - // resolve references prepareApp(root); @@ -68,11 +75,11 @@ function invokeAspects(root: IConstruct) { let nestedAspectWarning = false; recurse(root, []); - function recurse(construct: IConstruct, inheritedAspects: constructs.IAspect[]) { + function recurse(construct: IConstruct, inheritedAspects: IAspect[]) { const node = construct.node; const aspects = Aspects.of(construct); - const allAspectsHere = [...inheritedAspects ?? [], ...aspects.aspects]; - const nodeAspectsCount = aspects.aspects.length; + const allAspectsHere = [...inheritedAspects ?? [], ...aspects.all]; + const nodeAspectsCount = aspects.all.length; for (const aspect of allAspectsHere) { let invoked = invokedByPath[node.path]; if (!invoked) { @@ -85,7 +92,7 @@ function invokeAspects(root: IConstruct) { // if an aspect was added to the node while invoking another aspect it will not be invoked, emit a warning // the `nestedAspectWarning` flag is used to prevent the warning from being emitted for every child - if (!nestedAspectWarning && nodeAspectsCount !== aspects.aspects.length) { + if (!nestedAspectWarning && nodeAspectsCount !== aspects.all.length) { Annotations.of(construct).addWarning('We detected an Aspect was added via another Aspect, and will not be applied'); nestedAspectWarning = true; } @@ -102,15 +109,6 @@ function invokeAspects(root: IConstruct) { } } -/** - * Prepare all constructs in the given construct tree in post-order. - * - * Stop at Assembly boundaries. - */ -function prepareTree(root: IConstruct) { - visit(root, 'post', construct => construct.onPrepare()); -} - /** * Find all stacks and add Metadata Resources to all of them * @@ -158,25 +156,25 @@ function synthesizeTree(root: IConstruct, builder: cxapi.CloudAssemblyBuilder) { } else if (construct instanceof TreeMetadata) { construct._synthesizeTree(session); } - - // this will soon be deprecated and removed in 2.x - // see https://github.com/aws/aws-cdk-rfcs/issues/192 - construct.onSynthesize(session); }); } +interface ValidationError { + readonly message: string; + readonly source: IConstruct; +} + /** * Validate all constructs in the given construct tree */ function validateTree(root: IConstruct) { const errors = new Array(); - // Validations added through `node.addValidation()` - // This automatically also includes Ye Olde Method of validating, using - // the `protected validate()` methods. - errors.push(...constructs.Node.of(root).validate().map(e => ({ - message: e.message, source: e.source as unknown as Construct, - }))); + visit(root, 'pre', construct => { + for (const message of construct.node.validate()) { + errors.push({ message, source: construct }); + } + }); if (errors.length > 0) { const errorList = errors.map(e => `[${e.source.node.path}] ${e.message}`).join('\n '); @@ -187,9 +185,9 @@ function validateTree(root: IConstruct) { /** * Visit the given construct tree in either pre or post order, stopping at Assemblies */ -function visit(root: IConstruct, order: 'pre' | 'post', cb: (x: IProtectedConstructMethods) => void) { +function visit(root: IConstruct, order: 'pre' | 'post', cb: (x: IConstruct) => void) { if (order === 'pre') { - cb(root as IProtectedConstructMethods); + cb(root); } for (const child of root.node.children) { @@ -198,28 +196,6 @@ function visit(root: IConstruct, order: 'pre' | 'post', cb: (x: IProtectedConstr } if (order === 'post') { - cb(root as IProtectedConstructMethods); + cb(root); } } - -/** - * Interface which provides access to special methods of Construct - * - * @experimental - */ -interface IProtectedConstructMethods extends IConstruct { - /** - * Method that gets called when a construct should synthesize itself to an assembly - */ - onSynthesize(session: constructs.ISynthesisSession): void; - - /** - * Method that gets called to validate a construct - */ - onValidate(): string[]; - - /** - * Method that gets called to prepare a construct - */ - onPrepare(): void; -} diff --git a/packages/@aws-cdk/core/lib/private/tree-metadata.ts b/packages/@aws-cdk/core/lib/private/tree-metadata.ts index 97fe514bb4d87..c6775d92a14fc 100644 --- a/packages/@aws-cdk/core/lib/private/tree-metadata.ts +++ b/packages/@aws-cdk/core/lib/private/tree-metadata.ts @@ -2,9 +2,10 @@ import * as fs from 'fs'; import * as path from 'path'; import { ArtifactType } from '@aws-cdk/cloud-assembly-schema'; +import { Construct, IConstruct } from 'constructs'; import { Annotations } from '../annotations'; -import { Construct, IConstruct, ISynthesisSession } from '../construct-compat'; import { Stack } from '../stack'; +import { ISynthesisSession } from '../stack-synthesizers'; import { IInspectable, TreeInspector } from '../tree'; import { ConstructInfo, constructInfoFromConstruct } from './runtime-info'; diff --git a/packages/@aws-cdk/core/lib/reference.ts b/packages/@aws-cdk/core/lib/reference.ts index affb5588fd797..ae72c3fed9d82 100644 --- a/packages/@aws-cdk/core/lib/reference.ts +++ b/packages/@aws-cdk/core/lib/reference.ts @@ -1,3 +1,4 @@ +import { IConstruct } from 'constructs'; import { Intrinsic } from './private/intrinsic'; const REFERENCE_SYMBOL = Symbol.for('@aws-cdk/core.Reference'); @@ -26,4 +27,3 @@ export abstract class Reference extends Intrinsic { } } -import { IConstruct } from './construct-compat'; diff --git a/packages/@aws-cdk/core/lib/resolvable.ts b/packages/@aws-cdk/core/lib/resolvable.ts index 9004cd111bb33..4a3a5a35c7df6 100644 --- a/packages/@aws-cdk/core/lib/resolvable.ts +++ b/packages/@aws-cdk/core/lib/resolvable.ts @@ -1,4 +1,4 @@ -import { IConstruct } from './construct-compat'; +import { IConstruct } from 'constructs'; import { TokenString } from './private/encoding'; import { TokenMap } from './private/token-map'; import { TokenizedStringFragments } from './string-fragments'; diff --git a/packages/@aws-cdk/core/lib/resource.ts b/packages/@aws-cdk/core/lib/resource.ts index a828f0d6cec98..0cf0302b81d3f 100644 --- a/packages/@aws-cdk/core/lib/resource.ts +++ b/packages/@aws-cdk/core/lib/resource.ts @@ -1,6 +1,5 @@ import { ArnComponents } from './arn'; import { CfnResource } from './cfn-resource'; -import { IConstruct, Construct as CoreConstruct } from './construct-compat'; import { IStringProducer, Lazy } from './lazy'; import { generatePhysicalName, isGeneratedWhenNeededMarker } from './private/physical-name-generator'; import { Reference } from './reference'; @@ -11,7 +10,7 @@ import { Token, Tokenization } from './token'; // v2 - leave this as a separate section so it reduces merge conflicts when compat is removed // eslint-disable-next-line import/order -import { Construct } from 'constructs'; +import { Construct, IConstruct } from 'constructs'; const RESOURCE_SYMBOL = Symbol.for('@aws-cdk/core.Resource'); @@ -95,7 +94,7 @@ export interface ResourceProps { /** * A construct which represents an AWS resource. */ -export abstract class Resource extends CoreConstruct implements IResource { +export abstract class Resource extends Construct implements IResource { /** * Check whether the given construct is a Resource */ @@ -284,4 +283,4 @@ function mimicReference(refSource: any, producer: IStringProducer): string { return producer.produce(context); } }(reference, reference.target, reference.displayName)); -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/core/lib/runtime.ts b/packages/@aws-cdk/core/lib/runtime.ts index 390708db3eccb..22f871e4d25c0 100644 --- a/packages/@aws-cdk/core/lib/runtime.ts +++ b/packages/@aws-cdk/core/lib/runtime.ts @@ -1,4 +1,4 @@ -import { Construct } from './construct-compat'; +import { Construct } from 'constructs'; // ---------------------------------------------------------------------- // PROPERTY MAPPERS diff --git a/packages/@aws-cdk/core/lib/stack-synthesizers/_shared.ts b/packages/@aws-cdk/core/lib/stack-synthesizers/_shared.ts index 233490968b31d..24640a8378fe2 100644 --- a/packages/@aws-cdk/core/lib/stack-synthesizers/_shared.ts +++ b/packages/@aws-cdk/core/lib/stack-synthesizers/_shared.ts @@ -1,7 +1,8 @@ import * as crypto from 'crypto'; import * as cxschema from '@aws-cdk/cloud-assembly-schema'; -import { ConstructNode, IConstruct, ISynthesisSession } from '../construct-compat'; +import { Node, IConstruct } from 'constructs'; import { Stack } from '../stack'; +import { ISynthesisSession } from './types'; /** * Shared logic of writing stack artifact to the Cloud Assembly @@ -79,7 +80,7 @@ function collectStackMetadata(stack: Stack) { if (node.node.metadata.length > 0) { // Make the path absolute - output[ConstructNode.PATH_SEP + node.node.path] = node.node.metadata.map(md => stack.resolve(md) as cxschema.MetadataEntry); + output[Node.PATH_SEP + node.node.path] = node.node.metadata.map(md => stack.resolve(md) as cxschema.MetadataEntry); } for (const child of node.node.children) { diff --git a/packages/@aws-cdk/core/lib/stack-synthesizers/bootstrapless-synthesizer.ts b/packages/@aws-cdk/core/lib/stack-synthesizers/bootstrapless-synthesizer.ts index 1a9a2ab8ee0cc..75836af954ba1 100644 --- a/packages/@aws-cdk/core/lib/stack-synthesizers/bootstrapless-synthesizer.ts +++ b/packages/@aws-cdk/core/lib/stack-synthesizers/bootstrapless-synthesizer.ts @@ -1,7 +1,7 @@ import { DockerImageAssetLocation, DockerImageAssetSource, FileAssetLocation, FileAssetSource } from '../assets'; -import { ISynthesisSession } from '../construct-compat'; import { assertBound } from './_shared'; import { DefaultStackSynthesizer } from './default-synthesizer'; +import { ISynthesisSession } from './types'; /** * Construction properties of {@link BootstraplessSynthesizer}. diff --git a/packages/@aws-cdk/core/lib/stack-synthesizers/default-synthesizer.ts b/packages/@aws-cdk/core/lib/stack-synthesizers/default-synthesizer.ts index 2527bca98c9d6..cf37695399fc1 100644 --- a/packages/@aws-cdk/core/lib/stack-synthesizers/default-synthesizer.ts +++ b/packages/@aws-cdk/core/lib/stack-synthesizers/default-synthesizer.ts @@ -6,11 +6,11 @@ import { DockerImageAssetLocation, DockerImageAssetSource, FileAssetLocation, Fi import { Fn } from '../cfn-fn'; import { CfnParameter } from '../cfn-parameter'; import { CfnRule } from '../cfn-rule'; -import { ISynthesisSession } from '../construct-compat'; import { Stack } from '../stack'; import { Token } from '../token'; import { assertBound, contentHash } from './_shared'; import { StackSynthesizer } from './stack-synthesizer'; +import { ISynthesisSession } from './types'; export const BOOTSTRAP_QUALIFIER_CONTEXT = '@aws-cdk/core:bootstrapQualifier'; @@ -580,7 +580,6 @@ function range(startIncl: number, endExcl: number) { return ret; } - function validateFileAssetSource(asset: FileAssetSource) { if (!!asset.executable === !!asset.fileName) { throw new Error(`Exactly one of 'fileName' or 'executable' is required, got: ${JSON.stringify(asset)}`); @@ -605,4 +604,4 @@ function validateDockerImageAssetSource(asset: DockerImageAssetSource) { throw new Error(`'${key}' is only allowed in combination with 'directoryName', got: ${JSON.stringify(asset)}`); } } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/core/lib/stack-synthesizers/legacy.ts b/packages/@aws-cdk/core/lib/stack-synthesizers/legacy.ts index bf699b271878d..6044edef0a9ba 100644 --- a/packages/@aws-cdk/core/lib/stack-synthesizers/legacy.ts +++ b/packages/@aws-cdk/core/lib/stack-synthesizers/legacy.ts @@ -1,12 +1,13 @@ import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import * as cxapi from '@aws-cdk/cx-api'; +import { Construct } from 'constructs'; import { DockerImageAssetLocation, DockerImageAssetSource, FileAssetLocation, FileAssetSource } from '../assets'; import { Fn } from '../cfn-fn'; -import { Construct, ISynthesisSession } from '../construct-compat'; import { FileAssetParameters } from '../private/asset-parameters'; import { Stack } from '../stack'; import { assertBound } from './_shared'; import { StackSynthesizer } from './stack-synthesizer'; +import { ISynthesisSession } from './types'; /** * The well-known name for the docker image asset ECR repository. All docker diff --git a/packages/@aws-cdk/core/lib/stack-synthesizers/nested.ts b/packages/@aws-cdk/core/lib/stack-synthesizers/nested.ts index 8eb05d34cba9e..ab6205e92ee47 100644 --- a/packages/@aws-cdk/core/lib/stack-synthesizers/nested.ts +++ b/packages/@aws-cdk/core/lib/stack-synthesizers/nested.ts @@ -1,9 +1,8 @@ import { DockerImageAssetLocation, DockerImageAssetSource, FileAssetLocation, FileAssetSource } from '../assets'; -import { ISynthesisSession } from '../construct-compat'; import { Stack } from '../stack'; import { assertBound } from './_shared'; import { StackSynthesizer } from './stack-synthesizer'; -import { IStackSynthesizer } from './types'; +import { IStackSynthesizer, ISynthesisSession } from './types'; /** * Deployment environment for a nested stack diff --git a/packages/@aws-cdk/core/lib/stack-synthesizers/stack-synthesizer.ts b/packages/@aws-cdk/core/lib/stack-synthesizers/stack-synthesizer.ts index 1a43f9da11316..0d4f959c24d16 100644 --- a/packages/@aws-cdk/core/lib/stack-synthesizers/stack-synthesizer.ts +++ b/packages/@aws-cdk/core/lib/stack-synthesizers/stack-synthesizer.ts @@ -1,8 +1,7 @@ import { DockerImageAssetLocation, DockerImageAssetSource, FileAssetLocation, FileAssetSource } from '../assets'; -import { ISynthesisSession } from '../construct-compat'; import { Stack } from '../stack'; import { addStackArtifactToAssembly } from './_shared'; -import { IStackSynthesizer } from './types'; +import { IStackSynthesizer, ISynthesisSession } from './types'; /** * Base class for implementing an IStackSynthesizer diff --git a/packages/@aws-cdk/core/lib/stack-synthesizers/types.ts b/packages/@aws-cdk/core/lib/stack-synthesizers/types.ts index 425aee7b7af5a..524cff35607ef 100644 --- a/packages/@aws-cdk/core/lib/stack-synthesizers/types.ts +++ b/packages/@aws-cdk/core/lib/stack-synthesizers/types.ts @@ -1,5 +1,5 @@ +import { CloudAssemblyBuilder } from '@aws-cdk/cx-api'; import { DockerImageAssetLocation, DockerImageAssetSource, FileAssetLocation, FileAssetSource } from '../assets'; -import { ISynthesisSession } from '../construct-compat'; import { Stack } from '../stack'; /** @@ -32,3 +32,18 @@ export interface IStackSynthesizer { */ synthesize(session: ISynthesisSession): void; } + +/** + * Represents a single session of synthesis. Passed into `Construct.synthesize()` methods. + */ +export interface ISynthesisSession { + /** + * The output directory for this synthesis session. + */ + outdir: string; + + /** + * Cloud assembly builder. + */ + assembly: CloudAssemblyBuilder; +} diff --git a/packages/@aws-cdk/core/lib/stack.ts b/packages/@aws-cdk/core/lib/stack.ts index 2284ddedc203f..8f5a6e4dd4171 100644 --- a/packages/@aws-cdk/core/lib/stack.ts +++ b/packages/@aws-cdk/core/lib/stack.ts @@ -11,7 +11,6 @@ import { CfnElement } from './cfn-element'; import { Fn } from './cfn-fn'; import { Aws, ScopedAws } from './cfn-pseudo'; import { CfnResource, TagType } from './cfn-resource'; -import { ISynthesisSession } from './construct-compat'; import { ContextProvider } from './context-provider'; import { Environment } from './environment'; import { FeatureFlags } from './feature-flags'; @@ -20,10 +19,6 @@ import { LogicalIDs } from './private/logical-id'; import { resolve } from './private/resolve'; import { makeUniqueId } from './private/uniqueid'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from './construct-compat'; - const STACK_SYMBOL = Symbol.for('@aws-cdk/core.Stack'); const MY_STACK_CACHE = Symbol.for('@aws-cdk/core.Stack.myStack'); @@ -148,7 +143,7 @@ export interface StackProps { /** * A root construct which represents a single CloudFormation stack. */ -export class Stack extends CoreConstruct implements ITaggable { +export class Stack extends Construct implements ITaggable { /** * Return whether the given object is a Stack. * @@ -1232,15 +1227,15 @@ function makeStackName(components: string[]) { function getCreateExportsScope(stack: Stack) { const exportsName = 'Exports'; - let stackExports = stack.node.tryFindChild(exportsName) as CoreConstruct; + let stackExports = stack.node.tryFindChild(exportsName) as Construct; if (stackExports === undefined) { - stackExports = new CoreConstruct(stack, exportsName); + stackExports = new Construct(stack, exportsName); } return stackExports; } -function generateExportName(stackExports: CoreConstruct, id: string) { +function generateExportName(stackExports: Construct, id: string) { const stackRelativeExports = FeatureFlags.of(stackExports).isEnabled(cxapi.STACK_RELATIVE_EXPORTS_CONTEXT); const stack = Stack.of(stackExports); @@ -1261,6 +1256,7 @@ interface StackDependency { reasons: string[]; } + /** * Options for the `stack.exportValue()` method */ @@ -1280,7 +1276,7 @@ import { FileSystem } from './fs'; import { Names } from './names'; import { Reference } from './reference'; import { IResolvable } from './resolvable'; -import { DefaultStackSynthesizer, IStackSynthesizer, LegacyStackSynthesizer } from './stack-synthesizers'; +import { DefaultStackSynthesizer, IStackSynthesizer, ISynthesisSession, LegacyStackSynthesizer } from './stack-synthesizers'; import { Stage } from './stage'; import { ITaggable, TagManager } from './tag-manager'; import { Token, Tokenization } from './token'; diff --git a/packages/@aws-cdk/core/lib/stage.ts b/packages/@aws-cdk/core/lib/stage.ts index fd93f4251bf7f..5f7acbc2ee25a 100644 --- a/packages/@aws-cdk/core/lib/stage.ts +++ b/packages/@aws-cdk/core/lib/stage.ts @@ -3,10 +3,6 @@ import { IConstruct, Construct, Node } from 'constructs'; import { Environment } from './environment'; import { synthesize } from './private/synthesis'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from './construct-compat'; - const STAGE_SYMBOL = Symbol.for('@aws-cdk/core.Stage'); /** @@ -70,7 +66,7 @@ export interface StageProps { * copies of your application which should be be deployed to different * environments. */ -export class Stage extends CoreConstruct { +export class Stage extends Construct { /** * Return the stage this construct is contained with, if available. If called * on a nested stage, returns its parent. diff --git a/packages/@aws-cdk/core/lib/tag-aspect.ts b/packages/@aws-cdk/core/lib/tag-aspect.ts index 09d79c7ea9799..9ea6644377d05 100644 --- a/packages/@aws-cdk/core/lib/tag-aspect.ts +++ b/packages/@aws-cdk/core/lib/tag-aspect.ts @@ -1,7 +1,6 @@ -// import * as cxapi from '@aws-cdk/cx-api'; +import { Construct, IConstruct } from 'constructs'; import { Annotations } from './annotations'; import { IAspect, Aspects } from './aspect'; -import { Construct, IConstruct } from './construct-compat'; import { ITaggable, TagManager } from './tag-manager'; /** diff --git a/packages/@aws-cdk/core/package.json b/packages/@aws-cdk/core/package.json index d1a10d8ac8fd2..d4f79ca5b2106 100644 --- a/packages/@aws-cdk/core/package.json +++ b/packages/@aws-cdk/core/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/core", "version": "0.0.0", + "private": true, "description": "AWS Cloud Development Kit Core Library", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -192,7 +193,7 @@ "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/region-info": "0.0.0", "@balena/dockerignore": "^1.0.2", - "constructs": "^3.2.0", + "constructs": "10.0.0-pre.5", "fs-extra": "^9.1.0", "ignore": "^5.1.8", "minimatch": "^3.0.4" @@ -208,7 +209,7 @@ "@aws-cdk/cloud-assembly-schema": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/core/test/annotations.test.ts b/packages/@aws-cdk/core/test/annotations.test.ts index 1b0cbf209c528..6e9d1b03340cc 100644 --- a/packages/@aws-cdk/core/test/annotations.test.ts +++ b/packages/@aws-cdk/core/test/annotations.test.ts @@ -1,6 +1,7 @@ import { CloudAssembly } from '@aws-cdk/cx-api'; +import { Construct } from 'constructs'; import { nodeunitShim, Test } from 'nodeunit-shim'; -import { Construct, App, Stack } from '../lib'; +import { App, Stack } from '../lib'; import { Annotations } from '../lib/annotations'; const restore = process.env.CDK_BLOCK_DEPRECATIONS; @@ -19,13 +20,13 @@ nodeunitShim({ // WHEN delete process.env.CDK_BLOCK_DEPRECATIONS; - Annotations.of(c1).addDeprecation('@aws-cdk/core.Construct.node', 'use @aws-cdk.Construct.construct instead'); + Annotations.of(c1).addDeprecation('@aws-cdk/core.Construct.node', 'use @aws-Construct.construct instead'); // THEN test.deepEqual(getWarnings(app.synth()), [ { path: '/MyStack/Hello', - message: 'The API @aws-cdk/core.Construct.node is deprecated: use @aws-cdk.Construct.construct instead. This API will be removed in the next major release', + message: 'The API @aws-cdk/core.Construct.node is deprecated: use @aws-Construct.construct instead. This API will be removed in the next major release', }, ]); test.done(); @@ -42,26 +43,26 @@ nodeunitShim({ // WHEN delete process.env.CDK_BLOCK_DEPRECATIONS; - Annotations.of(c1).addDeprecation('@aws-cdk/core.Construct.node', 'use @aws-cdk.Construct.construct instead'); - Annotations.of(c2).addDeprecation('@aws-cdk/core.Construct.node', 'use @aws-cdk.Construct.construct instead'); - Annotations.of(c1).addDeprecation('@aws-cdk/core.Construct.node', 'use @aws-cdk.Construct.construct instead'); - Annotations.of(c3).addDeprecation('@aws-cdk/core.Construct.node', 'use @aws-cdk.Construct.construct instead'); - Annotations.of(c1).addDeprecation('@aws-cdk/core.Construct.node', 'use @aws-cdk.Construct.construct instead'); - Annotations.of(c1).addDeprecation('@aws-cdk/core.Construct.node', 'use @aws-cdk.Construct.construct instead'); + Annotations.of(c1).addDeprecation('@aws-cdk/core.Construct.node', 'use @aws-Construct.construct instead'); + Annotations.of(c2).addDeprecation('@aws-cdk/core.Construct.node', 'use @aws-Construct.construct instead'); + Annotations.of(c1).addDeprecation('@aws-cdk/core.Construct.node', 'use @aws-Construct.construct instead'); + Annotations.of(c3).addDeprecation('@aws-cdk/core.Construct.node', 'use @aws-Construct.construct instead'); + Annotations.of(c1).addDeprecation('@aws-cdk/core.Construct.node', 'use @aws-Construct.construct instead'); + Annotations.of(c1).addDeprecation('@aws-cdk/core.Construct.node', 'use @aws-Construct.construct instead'); // THEN test.deepEqual(getWarnings(app.synth()), [ { path: '/MyStack1/Hello', - message: 'The API @aws-cdk/core.Construct.node is deprecated: use @aws-cdk.Construct.construct instead. This API will be removed in the next major release', + message: 'The API @aws-cdk/core.Construct.node is deprecated: use @aws-Construct.construct instead. This API will be removed in the next major release', }, { path: '/MyStack1/World', - message: 'The API @aws-cdk/core.Construct.node is deprecated: use @aws-cdk.Construct.construct instead. This API will be removed in the next major release', + message: 'The API @aws-cdk/core.Construct.node is deprecated: use @aws-Construct.construct instead. This API will be removed in the next major release', }, { path: '/MyStack2/FooBar', - message: 'The API @aws-cdk/core.Construct.node is deprecated: use @aws-cdk.Construct.construct instead. This API will be removed in the next major release', + message: 'The API @aws-cdk/core.Construct.node is deprecated: use @aws-Construct.construct instead. This API will be removed in the next major release', }, ]); test.done(); diff --git a/packages/@aws-cdk/core/test/app.test.ts b/packages/@aws-cdk/core/test/app.test.ts index 199b36dc87465..65fcec364ad16 100644 --- a/packages/@aws-cdk/core/test/app.test.ts +++ b/packages/@aws-cdk/core/test/app.test.ts @@ -1,7 +1,8 @@ import { ContextProvider } from '@aws-cdk/cloud-assembly-schema'; import * as cxapi from '@aws-cdk/cx-api'; +import { Construct } from 'constructs'; import { nodeunitShim, Test } from 'nodeunit-shim'; -import { CfnResource, Construct, Stack, StackProps } from '../lib'; +import { CfnResource, Stack, StackProps } from '../lib'; import { Annotations } from '../lib/annotations'; import { App, AppProps } from '../lib/app'; @@ -171,8 +172,10 @@ nodeunitShim({ 'app.synth() performs validation first and if there are errors, it returns the errors'(test: Test) { class Child extends Construct { - protected validate() { - return [`Error from ${this.node.id}`]; + constructor(scope: Construct, id: string) { + super(scope, id); + + this.node.addValidation({ validate: () => [`Error from ${this.node.id}`] }); } } diff --git a/packages/@aws-cdk/core/test/aspect.test.ts b/packages/@aws-cdk/core/test/aspect.test.ts index 5a94e397a91da..600b35fe8ecba 100644 --- a/packages/@aws-cdk/core/test/aspect.test.ts +++ b/packages/@aws-cdk/core/test/aspect.test.ts @@ -1,8 +1,8 @@ import * as cxschema from '@aws-cdk/cloud-assembly-schema'; +import { Construct, IConstruct } from 'constructs'; import { nodeunitShim, Test } from 'nodeunit-shim'; import { App } from '../lib'; import { IAspect, Aspects } from '../lib/aspect'; -import { Construct, IConstruct } from '../lib/construct-compat'; class MyConstruct extends Construct { public static IsMyConstruct(x: any): x is MyConstruct { diff --git a/packages/@aws-cdk/core/test/cfn-resource.test.ts b/packages/@aws-cdk/core/test/cfn-resource.test.ts index c625d477179b6..cfa4790ef032f 100644 --- a/packages/@aws-cdk/core/test/cfn-resource.test.ts +++ b/packages/@aws-cdk/core/test/cfn-resource.test.ts @@ -1,3 +1,4 @@ +import { Construct } from 'constructs'; import { nodeunitShim, Test } from 'nodeunit-shim'; import * as core from '../lib'; @@ -145,7 +146,7 @@ nodeunitShim({ const app = new core.App(); const stack = new core.Stack(app, 'TestStack'); - const subtree = new core.Construct(stack, 'subtree'); + const subtree = new Construct(stack, 'subtree'); // WHEN new HiddenCfnResource(subtree, 'R1', { type: 'Foo::R1' }); diff --git a/packages/@aws-cdk/core/test/construct.test.ts b/packages/@aws-cdk/core/test/construct.test.ts index a190ebaac7327..7dce12ec7931f 100644 --- a/packages/@aws-cdk/core/test/construct.test.ts +++ b/packages/@aws-cdk/core/test/construct.test.ts @@ -1,6 +1,7 @@ import * as cxschema from '@aws-cdk/cloud-assembly-schema'; +import { Construct, ConstructOrder, IConstruct } from 'constructs'; import { nodeunitShim, Test } from 'nodeunit-shim'; -import { App as Root, Aws, Construct, ConstructNode, ConstructOrder, IConstruct, Lazy, ValidationError } from '../lib'; +import { Names } from '../lib'; import { Annotations } from '../lib/annotations'; import { reEnableStackTraceCollection, restoreStackTraceColection } from './util'; @@ -11,7 +12,7 @@ nodeunitShim({ const root = new Root(); test.equal(root.node.id, '', 'if not specified, name of a root construct is an empty string'); test.ok(!root.node.scope, 'no parent'); - test.equal(root.node.children.length, 1); + test.equal(root.node.children.length, 0); test.done(); }, @@ -64,16 +65,6 @@ nodeunitShim({ test.done(); }, - 'dont allow unresolved tokens to be used in construct IDs'(test: Test) { - // GIVEN - const root = new Root(); - const token = Lazy.string({ produce: () => 'lazy' }); - - // WHEN + THEN - test.throws(() => new Construct(root, `MyID: ${token}`), /Cannot use tokens in construct ID: MyID: \${Token/); - test.done(); - }, - 'construct.uniqueId returns a tree-unique alphanumeric id of this construct'(test: Test) { const root = new Root(); @@ -84,15 +75,15 @@ nodeunitShim({ test.deepEqual(c1.node.path, 'This is the first child/Second level/My construct'); test.deepEqual(c2.node.path, 'This is the first child/My construct'); - test.deepEqual(c1.node.uniqueId, 'ThisisthefirstchildSecondlevelMyconstruct202131E0'); - test.deepEqual(c2.node.uniqueId, 'ThisisthefirstchildMyconstruct8C288DF9'); + test.deepEqual(Names.uniqueId(c1), 'ThisisthefirstchildSecondlevelMyconstruct202131E0'); + test.deepEqual(Names.uniqueId(c2), 'ThisisthefirstchildMyconstruct8C288DF9'); test.done(); }, 'cannot calculate uniqueId if the construct path is ["Default"]'(test: Test) { const root = new Root(); const c = new Construct(root, 'Default'); - test.throws(() => c.node.uniqueId, /Unable to calculate a unique id for an empty set of components/); + test.throws(() => Names.uniqueId(c), /Unable to calculate a unique id for an empty set of components/); test.done(); }, @@ -101,7 +92,7 @@ nodeunitShim({ const child = new Construct(root, 'Child1'); new Construct(root, 'Child2'); test.equal(child.node.children.length, 0, 'no children'); - test.equal(root.node.children.length, 3, 'three children are expected'); + test.equal(root.node.children.length, 2, 'three children are expected'); test.done(); }, @@ -143,7 +134,7 @@ nodeunitShim({ test.equal(t.root.toString(), ''); test.equal(t.child1_1_1.toString(), 'HighChild/Child1/Child11/Child111'); test.equal(t.child2.toString(), 'HighChild/Child2'); - test.equal(toTreeString(t.root), 'App\n TreeMetadata [Tree]\n Construct [HighChild]\n Construct [Child1]\n Construct [Child11]\n Construct [Child111]\n Construct [Child12]\n Construct [Child2]\n Construct [Child21]\n'); + test.equal(toTreeString(t.root), 'Root\n Construct [HighChild]\n Construct [Child1]\n Construct [Child11]\n Construct [Child111]\n Construct [Child12]\n Construct [Child2]\n Construct [Child21]\n'); test.done(); }, @@ -202,13 +193,6 @@ nodeunitShim({ test.done(); }, - 'fails if context key contains unresolved tokens'(test: Test) { - const root = new Root(); - test.throws(() => root.node.setContext(`my-${Aws.REGION}`, 'foo'), /Invalid context key/); - test.throws(() => root.node.tryGetContext(Aws.REGION), /Invalid context key/); - test.done(); - }, - 'construct.pathParts returns an array of strings of all names from root to node'(test: Test) { const tree = createTree(); test.deepEqual(tree.root.node.path, ''); @@ -233,7 +217,7 @@ nodeunitShim({ // THEN: They have different paths test.throws(() => { new Construct(root, 'SameName'); - }, /There is already a Construct with name 'SameName' in App/); + }, /There is already a Construct with name 'SameName' in Root/); // WHEN const c0 = new Construct(root, 'c0'); @@ -248,21 +232,20 @@ nodeunitShim({ }, 'addMetadata(type, data) can be used to attach metadata to constructs FIND_ME'(test: Test) { - const previousValue = reEnableStackTraceCollection(); const root = new Root(); const con = new Construct(root, 'MyConstruct'); test.deepEqual(con.node.metadata, [], 'starts empty'); - con.node.addMetadata('key', 'value'); + con.node.addMetadata('key', 'value', { stackTrace: true }); con.node.addMetadata('number', 103); con.node.addMetadata('array', [123, 456]); - restoreStackTraceColection(previousValue); test.deepEqual(con.node.metadata[0].type, 'key'); test.deepEqual(con.node.metadata[0].data, 'value'); test.deepEqual(con.node.metadata[1].data, 103); test.deepEqual(con.node.metadata[2].data, [123, 456]); - test.ok(con.node.metadata[0].trace && con.node.metadata[0].trace[1].indexOf('FIND_ME') !== -1, 'First stack line should include this function\s name'); + + test.ok(con.node.metadata[0].trace && con.node.metadata[0].trace[0].indexOf('FIND_ME') !== -1, 'First stack line should include this function\s name'); test.done(); }, @@ -338,14 +321,16 @@ nodeunitShim({ 'construct.validate() can be implemented to perform validation, ConstructNode.validate(construct.node) will return all errors from the subtree (DFS)'(test: Test) { class MyConstruct extends Construct { - protected validate() { - return ['my-error1', 'my-error2']; + constructor(scope: Construct, id: string) { + super(scope, id); + this.node.addValidation({ validate: () => ['my-error1', 'my-error2'] }); } } class YourConstruct extends Construct { - protected validate() { - return ['your-error1']; + constructor(scope: Construct, id: string) { + super(scope, id); + this.node.addValidation({ validate: () => ['your-error1'] }); } } @@ -354,10 +339,7 @@ nodeunitShim({ super(scope, id); new YourConstruct(this, 'YourConstruct'); - } - - protected validate() { - return ['their-error']; + this.node.addValidation({ validate: () => ['their-error'] }); } } @@ -367,24 +349,30 @@ nodeunitShim({ new MyConstruct(this, 'MyConstruct'); new TheirConstruct(this, 'TheirConstruct'); - } - protected validate() { - return ['stack-error']; + this.node.addValidation({ validate: () => ['stack-error'] }); } } const stack = new TestStack(); - const errors = ConstructNode.validate(stack.node).map((v: ValidationError) => ({ path: v.source.node.path, message: v.message })); + const errors = new Array<{ path: string, message: string }>(); + for (const child of stack.node.findAll()) { + for (const message of child.node.validate()) { + errors.push({ + path: child.node.path, + message, + }); + } + } // validate DFS test.deepEqual(errors, [ + { path: '', message: 'stack-error' }, { path: 'MyConstruct', message: 'my-error1' }, { path: 'MyConstruct', message: 'my-error2' }, - { path: 'TheirConstruct/YourConstruct', message: 'your-error1' }, { path: 'TheirConstruct', message: 'their-error' }, - { path: '', message: 'stack-error' }, + { path: 'TheirConstruct/YourConstruct', message: 'your-error1' }, ]); test.done(); @@ -394,11 +382,7 @@ nodeunitShim({ class LockableConstruct extends Construct { public lockMe() { - (this.node._actualNode as any)._lock(); - } - - public unlockMe() { - (this.node._actualNode as any)._unlock(); + this.node.lock(); } } @@ -418,12 +402,6 @@ nodeunitShim({ test.throws(() => new Construct(c1a, 'fail2'), /Cannot add children to "c0a\/c1a" during synthesis/); test.throws(() => new Construct(c1b, 'fail3'), /Cannot add children to "c0a\/c1b" during synthesis/); - c0a.unlockMe(); - - new Construct(c0a, 'c0aZ'); - new Construct(c1a, 'c1aZ'); - new Construct(c1b, 'c1bZ'); - test.done(); }, @@ -547,3 +525,9 @@ function toTreeString(node: IConstruct, depth = 0) { } return out; } + +class Root extends Construct { + constructor() { + super(undefined as any, undefined as any); + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/core/test/context.test.ts b/packages/@aws-cdk/core/test/context.test.ts index 89c720e735999..53fe6e6fd4d5a 100644 --- a/packages/@aws-cdk/core/test/context.test.ts +++ b/packages/@aws-cdk/core/test/context.test.ts @@ -1,5 +1,6 @@ +import { Construct } from 'constructs'; import { nodeunitShim, Test } from 'nodeunit-shim'; -import { Construct, Stack } from '../lib'; +import { Stack } from '../lib'; import { ContextProvider } from '../lib/context-provider'; import { synthesize } from '../lib/private/synthesis'; diff --git a/packages/@aws-cdk/core/test/cross-environment-token.test.ts b/packages/@aws-cdk/core/test/cross-environment-token.test.ts index a0d833996121c..e8fc86af6bb0b 100644 --- a/packages/@aws-cdk/core/test/cross-environment-token.test.ts +++ b/packages/@aws-cdk/core/test/cross-environment-token.test.ts @@ -1,5 +1,6 @@ +import { Construct } from 'constructs'; import { nodeunitShim, Test } from 'nodeunit-shim'; -import { App, CfnOutput, CfnResource, Construct, PhysicalName, Resource, Stack } from '../lib'; +import { App, CfnOutput, CfnResource, PhysicalName, Resource, Stack } from '../lib'; import { toCloudFormation } from './util'; /* eslint-disable quote-props */ diff --git a/packages/@aws-cdk/core/test/logical-id.test.ts b/packages/@aws-cdk/core/test/logical-id.test.ts index f4ab0f8eb63d9..ba7ade056a70e 100644 --- a/packages/@aws-cdk/core/test/logical-id.test.ts +++ b/packages/@aws-cdk/core/test/logical-id.test.ts @@ -1,5 +1,6 @@ +import { Construct } from 'constructs'; import { nodeunitShim, Test } from 'nodeunit-shim'; -import { CfnElement, CfnResource, Construct, Stack } from '../lib'; +import { CfnElement, CfnResource, Stack } from '../lib'; import { toCloudFormation } from './util'; /** diff --git a/packages/@aws-cdk/core/test/metadata-resource.test.ts b/packages/@aws-cdk/core/test/metadata-resource.test.ts index ca87ae9d252f6..c3f8c99a2988f 100644 --- a/packages/@aws-cdk/core/test/metadata-resource.test.ts +++ b/packages/@aws-cdk/core/test/metadata-resource.test.ts @@ -1,11 +1,9 @@ import * as zlib from 'zlib'; +import { Construct } from 'constructs'; import { App, Stack } from '../lib'; import { formatAnalytics } from '../lib/private/metadata-resource'; import { ConstructInfo } from '../lib/private/runtime-info'; -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '../lib'; - describe('MetadataResource', () => { let app: App; let stack: Stack; diff --git a/packages/@aws-cdk/core/test/output.test.ts b/packages/@aws-cdk/core/test/output.test.ts index 0359049756946..84f7828b5eb8a 100644 --- a/packages/@aws-cdk/core/test/output.test.ts +++ b/packages/@aws-cdk/core/test/output.test.ts @@ -1,5 +1,5 @@ import { nodeunitShim, Test } from 'nodeunit-shim'; -import { App, CfnOutput, CfnResource, ConstructNode, Stack, ValidationError } from '../lib'; +import { App, CfnOutput, CfnResource, Stack } from '../lib'; import { toCloudFormation } from './util'; let app: App; @@ -115,9 +115,8 @@ nodeunitShim({ }, 'Verify maximum length of export name'(test: Test) { - new CfnOutput(stack, 'SomeOutput', { value: 'x', exportName: 'x'.repeat(260) }); - - const errors = ConstructNode.validate(stack.node).map((v: ValidationError) => v.message); + const output = new CfnOutput(stack, 'SomeOutput', { value: 'x', exportName: 'x'.repeat(260) }); + const errors = output.node.validate(); expect(errors).toEqual([ expect.stringContaining('Export name cannot exceed 255 characters'), diff --git a/packages/@aws-cdk/core/test/parameter.test.ts b/packages/@aws-cdk/core/test/parameter.test.ts index d13edbffddb0a..d86491bf887d0 100644 --- a/packages/@aws-cdk/core/test/parameter.test.ts +++ b/packages/@aws-cdk/core/test/parameter.test.ts @@ -1,5 +1,6 @@ +import { Construct } from 'constructs'; import { nodeunitShim, Test } from 'nodeunit-shim'; -import { CfnParameter, CfnResource, Construct, Stack } from '../lib'; +import { CfnParameter, CfnResource, Stack } from '../lib'; import { toCloudFormation } from './util'; nodeunitShim({ diff --git a/packages/@aws-cdk/core/test/private/tree-metadata.test.ts b/packages/@aws-cdk/core/test/private/tree-metadata.test.ts index b7173aca585ec..00a3d7eb97741 100644 --- a/packages/@aws-cdk/core/test/private/tree-metadata.test.ts +++ b/packages/@aws-cdk/core/test/private/tree-metadata.test.ts @@ -1,11 +1,12 @@ import * as fs from 'fs'; import * as path from 'path'; import * as cxschema from '@aws-cdk/cloud-assembly-schema'; +import { Construct } from 'constructs'; import { nodeunitShim, Test } from 'nodeunit-shim'; -import { App, CfnParameter, CfnResource, Construct as CfnConstruct, Lazy, Stack, TreeInspector } from '../../lib/index'; +import { App, CfnParameter, CfnResource, Lazy, Stack, TreeInspector } from '../../lib/index'; abstract class AbstractCfnResource extends CfnResource { - constructor(scope: CfnConstruct, id: string) { + constructor(scope: Construct, id: string) { super(scope, id, { type: 'CDK::UnitTest::MyCfnResource', }); @@ -24,7 +25,7 @@ nodeunitShim({ const app = new App(); const stack = new Stack(app, 'mystack'); - new CfnConstruct(stack, 'myconstruct'); + new Construct(stack, 'myconstruct'); const assembly = app.synth(); const treeArtifact = assembly.tree(); @@ -233,7 +234,7 @@ nodeunitShim({ class MyFirstResource extends AbstractCfnResource { public readonly lazykey: string; - constructor(scope: CfnConstruct, id: string) { + constructor(scope: Construct, id: string) { super(scope, id); this.lazykey = Lazy.string({ produce: () => 'LazyResolved!' }); } @@ -248,7 +249,7 @@ nodeunitShim({ class MySecondResource extends AbstractCfnResource { public readonly myprop: string; - constructor(scope: CfnConstruct, id: string, myprop: string) { + constructor(scope: Construct, id: string, myprop: string) { super(scope, id); this.myprop = myprop; } diff --git a/packages/@aws-cdk/core/test/resource.test.ts b/packages/@aws-cdk/core/test/resource.test.ts index b883d11f8d752..acc2ffddd376c 100644 --- a/packages/@aws-cdk/core/test/resource.test.ts +++ b/packages/@aws-cdk/core/test/resource.test.ts @@ -1,8 +1,9 @@ import * as cxapi from '@aws-cdk/cx-api'; +import { Construct } from 'constructs'; import { nodeunitShim, Test } from 'nodeunit-shim'; import { App, App as Root, CfnCondition, - CfnDeletionPolicy, CfnResource, Construct, + CfnDeletionPolicy, CfnResource, Fn, RemovalPolicy, Stack, } from '../lib'; import { synthesize } from '../lib/private/synthesis'; diff --git a/packages/@aws-cdk/core/test/runtime-info.test.ts b/packages/@aws-cdk/core/test/runtime-info.test.ts index 421c504036e33..43f542e6e84cd 100644 --- a/packages/@aws-cdk/core/test/runtime-info.test.ts +++ b/packages/@aws-cdk/core/test/runtime-info.test.ts @@ -1,10 +1,8 @@ import * as path from 'path'; +import { Construct } from 'constructs'; import { App, NestedStack, Stack, Stage } from '../lib'; import { constructInfoFromConstruct, constructInfoFromStack } from '../lib/private/runtime-info'; -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '../lib'; - const JSII_RUNTIME_SYMBOL = Symbol.for('jsii.rtti'); let app: App; diff --git a/packages/@aws-cdk/core/test/stack.test.ts b/packages/@aws-cdk/core/test/stack.test.ts index 849ad10369147..e22340073a330 100644 --- a/packages/@aws-cdk/core/test/stack.test.ts +++ b/packages/@aws-cdk/core/test/stack.test.ts @@ -1,9 +1,10 @@ import * as cxapi from '@aws-cdk/cx-api'; +import { Construct } from 'constructs'; import { testFutureBehavior, testLegacyBehavior } from 'cdk-build-tools/lib/feature-flag'; import { App, CfnCondition, CfnInclude, CfnOutput, CfnParameter, - CfnResource, Construct, Lazy, ScopedAws, Stack, validateString, - ISynthesisSession, Tags, LegacyStackSynthesizer, DefaultStackSynthesizer, + CfnResource, Lazy, ScopedAws, Stack, validateString, + Tags, LegacyStackSynthesizer, DefaultStackSynthesizer, NestedStack, } from '../lib'; import { Intrinsic } from '../lib/private/intrinsic'; @@ -1105,25 +1106,6 @@ describe('stack', () => { }); - test('users can (still) override "synthesize()" in stack', () => { - let called = false; - - class MyStack extends Stack { - synthesize(session: ISynthesisSession) { - called = true; - expect(session.outdir).toBeDefined(); - expect(session.assembly.outdir).toEqual(session.outdir); - } - } - - const app = new App(); - new MyStack(app, 'my-stack'); - - app.synth(); - expect(called).toEqual(true); - - }); - test('context can be set on a stack using a LegacySynthesizer', () => { // WHEN const stack = new Stack(undefined, undefined, { @@ -1181,4 +1163,4 @@ class StackWithPostProcessor extends Stack { return template; } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/core/test/stage.test.ts b/packages/@aws-cdk/core/test/stage.test.ts index 897b3513d6163..4fb4d13462ffc 100644 --- a/packages/@aws-cdk/core/test/stage.test.ts +++ b/packages/@aws-cdk/core/test/stage.test.ts @@ -1,7 +1,8 @@ import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import * as cxapi from '@aws-cdk/cx-api'; +import { Construct, IConstruct } from 'constructs'; import { nodeunitShim, Test } from 'nodeunit-shim'; -import { App, CfnResource, Construct, IAspect, IConstruct, Stack, Stage, Aspects } from '../lib'; +import { App, CfnResource, IAspect, Stack, Stage, Aspects } from '../lib'; nodeunitShim({ 'Stack inherits unspecified part of the env from Stage'(test: Test) { @@ -119,28 +120,6 @@ nodeunitShim({ test.done(); }, - 'When we synth() a stage, prepare must be called on constructs in the stage'(test: Test) { - // GIVEN - const app = new App(); - let prepared = false; - const stage = new Stage(app, 'MyStage'); - const stack = new BogusStack(stage, 'Stack'); - class HazPrepare extends Construct { - protected prepare() { - prepared = true; - } - } - new HazPrepare(stack, 'Preparable'); - - // WHEN - stage.synth(); - - // THEN - test.equals(prepared, true); - - test.done(); - }, - 'When we synth() a stage, aspects inside it must have been applied'(test: Test) { // GIVEN const app = new App(); diff --git a/packages/@aws-cdk/core/test/synthesis.test.ts b/packages/@aws-cdk/core/test/synthesis.test.ts index 8b5200c1dfb72..dc128779cde48 100644 --- a/packages/@aws-cdk/core/test/synthesis.test.ts +++ b/packages/@aws-cdk/core/test/synthesis.test.ts @@ -4,6 +4,7 @@ import * as path from 'path'; import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import { nodeunitShim, Test } from 'nodeunit-shim'; import * as cdk from '../lib'; +import { synthesize } from '../lib/private/synthesis'; function createModernApp() { return new cdk.App(); @@ -61,65 +62,22 @@ nodeunitShim({ test.done(); }, - 'some random construct implements "synthesize"'(test: Test) { - // GIVEN - const app = createModernApp(); - const stack = new cdk.Stack(app, 'one-stack'); - - class MyConstruct extends cdk.Construct { - protected synthesize(s: cdk.ISynthesisSession) { - writeJson(s.assembly.outdir, 'foo.json', { bar: 123 }); - s.assembly.addArtifact('my-random-construct', { - type: cxschema.ArtifactType.AWS_CLOUDFORMATION_STACK, - environment: 'aws://12345/bar', - properties: { - templateFile: 'foo.json', - }, - }); - } - } - - new MyConstruct(stack, 'MyConstruct'); - - // WHEN - const session = app.synth(); - - // THEN - test.ok(list(session.directory).includes('one-stack.template.json')); - test.ok(list(session.directory).includes('foo.json')); - - test.deepEqual(readJson(session.directory, 'foo.json'), { bar: 123 }); - test.deepEqual(session.manifest, { - version: cxschema.Manifest.version(), - artifacts: { - 'Tree': { - type: 'cdk:tree', - properties: { file: 'tree.json' }, - }, - 'my-random-construct': { - type: 'aws:cloudformation:stack', - environment: 'aws://12345/bar', - properties: { templateFile: 'foo.json' }, - }, - 'one-stack': { - type: 'aws:cloudformation:stack', - environment: 'aws://unknown-account/unknown-region', - properties: { templateFile: 'one-stack.template.json' }, - }, - }, - }); - test.done(); - }, - 'it should be possible to synthesize without an app'(test: Test) { const calls = new Array(); - class SynthesizeMe extends cdk.Construct { + class SynthesizeMe extends cdk.Stack { constructor() { super(undefined as any, 'id'); + + this.node.addValidation({ + validate: () => { + calls.push('validate'); + return []; + }, + }); } - protected synthesize(session: cdk.ISynthesisSession) { + public _synthesizeTemplate(session: cdk.ISynthesisSession) { calls.push('synthesize'); session.assembly.addArtifact('art', { @@ -136,21 +94,12 @@ nodeunitShim({ writeJson(session.assembly.outdir, 'hey.json', { hello: 123 }); } - - protected validate(): string[] { - calls.push('validate'); - return []; - } - - protected prepare(): void { - calls.push('prepare'); - } } const root = new SynthesizeMe(); - const assembly = cdk.ConstructNode.synth(root.node, { outdir: fs.mkdtempSync(path.join(os.tmpdir(), 'outdir')) }); + const assembly = synthesize(root, { outdir: fs.mkdtempSync(path.join(os.tmpdir(), 'outdir')) }); - test.deepEqual(calls, ['prepare', 'validate', 'synthesize']); + test.deepEqual(calls, ['validate', 'synthesize']); const stack = assembly.getStackByName('art'); test.deepEqual(stack.template, { hello: 123 }); test.deepEqual(stack.templateFile, 'hey.json'); diff --git a/packages/@aws-cdk/core/test/tag-aspect.test.ts b/packages/@aws-cdk/core/test/tag-aspect.test.ts index b0871e2d13c02..6baa360d09353 100644 --- a/packages/@aws-cdk/core/test/tag-aspect.test.ts +++ b/packages/@aws-cdk/core/test/tag-aspect.test.ts @@ -1,5 +1,6 @@ +import { Construct } from 'constructs'; import { nodeunitShim, Test } from 'nodeunit-shim'; -import { CfnResource, CfnResourceProps, Construct, RemoveTag, Stack, Tag, TagManager, TagType, Aspects, Tags } from '../lib'; +import { CfnResource, CfnResourceProps, RemoveTag, Stack, Tag, TagManager, TagType, Aspects, Tags } from '../lib'; import { synthesize } from '../lib/private/synthesis'; class TaggableResource extends CfnResource { diff --git a/packages/@aws-cdk/core/test/util.test.ts b/packages/@aws-cdk/core/test/util.test.ts index 3b9c33f14c9f4..60889584a1158 100644 --- a/packages/@aws-cdk/core/test/util.test.ts +++ b/packages/@aws-cdk/core/test/util.test.ts @@ -1,5 +1,6 @@ +import { Construct } from 'constructs'; import { nodeunitShim, Test } from 'nodeunit-shim'; -import { CfnResource, Construct, Stack } from '../lib'; +import { CfnResource, Stack } from '../lib'; import { capitalizePropertyNames, filterUndefined, findLastCommonElement, ignoreEmpty, pathToTopLevelStack } from '../lib/util'; nodeunitShim({ diff --git a/packages/@aws-cdk/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts b/packages/@aws-cdk/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts index bc86cea1c9d43..e633a213a178e 100644 --- a/packages/@aws-cdk/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts +++ b/packages/@aws-cdk/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts @@ -7,10 +7,6 @@ import * as cdk from '@aws-cdk/core'; import { Construct } from 'constructs'; import { PHYSICAL_RESOURCE_ID_REFERENCE } from './runtime'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main -// eslint-disable-next-line no-duplicate-imports, import/order -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Reference to the physical resource id that can be passed to the AWS operation as a parameter. */ @@ -288,7 +284,7 @@ export interface AwsCustomResourceProps { * You can specify exactly which calls are invoked for the 'CREATE', 'UPDATE' and 'DELETE' life cycle events. * */ -export class AwsCustomResource extends CoreConstruct implements iam.IGrantable { +export class AwsCustomResource extends Construct implements iam.IGrantable { private static breakIgnoreErrorsCircuit(sdkCalls: Array, caller: string) { diff --git a/packages/@aws-cdk/custom-resources/lib/provider-framework/provider.ts b/packages/@aws-cdk/custom-resources/lib/provider-framework/provider.ts index fe46a7dd7f0b5..959c8b46a783c 100644 --- a/packages/@aws-cdk/custom-resources/lib/provider-framework/provider.ts +++ b/packages/@aws-cdk/custom-resources/lib/provider-framework/provider.ts @@ -11,9 +11,6 @@ import { WaiterStateMachine } from './waiter-state-machine'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order import { CustomResourceProviderConfig, ICustomResourceProvider } from '@aws-cdk/aws-cloudformation'; -// keep this import separate from other imports to reduce chance for merge conflicts with v2-main", -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; const RUNTIME_HANDLER_PATH = path.join(__dirname, 'runtime'); const FRAMEWORK_HANDLER_TIMEOUT = Duration.minutes(15); // keep it simple for now @@ -110,7 +107,7 @@ export interface ProviderProps { /** * Defines an AWS CloudFormation custom resource provider. */ -export class Provider extends CoreConstruct implements ICustomResourceProvider { +export class Provider extends Construct implements ICustomResourceProvider { /** * The user-defined AWS Lambda function which is invoked for all resource @@ -180,7 +177,7 @@ export class Provider extends CoreConstruct implements ICustomResourceProvider { * Called by `CustomResource` which uses this provider. * @deprecated use `provider.serviceToken` instead */ - public bind(_scope: CoreConstruct): CustomResourceProviderConfig { + public bind(_scope: Construct): CustomResourceProviderConfig { return { serviceToken: this.entrypoint.functionArn, }; diff --git a/packages/@aws-cdk/custom-resources/lib/provider-framework/waiter-state-machine.ts b/packages/@aws-cdk/custom-resources/lib/provider-framework/waiter-state-machine.ts index 6799fb3178123..9511ef5a43373 100644 --- a/packages/@aws-cdk/custom-resources/lib/provider-framework/waiter-state-machine.ts +++ b/packages/@aws-cdk/custom-resources/lib/provider-framework/waiter-state-machine.ts @@ -4,7 +4,7 @@ import { CfnResource, Duration, Stack } from '@aws-cdk/core'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; export interface WaiterStateMachineProps { /** @@ -103,4 +103,4 @@ export class WaiterStateMachine extends Construct { resourceArns: [this.stateMachineArn], }); } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/custom-resources/package.json b/packages/@aws-cdk/custom-resources/package.json index 6c3c3d4f2d0b5..dd9f915dfd293 100644 --- a/packages/@aws-cdk/custom-resources/package.json +++ b/packages/@aws-cdk/custom-resources/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/custom-resources", "version": "0.0.0", + "private": true, "description": "Constructs for implementing CDK custom resources", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -96,7 +97,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/aws-ec2": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -107,7 +108,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/aws-ec2": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/custom-resources/test/provider-framework/integration-test-fixtures/s3-assert.ts b/packages/@aws-cdk/custom-resources/test/provider-framework/integration-test-fixtures/s3-assert.ts index 369369945632f..e20403d0cccac 100644 --- a/packages/@aws-cdk/custom-resources/test/provider-framework/integration-test-fixtures/s3-assert.ts +++ b/packages/@aws-cdk/custom-resources/test/provider-framework/integration-test-fixtures/s3-assert.ts @@ -6,10 +6,6 @@ import { CustomResource, Duration, Stack } from '@aws-cdk/core'; import { Construct, Node } from 'constructs'; import * as cr from '../../../lib'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - export interface S3AssertProps { /** * The s3 bucket to query. @@ -34,7 +30,7 @@ export interface S3AssertProps { * * Code is written in Python because why not. */ -export class S3Assert extends CoreConstruct { +export class S3Assert extends Construct { constructor(scope: Construct, id: string, props: S3AssertProps) { super(scope, id); @@ -51,7 +47,7 @@ export class S3Assert extends CoreConstruct { } } -class S3AssertProvider extends CoreConstruct { +class S3AssertProvider extends Construct { /** * Returns the singleton provider. diff --git a/packages/@aws-cdk/custom-resources/test/provider-framework/integration-test-fixtures/s3-file.ts b/packages/@aws-cdk/custom-resources/test/provider-framework/integration-test-fixtures/s3-file.ts index d70759be12b79..01338a2857e7a 100644 --- a/packages/@aws-cdk/custom-resources/test/provider-framework/integration-test-fixtures/s3-file.ts +++ b/packages/@aws-cdk/custom-resources/test/provider-framework/integration-test-fixtures/s3-file.ts @@ -7,10 +7,6 @@ import { Construct, Node } from 'constructs'; import * as cr from '../../../lib'; import * as api from './s3-file-handler/api'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - interface S3FileProps { /** * The bucket in which the file will be created. @@ -37,7 +33,7 @@ interface S3FileProps { readonly public?: boolean; } -export class S3File extends CoreConstruct { +export class S3File extends Construct { public readonly objectKey: string; public readonly url: string; public readonly etag: string; @@ -62,7 +58,7 @@ export class S3File extends CoreConstruct { } } -class S3FileProvider extends CoreConstruct { +class S3FileProvider extends Construct { /** * Returns the singleton provider. diff --git a/packages/@aws-cdk/cx-api/lib/features.ts b/packages/@aws-cdk/cx-api/lib/features.ts index 162ec0de9d7f4..138673fbdd3f6 100644 --- a/packages/@aws-cdk/cx-api/lib/features.ts +++ b/packages/@aws-cdk/cx-api/lib/features.ts @@ -136,6 +136,12 @@ export const FUTURE_FLAGS: { [key: string]: any } = { * and block usages of old feature flags in the new major version of CDK. */ export const FUTURE_FLAGS_EXPIRED: string[] = [ + DOCKER_IGNORE_SUPPORT, + ENABLE_DIFF_NO_FAIL_CONTEXT, + ENABLE_STACK_NAME_DUPLICATES_CONTEXT, + KMS_DEFAULT_KEY_POLICIES, + S3_GRANT_WRITE_WITHOUT_ACL, + SECRETS_MANAGER_PARSE_OWNED_SECRET_NAME, ]; /** diff --git a/packages/@aws-cdk/cx-api/package.json b/packages/@aws-cdk/cx-api/package.json index 5e5ce913f629c..365a4525a1303 100644 --- a/packages/@aws-cdk/cx-api/package.json +++ b/packages/@aws-cdk/cx-api/package.json @@ -158,6 +158,6 @@ "jest": true }, "publishConfig": { - "tag": "latest" + "tag": "next" } } diff --git a/packages/@aws-cdk/example-construct-library/package.json b/packages/@aws-cdk/example-construct-library/package.json index 762b080eff94a..2564a467bf1a4 100644 --- a/packages/@aws-cdk/example-construct-library/package.json +++ b/packages/@aws-cdk/example-construct-library/package.json @@ -77,7 +77,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -87,7 +87,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/lambda-layer-awscli/package.json b/packages/@aws-cdk/lambda-layer-awscli/package.json index 115f686f9e414..7dccd078a5238 100644 --- a/packages/@aws-cdk/lambda-layer-awscli/package.json +++ b/packages/@aws-cdk/lambda-layer-awscli/package.json @@ -1,6 +1,5 @@ { "name": "@aws-cdk/lambda-layer-awscli", - "private": false, "version": "0.0.0", "description": "An AWS Lambda layer that contains the AWS CLI", "main": "lib/index.js", @@ -73,13 +72,13 @@ "dependencies": { "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" @@ -103,5 +102,6 @@ }, "publishConfig": { "tag": "latest" - } + }, + "private": true } diff --git a/packages/@aws-cdk/lambda-layer-kubectl/package.json b/packages/@aws-cdk/lambda-layer-kubectl/package.json index 9ba2b10e89d47..2e01d7f9e58d6 100644 --- a/packages/@aws-cdk/lambda-layer-kubectl/package.json +++ b/packages/@aws-cdk/lambda-layer-kubectl/package.json @@ -1,6 +1,5 @@ { "name": "@aws-cdk/lambda-layer-kubectl", - "private": false, "version": "0.0.0", "description": "An AWS Lambda layer that contains the `kubectl` and `helm`", "main": "lib/index.js", @@ -79,13 +78,13 @@ "dependencies": { "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" @@ -109,5 +108,6 @@ }, "publishConfig": { "tag": "latest" - } + }, + "private": true } diff --git a/packages/@aws-cdk/pipelines/lib/actions/deploy-cdk-stack-action.ts b/packages/@aws-cdk/pipelines/lib/actions/deploy-cdk-stack-action.ts index 592b5b93e3855..1b96971c2e26f 100644 --- a/packages/@aws-cdk/pipelines/lib/actions/deploy-cdk-stack-action.ts +++ b/packages/@aws-cdk/pipelines/lib/actions/deploy-cdk-stack-action.ts @@ -10,10 +10,6 @@ import { Construct, Node } from 'constructs'; import { appOf, assemblyBuilderOf } from '../private/construct-internals'; import { toPosixPath } from '../private/fs'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Customization options for a DeployCdkStackAction */ @@ -167,7 +163,7 @@ export class DeployCdkStackAction implements codepipeline.IAction { // We need the path of the template relative to the root Cloud Assembly // It should be easier to get this, but for now it is what it is. - const appAsmRoot = assemblyBuilderOf(appOf(scope as CoreConstruct)).outdir; + const appAsmRoot = assemblyBuilderOf(appOf(scope)).outdir; const fullTemplatePath = path.join(artifact.assembly.directory, artifact.templateFile); let fullConfigPath; @@ -266,7 +262,7 @@ export class DeployCdkStackAction implements codepipeline.IAction { /** * Exists to implement IAction */ - public bind(scope: CoreConstruct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): + public bind(scope: Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig { stage.addAction(this.prepareChangeSetAction); diff --git a/packages/@aws-cdk/pipelines/lib/actions/publish-assets-action.ts b/packages/@aws-cdk/pipelines/lib/actions/publish-assets-action.ts index 10b1bccbab965..55848aec63433 100644 --- a/packages/@aws-cdk/pipelines/lib/actions/publish-assets-action.ts +++ b/packages/@aws-cdk/pipelines/lib/actions/publish-assets-action.ts @@ -6,10 +6,6 @@ import * as events from '@aws-cdk/aws-events'; import * as iam from '@aws-cdk/aws-iam'; import { Lazy } from '@aws-cdk/core'; import { Construct } from 'constructs'; - -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; import { toPosixPath } from '../private/fs'; /** @@ -93,7 +89,7 @@ export interface PublishAssetsActionProps { * You do not need to instantiate this action -- it will automatically * be added by the pipeline when you add stacks that use assets. */ -export class PublishAssetsAction extends CoreConstruct implements codepipeline.IAction { +export class PublishAssetsAction extends Construct implements codepipeline.IAction { private readonly action: codepipeline.IAction; private readonly commands = new Array(); @@ -160,7 +156,7 @@ export class PublishAssetsAction extends CoreConstruct implements codepipeline.I /** * Exists to implement IAction */ - public bind(scope: CoreConstruct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): + public bind(scope: Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig { return this.action.bind(scope, stage, options); } diff --git a/packages/@aws-cdk/pipelines/lib/actions/update-pipeline-action.ts b/packages/@aws-cdk/pipelines/lib/actions/update-pipeline-action.ts index 20dce58246c27..8cfa0888fde08 100644 --- a/packages/@aws-cdk/pipelines/lib/actions/update-pipeline-action.ts +++ b/packages/@aws-cdk/pipelines/lib/actions/update-pipeline-action.ts @@ -6,10 +6,6 @@ import * as iam from '@aws-cdk/aws-iam'; import { Construct } from 'constructs'; import { embeddedAsmPath } from '../private/construct-internals'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Props for the UpdatePipelineAction */ @@ -48,7 +44,7 @@ export interface UpdatePipelineActionProps { * You do not need to instantiate this action -- it will automatically * be added by the pipeline. */ -export class UpdatePipelineAction extends CoreConstruct implements codepipeline.IAction { +export class UpdatePipelineAction extends Construct implements codepipeline.IAction { private readonly action: codepipeline.IAction; constructor(scope: Construct, id: string, props: UpdatePipelineActionProps) { @@ -103,7 +99,7 @@ export class UpdatePipelineAction extends CoreConstruct implements codepipeline. /** * Exists to implement IAction */ - public bind(scope: CoreConstruct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): + public bind(scope: Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig { return this.action.bind(scope, stage, options); } diff --git a/packages/@aws-cdk/pipelines/lib/pipeline.ts b/packages/@aws-cdk/pipelines/lib/pipeline.ts index 20f751078646e..1b458b450a1e1 100644 --- a/packages/@aws-cdk/pipelines/lib/pipeline.ts +++ b/packages/@aws-cdk/pipelines/lib/pipeline.ts @@ -8,10 +8,6 @@ import { AssetType, DeployCdkStackAction, PublishAssetsAction, UpdatePipelineAct import { appOf, assemblyBuilderOf } from './private/construct-internals'; import { AddStageOptions, AssetPublishingCommand, CdkStage, StackOutput } from './stage'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Properties for a CdkPipeline */ @@ -133,7 +129,7 @@ export interface CdkPipelineProps { * - Keeping the pipeline up-to-date as the CDK apps change. * - Using stack outputs later on in the pipeline. */ -export class CdkPipeline extends CoreConstruct { +export class CdkPipeline extends Construct { private readonly _pipeline: codepipeline.Pipeline; private readonly _assets: AssetPublishing; private readonly _stages: CdkStage[] = []; @@ -212,6 +208,8 @@ export class CdkPipeline extends CoreConstruct { vpc: props.vpc, subnetSelection: props.subnetSelection, }); + + this.node.addValidation({ validate: () => this.validatePipeline() }); } /** @@ -298,7 +296,7 @@ export class CdkPipeline extends CoreConstruct { * Our own convenience methods will never generate a pipeline that does that (although * this is a nice verification), but a user can also add the stacks by hand. */ - protected validate(): string[] { + private validatePipeline(): string[] { const ret = new Array(); ret.push(...this.validateDeployOrder()); @@ -363,7 +361,7 @@ interface AssetPublishingProps { /** * Add appropriate publishing actions to the asset publishing stage */ -class AssetPublishing extends CoreConstruct { +class AssetPublishing extends Construct { // CodePipelines has a hard limit of 50 actions per stage. See https://github.com/aws/aws-cdk/issues/9353 private readonly MAX_PUBLISHERS_PER_STAGE = 50; diff --git a/packages/@aws-cdk/pipelines/lib/stage.ts b/packages/@aws-cdk/pipelines/lib/stage.ts index 863aa8869d8bd..f6f2038ad34a3 100644 --- a/packages/@aws-cdk/pipelines/lib/stage.ts +++ b/packages/@aws-cdk/pipelines/lib/stage.ts @@ -7,10 +7,6 @@ import { AssetType, DeployCdkStackAction } from './actions'; import { AssetManifestReader, DockerImageManifestEntry, FileManifestEntry } from './private/asset-manifest'; import { topologicalSort } from './private/toposort'; -// v2 - keep this import as a separate section to reduce merge conflict when forward merging with the v2 branch. -// eslint-disable-next-line -import { Construct as CoreConstruct } from '@aws-cdk/core'; - /** * Construction properties for a CdkStage */ @@ -42,7 +38,7 @@ export interface CdkStageProps { * You don't need to instantiate this class directly. Use * `cdkPipeline.addStage()` instead. */ -export class CdkStage extends CoreConstruct { +export class CdkStage extends Construct { private _nextSequentialRunOrder = 1; // Must start at 1 eh private _manualApprovalCounter = 1; private readonly pipelineStage: codepipeline.IStage; diff --git a/packages/@aws-cdk/pipelines/lib/synths/simple-synth-action.ts b/packages/@aws-cdk/pipelines/lib/synths/simple-synth-action.ts index 415f49f703e26..873745e1f1fc3 100644 --- a/packages/@aws-cdk/pipelines/lib/synths/simple-synth-action.ts +++ b/packages/@aws-cdk/pipelines/lib/synths/simple-synth-action.ts @@ -13,7 +13,7 @@ import { copyEnvironmentVariables, filterEmpty } from './_util'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Configuration options for a SimpleSynth @@ -505,4 +505,4 @@ function serializeBuildEnvironment(env: codebuild.BuildEnvironment) { imagePullPrincipalType: env.buildImage?.imagePullPrincipalType, secretsManagerArn: env.buildImage?.secretsManagerCredentials?.secretArn, }; -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/pipelines/lib/validation/_files.ts b/packages/@aws-cdk/pipelines/lib/validation/_files.ts index 2f2bbf7be35ea..fc54c1f69930b 100644 --- a/packages/@aws-cdk/pipelines/lib/validation/_files.ts +++ b/packages/@aws-cdk/pipelines/lib/validation/_files.ts @@ -1,7 +1,7 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; import { IGrantable } from '@aws-cdk/aws-iam'; import * as s3assets from '@aws-cdk/aws-s3-assets'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Additional files to use in a shell script diff --git a/packages/@aws-cdk/pipelines/lib/validation/shell-script-action.ts b/packages/@aws-cdk/pipelines/lib/validation/shell-script-action.ts index 59f64555a76b5..9b7e92ca9fd5d 100644 --- a/packages/@aws-cdk/pipelines/lib/validation/shell-script-action.ts +++ b/packages/@aws-cdk/pipelines/lib/validation/shell-script-action.ts @@ -4,12 +4,11 @@ import * as codepipeline_actions from '@aws-cdk/aws-codepipeline-actions'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as events from '@aws-cdk/aws-events'; import * as iam from '@aws-cdk/aws-iam'; - import { StackOutput } from '../stage'; // keep this import separate from other imports to reduce chance for merge conflicts with v2-main // eslint-disable-next-line no-duplicate-imports, import/order -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Properties for ShellScriptAction diff --git a/packages/@aws-cdk/pipelines/package.json b/packages/@aws-cdk/pipelines/package.json index 8717570fc8f1d..632a0526c118f 100644 --- a/packages/@aws-cdk/pipelines/package.json +++ b/packages/@aws-cdk/pipelines/package.json @@ -1,6 +1,7 @@ { "name": "@aws-cdk/pipelines", "version": "0.0.0", + "private": true, "description": "Continuous Delivery of CDK applications", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -40,7 +41,7 @@ "@aws-cdk/aws-ecr-assets": "0.0.0" }, "peerDependencies": { - "constructs": "^3.2.0", + "constructs": "10.0.0-pre.5", "@aws-cdk/core": "0.0.0", "@aws-cdk/aws-codebuild": "0.0.0", "@aws-cdk/aws-codepipeline": "0.0.0", @@ -53,7 +54,7 @@ "@aws-cdk/cx-api": "0.0.0" }, "dependencies": { - "constructs": "^3.2.0", + "constructs": "10.0.0-pre.5", "@aws-cdk/core": "0.0.0", "@aws-cdk/aws-codebuild": "0.0.0", "@aws-cdk/aws-codepipeline": "0.0.0", diff --git a/packages/@aws-cdk/region-info/package.json b/packages/@aws-cdk/region-info/package.json index fe5a7e1acf1ec..1eb79688b1110 100644 --- a/packages/@aws-cdk/region-info/package.json +++ b/packages/@aws-cdk/region-info/package.json @@ -85,6 +85,6 @@ "announce": false }, "publishConfig": { - "tag": "latest" + "tag": "next" } } diff --git a/packages/@aws-cdk/yaml-cfn/package.json b/packages/@aws-cdk/yaml-cfn/package.json index 7fc68d44a23af..0f95b636efdc0 100644 --- a/packages/@aws-cdk/yaml-cfn/package.json +++ b/packages/@aws-cdk/yaml-cfn/package.json @@ -88,6 +88,6 @@ "announce": false }, "publishConfig": { - "tag": "latest" + "tag": "next" } } diff --git a/packages/@monocdk-experiment/assert/package.json b/packages/@monocdk-experiment/assert/package.json index a0f33eba501ac..97104f7291034 100644 --- a/packages/@monocdk-experiment/assert/package.json +++ b/packages/@monocdk-experiment/assert/package.json @@ -1,6 +1,7 @@ { "name": "@monocdk-experiment/assert", "version": "0.0.0", + "private": true, "description": "An assertion library for use with CDK Apps", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -26,6 +27,9 @@ "disable": true } }, + "pkglint": { + "ignore": true + }, "author": { "name": "Amazon Web Services", "url": "https://aws.amazon.com", @@ -37,7 +41,7 @@ "@types/jest": "^26.0.21", "@types/node": "^10.17.55", "cdk-build-tools": "0.0.0", - "constructs": "^3.2.0", + "constructs": "10.0.0-pre.5", "jest": "^26.6.3", "monocdk": "0.0.0", "pkglint": "0.0.0", diff --git a/packages/@monocdk-experiment/rewrite-imports/package.json b/packages/@monocdk-experiment/rewrite-imports/package.json index 6c8a2788e1f53..52051941eddac 100644 --- a/packages/@monocdk-experiment/rewrite-imports/package.json +++ b/packages/@monocdk-experiment/rewrite-imports/package.json @@ -1,6 +1,7 @@ { "name": "@monocdk-experiment/rewrite-imports", "version": "0.0.0", + "private": true, "description": "Rewrites typescript 'import' statements from @aws-cdk/xxx to monocdk", "bin": { "rewrite-imports": "bin/rewrite-imports" diff --git a/packages/aws-cdk-lib/package.json b/packages/aws-cdk-lib/package.json index 3f4b9857b9231..1309adb7ae1c7 100644 --- a/packages/aws-cdk-lib/package.json +++ b/packages/aws-cdk-lib/package.json @@ -1,6 +1,5 @@ { "name": "aws-cdk-lib", - "private": "true", "version": "0.0.0", "description": "The AWS Cloud Development Kit library", "main": "lib/index.js", @@ -286,7 +285,7 @@ "@types/fs-extra": "^8.1.1", "@types/node": "^10.17.55", "cdk-build-tools": "0.0.0", - "constructs": "^3.2.0", + "constructs": "10.0.0-pre.5", "fs-extra": "^9.1.0", "pkglint": "0.0.0", "ts-node": "^9.1.1", @@ -294,7 +293,7 @@ "ubergen": "0.0.0" }, "peerDependencies": { - "constructs": "^3.2.0" + "constructs": "10.0.0-pre.5" }, "homepage": "https://github.com/aws/aws-cdk", "engines": { @@ -309,5 +308,8 @@ }, "ubergen": { "exclude": true + }, + "publishConfig": { + "tag": "latest" } } diff --git a/packages/aws-cdk/lib/init-templates/v2/app/csharp/src/%name.PascalCased%/%name.PascalCased%.template.csproj b/packages/aws-cdk/lib/init-templates/v2/app/csharp/src/%name.PascalCased%/%name.PascalCased%.template.csproj index 0ac3cc0a4c6cb..a839c9651027a 100644 --- a/packages/aws-cdk/lib/init-templates/v2/app/csharp/src/%name.PascalCased%/%name.PascalCased%.template.csproj +++ b/packages/aws-cdk/lib/init-templates/v2/app/csharp/src/%name.PascalCased%/%name.PascalCased%.template.csproj @@ -10,6 +10,7 @@ + + + +