From 3962d350be018327b157203a45e6b0c05566f8ea Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Wed, 8 Jul 2020 13:52:49 +0000 Subject: [PATCH 01/39] try to use aliases to reduce blast radius --- package.json | 3 +- packages/@aws-cdk/alexa-ask/package.json | 4 +- .../lib/pipeline-deploy-stack-action.ts | 3 +- packages/@aws-cdk/app-delivery/package.json | 4 +- .../test/test.pipeline-deploy-stack-action.ts | 3 +- packages/@aws-cdk/assert/lib/synth-utils.ts | 4 +- packages/@aws-cdk/assert/package.json | 4 +- .../@aws-cdk/assert/test/assertions.test.ts | 5 +- packages/@aws-cdk/assets/package.json | 4 +- packages/@aws-cdk/assets/test/test.staging.ts | 6 +- .../@aws-cdk/aws-accessanalyzer/package.json | 4 +- packages/@aws-cdk/aws-acmpca/package.json | 4 +- packages/@aws-cdk/aws-amazonmq/package.json | 4 +- packages/@aws-cdk/aws-amplify/lib/app.ts | 3 +- .../@aws-cdk/aws-amplify/lib/basic-auth.ts | 3 +- packages/@aws-cdk/aws-amplify/lib/branch.ts | 3 +- packages/@aws-cdk/aws-amplify/lib/domain.ts | 3 +- packages/@aws-cdk/aws-amplify/package.json | 4 +- .../aws-amplify/test/integ.app-codecommit.ts | 3 +- .../@aws-cdk/aws-amplify/test/integ.app.ts | 3 +- .../aws-apigateway/lib/api-definition.ts | 12 +- .../@aws-cdk/aws-apigateway/lib/api-key.ts | 3 +- .../aws-apigateway/lib/apigatewayv2.ts | 23 +- .../@aws-cdk/aws-apigateway/lib/authorizer.ts | 3 +- .../aws-apigateway/lib/authorizers/lambda.ts | 3 +- .../aws-apigateway/lib/base-path-mapping.ts | 3 +- .../@aws-cdk/aws-apigateway/lib/deployment.ts | 55 +- .../aws-apigateway/lib/domain-name.ts | 3 +- .../aws-apigateway/lib/gateway-response.ts | 3 +- .../aws-apigateway/lib/integrations/aws.ts | 3 +- .../@aws-cdk/aws-apigateway/lib/lambda-api.ts | 4 +- .../@aws-cdk/aws-apigateway/lib/method.ts | 3 +- packages/@aws-cdk/aws-apigateway/lib/model.ts | 3 +- .../lib/rate-limited-api-key.ts | 3 +- .../aws-apigateway/lib/requestvalidator.ts | 3 +- .../@aws-cdk/aws-apigateway/lib/resource.ts | 3 +- .../@aws-cdk/aws-apigateway/lib/restapi.ts | 3 +- packages/@aws-cdk/aws-apigateway/lib/stage.ts | 3 +- .../@aws-cdk/aws-apigateway/lib/usage-plan.ts | 3 +- .../@aws-cdk/aws-apigateway/lib/vpc-link.ts | 3 +- packages/@aws-cdk/aws-apigateway/package.json | 4 +- .../aws-apigateway/test/integ.cors.ts | 3 +- ...eg.lambda-api.latebound-deploymentstage.ts | 3 +- .../test/integ.restapi-import.lit.ts | 3 +- .../test/integ.restapi.multistack.ts | 5 +- .../@aws-cdk/aws-apigatewayv2/lib/http/api.ts | 3 +- .../aws-apigatewayv2/lib/http/integration.ts | 3 +- .../aws-apigatewayv2/lib/http/route.ts | 3 +- .../aws-apigatewayv2/lib/http/stage.ts | 3 +- .../@aws-cdk/aws-apigatewayv2/package.json | 4 +- packages/@aws-cdk/aws-appconfig/package.json | 4 +- .../lib/base-scalable-attribute.ts | 6 +- .../lib/scalable-target.ts | 3 +- .../lib/step-scaling-action.ts | 5 +- .../lib/step-scaling-policy.ts | 7 +- .../lib/target-tracking-scaling-policy.ts | 5 +- .../aws-applicationautoscaling/package.json | 4 +- .../aws-applicationautoscaling/test/util.ts | 4 +- packages/@aws-cdk/aws-appmesh/lib/mesh.ts | 7 +- packages/@aws-cdk/aws-appmesh/lib/route.ts | 9 +- .../@aws-cdk/aws-appmesh/lib/virtual-node.ts | 9 +- .../aws-appmesh/lib/virtual-router.ts | 11 +- .../aws-appmesh/lib/virtual-service.ts | 9 +- packages/@aws-cdk/aws-appmesh/package.json | 4 +- packages/@aws-cdk/aws-appstream/package.json | 4 +- .../@aws-cdk/aws-appsync/lib/graphqlapi.ts | 3 +- packages/@aws-cdk/aws-appsync/package.json | 4 +- packages/@aws-cdk/aws-athena/package.json | 4 +- .../aws-autoscaling-common/package.json | 4 +- .../lib/lambda-hook.ts | 2 +- .../lib/queue-hook.ts | 2 +- .../lib/topic-hook.ts | 2 +- .../aws-autoscaling-hooktargets/package.json | 4 +- .../aws-autoscaling/lib/auto-scaling-group.ts | 5 +- .../lib/lifecycle-hook-target.ts | 2 +- .../aws-autoscaling/lib/lifecycle-hook.ts | 3 +- .../aws-autoscaling/lib/scheduled-action.ts | 3 +- .../lib/step-scaling-action.ts | 5 +- .../lib/step-scaling-policy.ts | 7 +- .../lib/target-tracking-scaling-policy.ts | 5 +- .../@aws-cdk/aws-autoscaling/package.json | 4 +- .../test/test.auto-scaling-group.ts | 5 +- .../test/test.lifecyclehooks.ts | 3 +- .../aws-autoscaling/test/test.scaling.ts | 5 +- .../test/test.scheduled-action.ts | 3 +- .../aws-autoscalingplans/package.json | 4 +- .../lib/backupable-resources-collector.ts | 3 +- packages/@aws-cdk/aws-backup/lib/plan.ts | 3 +- packages/@aws-cdk/aws-backup/lib/resource.ts | 3 +- packages/@aws-cdk/aws-backup/lib/selection.ts | 6 +- packages/@aws-cdk/aws-backup/lib/vault.ts | 4 +- packages/@aws-cdk/aws-backup/package.json | 4 +- .../@aws-cdk/aws-backup/test/integ.backup.ts | 3 +- .../aws-backup/test/selection.test.ts | 3 +- .../aws-batch/lib/compute-environment.ts | 3 +- .../lib/job-definition-image-config.ts | 6 +- .../@aws-cdk/aws-batch/lib/job-definition.ts | 3 +- packages/@aws-cdk/aws-batch/lib/job-queue.ts | 3 +- packages/@aws-cdk/aws-batch/package.json | 4 +- packages/@aws-cdk/aws-budgets/package.json | 4 +- .../aws-certificatemanager/lib/certificate.ts | 3 +- .../lib/dns-validated-certificate.ts | 3 +- .../aws-certificatemanager/package.json | 4 +- .../test/example.dns-validated-request.lit.ts | 3 +- .../test/example.simple-request.lit.ts | 3 +- .../@aws-cdk/aws-cloud9/lib/environment.ts | 5 +- packages/@aws-cdk/aws-cloud9/package.json | 4 +- .../@aws-cdk/aws-cloud9/test/integ.cloud9.ts | 3 +- .../aws-cloudformation/lib/custom-resource.ts | 7 +- .../aws-cloudformation/lib/nested-stack.ts | 3 +- .../@aws-cdk/aws-cloudformation/package.json | 4 +- .../test/integ.core-custom-resources.ts | 3 +- .../test/integ.nested-stack.ts | 3 +- .../test/integ.nested-stacks-assets.ts | 3 +- .../test/integ.nested-stacks-multi.ts | 3 +- .../test/integ.nested-stacks-refs1.ts | 3 +- .../test/integ.nested-stacks-refs2.ts | 3 +- .../test/integ.nested-stacks-refs3.ts | 3 +- .../test/integ.trivial-lambda-resource.ts | 5 +- .../test/test.nested-stack.ts | 3 +- .../aws-cloudformation/test/test.resource.ts | 5 +- .../lib/origin_access_identity.ts | 7 +- .../aws-cloudfront/lib/web_distribution.ts | 5 +- packages/@aws-cdk/aws-cloudfront/package.json | 4 +- .../test/example.acm-cert-alias.lit.ts | 3 +- .../test/example.default-cert-alias.lit.ts | 3 +- .../test/example.iam-cert-alias.lit.ts | 3 +- .../test/integ.cloudfront-custom-s3.ts | 3 +- .../@aws-cdk/aws-cloudtrail/lib/cloudtrail.ts | 3 +- packages/@aws-cdk/aws-cloudtrail/package.json | 4 +- .../aws-cloudwatch-actions/lib/appscaling.ts | 4 +- .../aws-cloudwatch-actions/lib/autoscaling.ts | 4 +- .../aws-cloudwatch-actions/lib/sns.ts | 2 +- .../aws-cloudwatch-actions/package.json | 4 +- .../aws-cloudwatch/lib/alarm-action.ts | 2 +- packages/@aws-cdk/aws-cloudwatch/lib/alarm.ts | 3 +- .../aws-cloudwatch/lib/composite-alarm.ts | 3 +- .../@aws-cdk/aws-cloudwatch/lib/dashboard.ts | 3 +- .../@aws-cdk/aws-cloudwatch/lib/metric.ts | 7 +- packages/@aws-cdk/aws-cloudwatch/package.json | 4 +- .../aws-cloudwatch/test/test.alarm.ts | 3 +- .../@aws-cdk/aws-codebuild/lib/artifacts.ts | 2 +- .../aws-codebuild/lib/file-location.ts | 2 +- .../aws-codebuild/lib/pipeline-project.ts | 4 +- .../@aws-cdk/aws-codebuild/lib/project.ts | 3 +- .../aws-codebuild/lib/report-group-utils.ts | 3 +- .../aws-codebuild/lib/report-group.ts | 5 +- .../aws-codebuild/lib/source-credentials.ts | 3 +- packages/@aws-cdk/aws-codebuild/lib/source.ts | 2 +- packages/@aws-cdk/aws-codebuild/package.json | 4 +- .../@aws-cdk/aws-codecommit/lib/repository.ts | 3 +- packages/@aws-cdk/aws-codecommit/package.json | 4 +- .../aws-codedeploy/lib/ecs/application.ts | 3 +- .../lib/ecs/deployment-config.ts | 6 +- .../lib/ecs/deployment-group.ts | 8 +- .../aws-codedeploy/lib/lambda/application.ts | 3 +- .../lib/lambda/deployment-config.ts | 6 +- .../lib/lambda/deployment-group.ts | 8 +- .../aws-codedeploy/lib/server/application.ts | 3 +- .../lib/server/deployment-config.ts | 5 +- .../lib/server/deployment-group.ts | 9 +- packages/@aws-cdk/aws-codedeploy/package.json | 4 +- .../lib/profiling-group.ts | 3 +- .../aws-codeguruprofiler/package.json | 5 +- .../aws-codepipeline-actions/lib/action.ts | 3 +- .../lib/alexa-ask/deploy-action.ts | 3 +- .../lib/bitbucket/source-action.ts | 2 +- .../lib/cloudformation/pipeline-actions.ts | 17 +- .../lib/codebuild/build-action.ts | 3 +- .../lib/codecommit/source-action.ts | 2 +- .../lib/codedeploy/ecs-deploy-action.ts | 2 +- .../lib/codedeploy/server-deploy-action.ts | 2 +- .../lib/custom-action-registration.ts | 6 +- .../lib/ecr/source-action.ts | 2 +- .../lib/ecs/deploy-action.ts | 2 +- .../lib/github/source-action.ts | 3 +- .../lib/jenkins/jenkins-action.ts | 2 +- .../lib/jenkins/jenkins-provider.ts | 14 +- .../lib/lambda/invoke-action.ts | 3 +- .../lib/manual-approval-action.ts | 4 +- .../lib/s3/deploy-action.ts | 3 +- .../lib/s3/source-action.ts | 2 +- .../aws-codepipeline-actions/package.json | 4 +- .../cloudformation/test.pipeline-actions.ts | 15 +- .../test/test.pipeline.ts | 9 +- .../@aws-cdk/aws-codepipeline/lib/action.ts | 3 +- .../lib/cross-region-support-stack.ts | 7 +- .../@aws-cdk/aws-codepipeline/lib/pipeline.ts | 3 +- .../@aws-cdk/aws-codepipeline/lib/stage.ts | 7 +- .../@aws-cdk/aws-codepipeline/package.json | 4 +- .../test/fake-build-action.ts | 2 +- .../test/fake-source-action.ts | 3 +- .../aws-codepipeline/test/test.artifacts.ts | 6 +- .../test/test.general-validation.ts | 4 +- .../aws-codestar/lib/github-repository.ts | 3 +- packages/@aws-cdk/aws-codestar/package.json | 4 +- .../aws-codestarnotifications/package.json | 4 +- .../aws-cognito/lib/user-pool-client.ts | 3 +- .../aws-cognito/lib/user-pool-domain.ts | 3 +- .../@aws-cdk/aws-cognito/lib/user-pool-idp.ts | 3 +- .../aws-cognito/lib/user-pool-idps/amazon.ts | 2 +- .../aws-cognito/lib/user-pool-idps/base.ts | 3 +- .../lib/user-pool-idps/facebook.ts | 2 +- .../@aws-cdk/aws-cognito/lib/user-pool.ts | 3 +- packages/@aws-cdk/aws-cognito/package.json | 4 +- .../aws-cognito/test/user-pool.test.ts | 3 +- .../@aws-cdk/aws-config/lib/managed-rules.ts | 3 +- packages/@aws-cdk/aws-config/lib/rule.ts | 3 +- packages/@aws-cdk/aws-config/package.json | 4 +- .../@aws-cdk/aws-datapipeline/package.json | 4 +- packages/@aws-cdk/aws-dax/package.json | 4 +- .../aws-directoryservice/package.json | 4 +- packages/@aws-cdk/aws-dlm/package.json | 4 +- packages/@aws-cdk/aws-dms/package.json | 4 +- packages/@aws-cdk/aws-docdb/lib/cluster.ts | 3 +- .../@aws-cdk/aws-docdb/lib/database-secret.ts | 3 +- packages/@aws-cdk/aws-docdb/lib/instance.ts | 6 +- .../@aws-cdk/aws-docdb/lib/parameter-group.ts | 3 +- packages/@aws-cdk/aws-docdb/package.json | 4 +- .../@aws-cdk/aws-docdb/test/instance.test.ts | 4 +- .../@aws-cdk/aws-docdb/test/integ.cluster.ts | 3 +- .../lib/aws-dynamodb-global.ts | 5 +- .../lib/global-table-coordinator.ts | 3 +- .../@aws-cdk/aws-dynamodb-global/package.json | 4 +- .../aws-dynamodb/lib/replica-provider.ts | 3 +- packages/@aws-cdk/aws-dynamodb/lib/table.ts | 3 +- packages/@aws-cdk/aws-dynamodb/package.json | 4 +- .../aws-dynamodb/test/dynamodb.test.ts | 17 +- .../test/integ.dynamodb.ondemand.ts | 2 +- .../aws-dynamodb/test/integ.dynamodb.sse.ts | 2 +- .../aws-dynamodb/test/integ.dynamodb.ts | 2 +- .../aws-dynamodb/test/integ.global.ts | 3 +- packages/@aws-cdk/aws-ec2/lib/bastion-host.ts | 3 +- packages/@aws-cdk/aws-ec2/lib/instance.ts | 3 +- .../@aws-cdk/aws-ec2/lib/machine-image.ts | 3 +- packages/@aws-cdk/aws-ec2/lib/network-acl.ts | 3 +- .../@aws-cdk/aws-ec2/lib/security-group.ts | 3 +- packages/@aws-cdk/aws-ec2/lib/util.ts | 4 +- packages/@aws-cdk/aws-ec2/lib/volume.ts | 3 +- .../aws-ec2/lib/vpc-endpoint-service.ts | 3 +- packages/@aws-cdk/aws-ec2/lib/vpc-endpoint.ts | 3 +- .../@aws-cdk/aws-ec2/lib/vpc-flow-logs.ts | 3 +- packages/@aws-cdk/aws-ec2/lib/vpc.ts | 36 +- packages/@aws-cdk/aws-ec2/lib/vpn.ts | 7 +- packages/@aws-cdk/aws-ec2/package.json | 4 +- .../@aws-cdk/aws-ec2/rosetta/conns.ts-fixture | 3 +- .../aws-ec2/rosetta/default.ts-fixture | 4 +- .../aws-ec2/rosetta/with-vpc.ts-fixture | 3 +- .../@aws-cdk/aws-ec2/test/connections.test.ts | 8 +- .../aws-ec2/test/integ.share-vpcs.lit.ts | 5 +- .../aws-ec2/test/vpc.from-lookup.test.ts | 3 +- packages/@aws-cdk/aws-ec2/test/vpc.test.ts | 6 +- .../aws-ecr-assets/lib/image-asset.ts | 3 +- packages/@aws-cdk/aws-ecr-assets/package.json | 4 +- .../test/integ.nested-stacks-docker.ts | 3 +- packages/@aws-cdk/aws-ecr/lib/repository.ts | 3 +- packages/@aws-cdk/aws-ecr/package.json | 4 +- .../application-load-balanced-service-base.ts | 13 +- ...ion-multiple-target-groups-service-base.ts | 3 +- .../network-load-balanced-service-base.ts | 7 +- ...ork-multiple-target-groups-service-base.ts | 3 +- .../lib/base/queue-processing-service-base.ts | 3 +- .../lib/base/scheduled-task-base.ts | 3 +- .../application-load-balanced-ecs-service.ts | 2 +- ...tion-multiple-target-groups-ecs-service.ts | 2 +- .../ecs/network-load-balanced-ecs-service.ts | 2 +- ...work-multiple-target-groups-ecs-service.ts | 2 +- .../lib/ecs/queue-processing-ecs-service.ts | 2 +- .../lib/ecs/scheduled-ecs-task.ts | 2 +- ...plication-load-balanced-fargate-service.ts | 2 +- ...-multiple-target-groups-fargate-service.ts | 2 +- .../network-load-balanced-fargate-service.ts | 2 +- ...-multiple-target-groups-fargate-service.ts | 2 +- .../queue-processing-fargate-service.ts | 2 +- .../lib/fargate/scheduled-fargate-task.ts | 2 +- .../@aws-cdk/aws-ecs-patterns/package.json | 4 +- .../@aws-cdk/aws-ecs/lib/base/base-service.ts | 3 +- .../lib/base/from-service-attributes.ts | 3 +- .../aws-ecs/lib/base/scalable-task-count.ts | 2 +- .../aws-ecs/lib/base/task-definition.ts | 9 +- packages/@aws-cdk/aws-ecs/lib/cluster.ts | 3 +- .../aws-ecs/lib/container-definition.ts | 5 +- .../@aws-cdk/aws-ecs/lib/container-image.ts | 8 +- .../lib/drain-hook/instance-drain-hook.ts | 5 +- .../@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts | 9 +- .../aws-ecs/lib/ec2/ec2-task-definition.ts | 3 +- .../aws-ecs/lib/fargate/fargate-service.ts | 7 +- .../lib/fargate/fargate-task-definition.ts | 3 +- .../aws-ecs/lib/firelens-log-router.ts | 3 +- .../aws-ecs/lib/images/asset-image.ts | 4 +- packages/@aws-cdk/aws-ecs/lib/images/ecr.ts | 2 +- .../@aws-cdk/aws-ecs/lib/images/repository.ts | 3 +- .../@aws-cdk/aws-ecs/lib/linux-parameters.ts | 5 +- .../aws-ecs/lib/log-drivers/aws-log-driver.ts | 3 +- .../lib/log-drivers/firelens-log-driver.ts | 2 +- .../lib/log-drivers/fluentd-log-driver.ts | 3 +- .../lib/log-drivers/gelf-log-driver.ts | 3 +- .../lib/log-drivers/generic-log-driver.ts | 2 +- .../lib/log-drivers/journald-log-driver.ts | 2 +- .../lib/log-drivers/json-file-log-driver.ts | 2 +- .../aws-ecs/lib/log-drivers/log-driver.ts | 2 +- .../lib/log-drivers/splunk-log-driver.ts | 3 +- .../lib/log-drivers/syslog-log-driver.ts | 2 +- .../app-mesh-proxy-configuration.ts | 2 +- .../proxy-configuration.ts | 2 +- packages/@aws-cdk/aws-ecs/package.json | 4 +- packages/@aws-cdk/aws-efs/lib/access-point.ts | 3 +- .../@aws-cdk/aws-efs/lib/efs-file-system.ts | 3 +- packages/@aws-cdk/aws-efs/package.json | 4 +- .../@aws-cdk/aws-eks-legacy/lib/aws-auth.ts | 3 +- .../aws-eks-legacy/lib/cluster-resource.ts | 3 +- .../@aws-cdk/aws-eks-legacy/lib/cluster.ts | 5 +- .../@aws-cdk/aws-eks-legacy/lib/helm-chart.ts | 3 +- .../aws-eks-legacy/lib/k8s-resource.ts | 3 +- .../aws-eks-legacy/lib/kubectl-layer.ts | 3 +- packages/@aws-cdk/aws-eks-legacy/package.json | 4 +- .../aws-eks-legacy/test/integ.eks-helm.lit.ts | 3 +- .../test/integ.eks-kubectl.lit.ts | 3 +- .../aws-eks-legacy/test/integ.eks-spot.ts | 3 +- packages/@aws-cdk/aws-eks-legacy/test/util.ts | 3 +- packages/@aws-cdk/aws-eks/lib/aws-auth.ts | 3 +- .../aws-eks/lib/cluster-resource-provider.ts | 3 +- .../@aws-cdk/aws-eks/lib/cluster-resource.ts | 3 +- packages/@aws-cdk/aws-eks/lib/cluster.ts | 5 +- .../@aws-cdk/aws-eks/lib/fargate-cluster.ts | 2 +- .../@aws-cdk/aws-eks/lib/fargate-profile.ts | 3 +- packages/@aws-cdk/aws-eks/lib/helm-chart.ts | 3 +- packages/@aws-cdk/aws-eks/lib/k8s-patch.ts | 3 +- packages/@aws-cdk/aws-eks/lib/k8s-resource.ts | 3 +- .../@aws-cdk/aws-eks/lib/kubectl-layer.ts | 3 +- .../@aws-cdk/aws-eks/lib/kubectl-provider.ts | 3 +- .../@aws-cdk/aws-eks/lib/managed-nodegroup.ts | 3 +- .../@aws-cdk/aws-eks/lib/service-account.ts | 3 +- packages/@aws-cdk/aws-eks/package.json | 4 +- packages/@aws-cdk/aws-eks/test/util.ts | 3 +- .../@aws-cdk/aws-elasticache/package.json | 4 +- .../aws-elasticbeanstalk/package.json | 4 +- .../lib/load-balancer.ts | 3 +- .../aws-elasticloadbalancing/package.json | 4 +- .../package.json | 4 +- .../test/integ.cognito.lit.ts | 3 +- .../package.json | 4 +- .../test/integ.lambda-target.ts | 3 +- .../lib/alb/application-listener-action.ts | 3 +- .../alb/application-listener-certificate.ts | 6 +- .../lib/alb/application-listener-rule.ts | 5 +- .../lib/alb/application-listener.ts | 3 +- .../lib/alb/application-load-balancer.ts | 3 +- .../lib/alb/application-target-group.ts | 3 +- .../lib/nlb/network-listener-action.ts | 3 +- .../lib/nlb/network-listener.ts | 3 +- .../lib/nlb/network-load-balancer.ts | 3 +- .../lib/nlb/network-target-group.ts | 13 +- .../lib/shared/base-listener.ts | 3 +- .../lib/shared/base-load-balancer.ts | 3 +- .../lib/shared/base-target-group.ts | 15 +- .../lib/shared/imported.ts | 7 +- .../aws-elasticloadbalancingv2/package.json | 4 +- .../test/alb/test.listener.ts | 5 +- .../test/helpers.ts | 6 +- .../test/integ.alb.dualstack.ts | 5 +- .../test/nlb/test.listener.ts | 3 +- .../@aws-cdk/aws-elasticsearch/package.json | 4 +- packages/@aws-cdk/aws-emr/package.json | 4 +- .../@aws-cdk/aws-events-targets/lib/util.ts | 2 +- .../@aws-cdk/aws-events-targets/package.json | 4 +- .../integ.pipeline-event-target.ts | 3 +- .../test/codepipeline/pipeline.test.ts | 3 +- .../test/lambda/lambda.test.ts | 3 +- packages/@aws-cdk/aws-events/lib/event-bus.ts | 3 +- packages/@aws-cdk/aws-events/lib/rule.ts | 3 +- packages/@aws-cdk/aws-events/lib/target.ts | 2 +- packages/@aws-cdk/aws-events/package.json | 4 +- .../@aws-cdk/aws-events/test/test.rule.ts | 23 +- .../@aws-cdk/aws-eventschemas/package.json | 4 +- packages/@aws-cdk/aws-fms/package.json | 4 +- .../aws-fsx/lib/lustre-file-system.ts | 3 +- packages/@aws-cdk/aws-fsx/package.json | 4 +- packages/@aws-cdk/aws-gamelift/package.json | 4 +- .../aws-globalaccelerator/lib/accelerator.ts | 5 +- .../lib/endpoint-group.ts | 9 +- .../aws-globalaccelerator/lib/listener.ts | 5 +- .../aws-globalaccelerator/package.json | 4 +- .../test/integ.globalaccelerator.ts | 3 +- .../aws-globalaccelerator/test/util.ts | 3 +- packages/@aws-cdk/aws-glue/lib/database.ts | 3 +- packages/@aws-cdk/aws-glue/lib/table.ts | 3 +- packages/@aws-cdk/aws-glue/package.json | 4 +- packages/@aws-cdk/aws-greengrass/package.json | 4 +- packages/@aws-cdk/aws-guardduty/package.json | 4 +- packages/@aws-cdk/aws-iam/package.json | 4 +- packages/@aws-cdk/aws-inspector/package.json | 4 +- packages/@aws-cdk/aws-iot/package.json | 4 +- packages/@aws-cdk/aws-iot1click/package.json | 4 +- .../@aws-cdk/aws-iotanalytics/package.json | 4 +- packages/@aws-cdk/aws-iotevents/package.json | 4 +- .../@aws-cdk/aws-iotthingsgraph/package.json | 4 +- packages/@aws-cdk/aws-kinesis/lib/stream.ts | 3 +- packages/@aws-cdk/aws-kinesis/package.json | 4 +- .../aws-kinesisanalytics/package.json | 4 +- .../@aws-cdk/aws-kinesisfirehose/package.json | 4 +- packages/@aws-cdk/aws-kms/lib/alias.ts | 3 +- packages/@aws-cdk/aws-kms/lib/key.ts | 9 +- packages/@aws-cdk/aws-kms/package.json | 4 +- packages/@aws-cdk/aws-kms/test/test.alias.ts | 3 +- packages/@aws-cdk/aws-kms/test/test.key.ts | 8 +- .../@aws-cdk/aws-lakeformation/package.json | 4 +- .../lib/event-bridge.ts | 3 +- .../aws-lambda-destinations/lib/lambda.ts | 2 +- .../aws-lambda-destinations/lib/sns.ts | 2 +- .../aws-lambda-destinations/lib/sqs.ts | 2 +- .../aws-lambda-destinations/package.json | 4 +- .../test/integ.destinations.ts | 3 +- .../test/integ.lambda-chain.ts | 3 +- .../aws-lambda-event-sources/package.json | 4 +- .../test/test-function.ts | 4 +- .../aws-lambda-nodejs/lib/function.ts | 4 +- .../@aws-cdk/aws-lambda-nodejs/package.json | 4 +- .../test/integ.dependencies.ts | 3 +- .../aws-lambda-nodejs/test/integ.function.ts | 3 +- packages/@aws-cdk/aws-lambda/lib/alias.ts | 2 +- packages/@aws-cdk/aws-lambda/lib/code.ts | 11 +- .../@aws-cdk/aws-lambda/lib/destination.ts | 2 +- .../aws-lambda/lib/event-invoke-config.ts | 3 +- .../aws-lambda/lib/event-source-mapping.ts | 5 +- .../@aws-cdk/aws-lambda/lib/function-base.ts | 9 +- packages/@aws-cdk/aws-lambda/lib/function.ts | 33 +- .../@aws-cdk/aws-lambda/lib/lambda-version.ts | 3 +- packages/@aws-cdk/aws-lambda/lib/layers.ts | 3 +- .../@aws-cdk/aws-lambda/lib/log-retention.ts | 5 +- .../@aws-cdk/aws-lambda/lib/permission.ts | 2 +- .../aws-lambda/lib/singleton-lambda.ts | 11 +- packages/@aws-cdk/aws-lambda/lib/util.ts | 2 +- packages/@aws-cdk/aws-lambda/package.json | 4 +- .../aws-lambda/test/integ.bundling.ts | 3 +- .../@aws-cdk/aws-lambda/test/test.lambda.ts | 3 +- .../aws-logs-destinations/lib/kinesis.ts | 2 +- .../aws-logs-destinations/lib/lambda.ts | 2 +- .../aws-logs-destinations/package.json | 4 +- .../aws-logs/lib/cross-account-destination.ts | 5 +- packages/@aws-cdk/aws-logs/lib/log-group.ts | 3 +- packages/@aws-cdk/aws-logs/lib/log-stream.ts | 3 +- .../@aws-cdk/aws-logs/lib/metric-filter.ts | 3 +- .../aws-logs/lib/subscription-filter.ts | 3 +- packages/@aws-cdk/aws-logs/package.json | 4 +- .../aws-logs/test/test.subscriptionfilter.ts | 3 +- .../aws-managedblockchain/package.json | 4 +- .../@aws-cdk/aws-mediaconvert/package.json | 4 +- packages/@aws-cdk/aws-medialive/package.json | 4 +- packages/@aws-cdk/aws-mediastore/package.json | 4 +- packages/@aws-cdk/aws-msk/package.json | 4 +- packages/@aws-cdk/aws-neptune/package.json | 4 +- packages/@aws-cdk/aws-opsworks/package.json | 4 +- packages/@aws-cdk/aws-opsworkscm/package.json | 4 +- packages/@aws-cdk/aws-pinpoint/package.json | 4 +- .../@aws-cdk/aws-pinpointemail/package.json | 4 +- packages/@aws-cdk/aws-qldb/package.json | 4 +- packages/@aws-cdk/aws-ram/package.json | 4 +- packages/@aws-cdk/aws-rds/lib/cluster.ts | 3 +- .../@aws-cdk/aws-rds/lib/database-secret.ts | 3 +- packages/@aws-cdk/aws-rds/lib/instance.ts | 3 +- packages/@aws-cdk/aws-rds/lib/option-group.ts | 3 +- .../@aws-cdk/aws-rds/lib/parameter-group.ts | 3 +- packages/@aws-cdk/aws-rds/lib/proxy.ts | 5 +- packages/@aws-cdk/aws-rds/package.json | 4 +- packages/@aws-cdk/aws-redshift/lib/cluster.ts | 3 +- .../aws-redshift/lib/database-secret.ts | 2 +- .../aws-redshift/lib/parameter-group.ts | 3 +- packages/@aws-cdk/aws-redshift/package.json | 4 +- packages/@aws-cdk/aws-robomaker/package.json | 4 +- .../lib/website-redirect.ts | 3 +- .../aws-route53-patterns/package.json | 4 +- .../@aws-cdk/aws-route53-targets/package.json | 4 +- .../test/integ.api-gateway-domain-name.ts | 3 +- .../@aws-cdk/aws-route53/lib/hosted-zone.ts | 3 +- .../@aws-cdk/aws-route53/lib/record-set.ts | 3 +- packages/@aws-cdk/aws-route53/lib/util.ts | 3 +- packages/@aws-cdk/aws-route53/package.json | 4 +- .../@aws-cdk/aws-route53resolver/package.json | 4 +- packages/@aws-cdk/aws-s3-assets/lib/asset.ts | 5 +- packages/@aws-cdk/aws-s3-assets/package.json | 4 +- .../test/integ.assets.bundling.lit.ts | 3 +- .../lib/bucket-deployment.ts | 5 +- .../@aws-cdk/aws-s3-deployment/lib/source.ts | 8 +- .../@aws-cdk/aws-s3-deployment/package.json | 4 +- .../aws-s3-notifications/lib/lambda.ts | 3 +- .../@aws-cdk/aws-s3-notifications/lib/sns.ts | 2 +- .../@aws-cdk/aws-s3-notifications/lib/sqs.ts | 2 +- .../aws-s3-notifications/package.json | 4 +- .../test/lambda/lambda.test.ts | 3 +- .../test/notifications.test.ts | 4 +- packages/@aws-cdk/aws-s3/lib/bucket-policy.ts | 3 +- packages/@aws-cdk/aws-s3/lib/bucket.ts | 5 +- packages/@aws-cdk/aws-s3/lib/destination.ts | 6 +- .../notifications-resource-handler.ts | 7 +- .../notifications-resource.ts | 5 +- packages/@aws-cdk/aws-s3/lib/util.ts | 5 +- packages/@aws-cdk/aws-s3/package.json | 4 +- packages/@aws-cdk/aws-s3/test/test.aspect.ts | 7 +- packages/@aws-cdk/aws-sagemaker/package.json | 4 +- packages/@aws-cdk/aws-sam/package.json | 4 +- packages/@aws-cdk/aws-sdb/package.json | 4 +- .../@aws-cdk/aws-secretsmanager/lib/policy.ts | 3 +- .../lib/rotation-schedule.ts | 3 +- .../aws-secretsmanager/lib/secret-rotation.ts | 3 +- .../@aws-cdk/aws-secretsmanager/lib/secret.ts | 3 +- .../@aws-cdk/aws-secretsmanager/package.json | 4 +- .../@aws-cdk/aws-securityhub/package.json | 4 +- .../@aws-cdk/aws-servicecatalog/package.json | 4 +- .../lib/alias-target-instance.ts | 4 +- .../lib/cname-instance.ts | 4 +- .../lib/http-namespace.ts | 3 +- .../aws-servicediscovery/lib/ip-instance.ts | 4 +- .../lib/non-ip-instance.ts | 4 +- .../lib/private-dns-namespace.ts | 3 +- .../lib/public-dns-namespace.ts | 3 +- .../aws-servicediscovery/lib/service.ts | 3 +- .../aws-servicediscovery/package.json | 4 +- .../@aws-cdk/aws-ses-actions/package.json | 4 +- .../@aws-cdk/aws-ses/lib/receipt-filter.ts | 3 +- .../@aws-cdk/aws-ses/lib/receipt-rule-set.ts | 3 +- packages/@aws-cdk/aws-ses/lib/receipt-rule.ts | 3 +- packages/@aws-cdk/aws-ses/package.json | 4 +- .../aws-sns-subscriptions/lib/lambda.ts | 5 +- .../@aws-cdk/aws-sns-subscriptions/lib/sqs.ts | 5 +- .../aws-sns-subscriptions/package.json | 4 +- packages/@aws-cdk/aws-sns/lib/policy.ts | 3 +- packages/@aws-cdk/aws-sns/lib/subscriber.ts | 2 +- packages/@aws-cdk/aws-sns/lib/subscription.ts | 3 +- packages/@aws-cdk/aws-sns/lib/topic-base.ts | 3 +- packages/@aws-cdk/aws-sns/lib/topic.ts | 3 +- packages/@aws-cdk/aws-sns/package.json | 4 +- packages/@aws-cdk/aws-sqs/lib/policy.ts | 3 +- packages/@aws-cdk/aws-sqs/lib/queue.ts | 3 +- packages/@aws-cdk/aws-sqs/package.json | 4 +- packages/@aws-cdk/aws-ssm/lib/parameter.ts | 3 +- packages/@aws-cdk/aws-ssm/lib/util.ts | 3 +- packages/@aws-cdk/aws-ssm/package.json | 4 +- .../lib/batch/submit-job.ts | 3 +- .../lib/dynamodb/delete-item.ts | 3 +- .../lib/dynamodb/get-item.ts | 3 +- .../lib/dynamodb/put-item.ts | 3 +- .../lib/dynamodb/update-item.ts | 3 +- .../lib/ecs/run-task.ts | 3 +- .../lib/emr/emr-add-step.ts | 3 +- .../lib/emr/emr-cancel-step.ts | 3 +- .../lib/emr/emr-create-cluster.ts | 3 +- .../emr/emr-modify-instance-fleet-by-name.ts | 3 +- .../emr/emr-modify-instance-group-by-name.ts | 3 +- .../emr-set-cluster-termination-protection.ts | 3 +- .../lib/emr/emr-terminate-cluster.ts | 3 +- .../lib/evaluate-expression.ts | 6 +- .../lib/glue/start-job-run.ts | 3 +- .../lib/lambda/invoke.ts | 4 +- .../lib/sagemaker/base-types.ts | 3 +- .../lib/sagemaker/create-training-job.ts | 3 +- .../lib/sagemaker/create-transform-job.ts | 3 +- .../lib/sns/publish.ts | 4 +- .../lib/sqs/send-message.ts | 3 +- .../lib/stepfunctions/start-execution.ts | 3 +- .../aws-stepfunctions-tasks/package.json | 4 +- .../test/integ.start-execution.ts | 3 +- .../stepfunctions/integ.start-execution.ts | 3 +- .../aws-stepfunctions/lib/activity.ts | 3 +- .../lib/state-machine-fragment.ts | 4 +- .../aws-stepfunctions/lib/state-machine.ts | 3 +- .../aws-stepfunctions/lib/states/choice.ts | 4 +- .../lib/states/custom-state.ts | 4 +- .../aws-stepfunctions/lib/states/fail.ts | 4 +- .../aws-stepfunctions/lib/states/map.ts | 4 +- .../aws-stepfunctions/lib/states/parallel.ts | 4 +- .../aws-stepfunctions/lib/states/pass.ts | 10 +- .../aws-stepfunctions/lib/states/state.ts | 8 +- .../aws-stepfunctions/lib/states/succeed.ts | 4 +- .../aws-stepfunctions/lib/states/task-base.ts | 6 +- .../aws-stepfunctions/lib/states/task.ts | 3 +- .../aws-stepfunctions/lib/states/wait.ts | 3 +- .../@aws-cdk/aws-stepfunctions/package.json | 4 +- .../test/states-language.test.ts | 9 +- .../aws-stepfunctions/test/task-base.test.ts | 3 +- packages/@aws-cdk/aws-transfer/package.json | 4 +- packages/@aws-cdk/aws-waf/package.json | 4 +- .../@aws-cdk/aws-wafregional/package.json | 4 +- packages/@aws-cdk/aws-wafv2/package.json | 4 +- packages/@aws-cdk/aws-workspaces/package.json | 4 +- .../cloudformation-include/lib/cfn-include.ts | 7 +- .../cloudformation-include/package.json | 3 +- .../test/invalid-templates.test.ts | 3 +- .../test/valid-templates.test.ts | 3 +- .../test/yaml-templates.test.ts | 3 +- packages/@aws-cdk/core/README.md | 3 +- packages/@aws-cdk/core/lib/app.ts | 14 + packages/@aws-cdk/core/lib/aspect.ts | 49 +- packages/@aws-cdk/core/lib/asset-staging.ts | 14 +- packages/@aws-cdk/core/lib/cfn-condition.ts | 2 +- packages/@aws-cdk/core/lib/cfn-element.ts | 10 +- packages/@aws-cdk/core/lib/cfn-include.ts | 2 +- packages/@aws-cdk/core/lib/cfn-json.ts | 2 +- packages/@aws-cdk/core/lib/cfn-mapping.ts | 2 +- packages/@aws-cdk/core/lib/cfn-output.ts | 2 +- packages/@aws-cdk/core/lib/cfn-parameter.ts | 2 +- packages/@aws-cdk/core/lib/cfn-pseudo.ts | 2 +- packages/@aws-cdk/core/lib/cfn-resource.ts | 2 +- packages/@aws-cdk/core/lib/cfn-rule.ts | 2 +- .../@aws-cdk/core/lib/construct-compat.ts | 532 +----------------- .../@aws-cdk/core/lib/context-provider.ts | 2 +- .../custom-resource-provider.ts | 2 +- packages/@aws-cdk/core/lib/custom-resource.ts | 2 +- packages/@aws-cdk/core/lib/dependency.ts | 98 ---- packages/@aws-cdk/core/lib/index.ts | 4 +- packages/@aws-cdk/core/lib/nested-stack.ts | 2 +- .../core/lib/private/asset-parameters.ts | 2 +- .../core/lib/private/cfn-reference.ts | 2 +- .../core/lib/private/cfn-utils-provider.ts | 2 +- .../@aws-cdk/core/lib/private/prepare-app.ts | 38 +- packages/@aws-cdk/core/lib/private/refs.ts | 2 +- packages/@aws-cdk/core/lib/private/resolve.ts | 2 +- .../@aws-cdk/core/lib/private/synthesis.ts | 105 ++-- .../core/lib/private/tree-metadata.ts | 9 +- packages/@aws-cdk/core/lib/reference.ts | 2 +- packages/@aws-cdk/core/lib/resolvable.ts | 2 +- packages/@aws-cdk/core/lib/resource.ts | 2 +- packages/@aws-cdk/core/lib/runtime.ts | 2 +- .../core/lib/stack-synthesizers/_shared.ts | 5 +- .../bootstrapless-synthesizer.ts | 2 +- .../stack-synthesizers/default-synthesizer.ts | 3 +- .../core/lib/stack-synthesizers/legacy.ts | 4 +- .../core/lib/stack-synthesizers/nested.ts | 3 +- .../core/lib/stack-synthesizers/types.ts | 17 +- packages/@aws-cdk/core/lib/stack.ts | 83 +-- packages/@aws-cdk/core/lib/stage.ts | 9 +- packages/@aws-cdk/core/lib/synthesis.ts | 39 ++ packages/@aws-cdk/core/lib/tag-aspect.ts | 8 +- packages/@aws-cdk/core/lib/token.ts | 2 +- packages/@aws-cdk/core/lib/util.ts | 2 +- packages/@aws-cdk/core/package.json | 4 +- .../test.custom-resource-provider.ts | 11 +- .../core/test/private/test.tree-metadata.ts | 3 +- packages/@aws-cdk/core/test/test.app.ts | 3 +- packages/@aws-cdk/core/test/test.aspect.ts | 46 +- packages/@aws-cdk/core/test/test.cfn-json.ts | 3 +- packages/@aws-cdk/core/test/test.construct.ts | 68 +-- packages/@aws-cdk/core/test/test.context.ts | 9 +- .../core/test/test.cross-environment-token.ts | 3 +- .../@aws-cdk/core/test/test.logical-id.ts | 3 +- packages/@aws-cdk/core/test/test.parameter.ts | 3 +- packages/@aws-cdk/core/test/test.resource.ts | 10 +- packages/@aws-cdk/core/test/test.stack.ts | 13 +- packages/@aws-cdk/core/test/test.stage.ts | 29 +- packages/@aws-cdk/core/test/test.staging.ts | 6 +- packages/@aws-cdk/core/test/test.synthesis.ts | 103 ---- .../@aws-cdk/core/test/test.tag-aspect.ts | 59 +- packages/@aws-cdk/core/test/test.util.ts | 3 +- packages/@aws-cdk/core/test/util.ts | 5 +- .../aws-custom-resource.ts | 5 +- .../lib/provider-framework/provider.ts | 3 +- .../waiter-state-machine.ts | 3 +- .../@aws-cdk/custom-resources/package.json | 4 +- .../test/provider-framework/integ.provider.ts | 3 +- .../integration-test-fixtures/s3-assert.ts | 3 +- .../integration-test-fixtures/s3-file.ts | 3 +- .../lib/example-resource.ts | 5 +- .../example-construct-library/package.json | 4 +- .../@monocdk-experiment/assert/package.json | 4 +- .../typescript/lib/%name%-stack.template.ts | 3 +- .../lib/typescript/lib/index.template.ts | 5 +- packages/awslint/lib/rules/construct.ts | 2 +- packages/awslint/lib/rules/core-types.ts | 7 +- packages/cdk-dasm/README.md | 3 +- packages/cdk-dasm/lib/dasm.ts | 5 +- .../test/__snapshots__/dasm.test.js.snap | 12 +- packages/decdk/lib/cdk-schema.ts | 2 +- packages/decdk/lib/jsii2schema.ts | 8 +- packages/decdk/package.json | 2 +- packages/monocdk-experiment/package.json | 4 +- scripts/build-typescript.sh | 4 + tools/cfn2ts/lib/codegen.ts | 6 +- tools/cfn2ts/lib/genspec.ts | 1 + tools/pkglint/lib/rules.ts | 2 +- yarn.lock | 137 ++++- 680 files changed, 2061 insertions(+), 2094 deletions(-) delete mode 100644 packages/@aws-cdk/core/lib/dependency.ts create mode 100644 packages/@aws-cdk/core/lib/synthesis.ts diff --git a/package.json b/package.json index 6442b77109e93..d6c31a3a11191 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "pack": "./pack.sh", "compat": "./scripts/check-api-compatibility.sh", "bump": "./bump.sh", - "build-all": "tsc -b" + "watch-all": "./scripts/build-typescript.sh -w", + "build-all": "./scripts/build-typescript.sh" }, "devDependencies": { "conventional-changelog-cli": "^2.0.34", diff --git a/packages/@aws-cdk/alexa-ask/package.json b/packages/@aws-cdk/alexa-ask/package.json index b941255e02954..0780dc4abc2f3 100644 --- a/packages/@aws-cdk/alexa-ask/package.json +++ b/packages/@aws-cdk/alexa-ask/package.json @@ -71,11 +71,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 03685cfc9c413..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,6 +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'; +import { Construct } from 'constructs'; export interface PipelineDeployStackActionProps { /** @@ -147,7 +148,7 @@ export class PipelineDeployStackAction implements codepipeline.IAction { }); } - public bind(scope: cdk.Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): + public bind(scope: Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig { if (this.stack.environment !== cdk.Stack.of(scope).environment) { // FIXME: Add the necessary to extend to stacks in a different account diff --git a/packages/@aws-cdk/app-delivery/package.json b/packages/@aws-cdk/app-delivery/package.json index d1f6bedf06839..921d5a3baa485 100644 --- a/packages/@aws-cdk/app-delivery/package.json +++ b/packages/@aws-cdk/app-delivery/package.json @@ -49,7 +49,7 @@ "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "devDependencies": { "@aws-cdk/assert": "0.0.0", @@ -87,7 +87,7 @@ "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/app-delivery/test/test.pipeline-deploy-stack-action.ts b/packages/@aws-cdk/app-delivery/test/test.pipeline-deploy-stack-action.ts index 918279b480b30..53a627506f83d 100644 --- a/packages/@aws-cdk/app-delivery/test/test.pipeline-deploy-stack-action.ts +++ b/packages/@aws-cdk/app-delivery/test/test.pipeline-deploy-stack-action.ts @@ -8,6 +8,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as s3 from '@aws-cdk/aws-s3'; import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as fc from 'fast-check'; import * as nodeunit from 'nodeunit'; import { PipelineDeployStackAction } from '../lib/pipeline-deploy-stack-action'; @@ -459,7 +460,7 @@ class FakeAction implements codepipeline.IAction { this.outputArtifact = new codepipeline.Artifact('OutputArtifact'); } - public bind(_scope: cdk.Construct, _stage: codepipeline.IStage, _options: codepipeline.ActionBindOptions): + public bind(_scope: Construct, _stage: codepipeline.IStage, _options: codepipeline.ActionBindOptions): codepipeline.ActionConfig { return {}; } diff --git a/packages/@aws-cdk/assert/lib/synth-utils.ts b/packages/@aws-cdk/assert/lib/synth-utils.ts index 57d21926919b1..19951e61ee1c9 100644 --- a/packages/@aws-cdk/assert/lib/synth-utils.ts +++ b/packages/@aws-cdk/assert/lib/synth-utils.ts @@ -9,7 +9,7 @@ export class SynthUtils { const root = stack.node.root; // if the root is an app, invoke "synth" to avoid double synthesis - const assembly = root instanceof core.App ? root.synth() : core.ConstructNode.synth(root.node, options); + const assembly = core.Synthesis.synthesize(root, options); return assembly.getStackArtifact(stack.artifactId); } @@ -54,7 +54,7 @@ export class SynthUtils { const root = stack.node.root; // if the root is an app, invoke "synth" to avoid double synthesis - const assembly = root instanceof core.App ? root.synth() : core.ConstructNode.synth(root.node, options); + const assembly = root instanceof core.App ? root.synth() : core.Synthesis.synthesize(root, options); // if this is a nested stack (it has a parent), then just read the template as a string if (stack.nestedStackParent) { diff --git a/packages/@aws-cdk/assert/package.json b/packages/@aws-cdk/assert/package.json index 8eefc0da1c185..41d9dba86351b 100644 --- a/packages/@aws-cdk/assert/package.json +++ b/packages/@aws-cdk/assert/package.json @@ -32,12 +32,12 @@ "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", "jest": "^25.5.4", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "repository": { "url": "https://github.com/aws/aws-cdk.git", diff --git a/packages/@aws-cdk/assert/test/assertions.test.ts b/packages/@aws-cdk/assert/test/assertions.test.ts index adf61cb0dec9a..4464ee67af8bd 100644 --- a/packages/@aws-cdk/assert/test/assertions.test.ts +++ b/packages/@aws-cdk/assert/test/assertions.test.ts @@ -1,6 +1,7 @@ import * as cdk from '@aws-cdk/core'; import * as cx from '@aws-cdk/cx-api'; +import { Construct } from 'constructs'; import { countResources, countResourcesLike, exist, expect as cdkExpect, haveType, MatchStyle, matchTemplate } from '../lib/index'; passingExample('expect at to have ', () => { @@ -332,7 +333,7 @@ interface TestResourceProps extends cdk.CfnResourceProps { } class TestResource extends cdk.CfnResource { - constructor(scope: cdk.Construct, id: string, props: TestResourceProps) { + constructor(scope: Construct, id: string, props: TestResourceProps) { super(scope, id, props); } } @@ -342,7 +343,7 @@ interface TestParameterProps extends cdk.CfnParameterProps { } class TestParameter extends cdk.CfnParameter { - constructor(scope: cdk.Construct, id: string, props: TestParameterProps) { + constructor(scope: Construct, id: string, props: TestParameterProps) { super(scope, id, props); } } diff --git a/packages/@aws-cdk/assets/package.json b/packages/@aws-cdk/assets/package.json index 92cae774b8353..b6168378f99e7 100644 --- a/packages/@aws-cdk/assets/package.json +++ b/packages/@aws-cdk/assets/package.json @@ -77,13 +77,13 @@ "dependencies": { "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/assets/test/test.staging.ts b/packages/@aws-cdk/assets/test/test.staging.ts index a6841284e8731..dd3f06a092fc4 100644 --- a/packages/@aws-cdk/assets/test/test.staging.ts +++ b/packages/@aws-cdk/assets/test/test.staging.ts @@ -8,7 +8,8 @@ import { Staging } from '../lib'; export = { 'base case'(test: Test) { // GIVEN - const stack = new Stack(); + const app = new App(); + const stack = new Stack(app, 'test'); const sourcePath = path.join(__dirname, 'fs', 'fixtures', 'test1'); // WHEN @@ -22,7 +23,8 @@ export = { 'staging can be disabled through context'(test: Test) { // GIVEN - const stack = new Stack(); + const app = new App(); + const stack = new Stack(app, 'test'); stack.node.setContext(cxapi.DISABLE_ASSET_STAGING_CONTEXT, true); const sourcePath = path.join(__dirname, 'fs', 'fixtures', 'test1'); diff --git a/packages/@aws-cdk/aws-accessanalyzer/package.json b/packages/@aws-cdk/aws-accessanalyzer/package.json index b513d3b0954a6..58eeffa453713 100644 --- a/packages/@aws-cdk/aws-accessanalyzer/package.json +++ b/packages/@aws-cdk/aws-accessanalyzer/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 9a38379aa34c3..d1117277f1ccc 100644 --- a/packages/@aws-cdk/aws-acmpca/package.json +++ b/packages/@aws-cdk/aws-acmpca/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 4b1b93d7d268a..1ed841f3d83d5 100644 --- a/packages/@aws-cdk/aws-amazonmq/package.json +++ b/packages/@aws-cdk/aws-amazonmq/package.json @@ -71,11 +71,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-amplify/lib/app.ts b/packages/@aws-cdk/aws-amplify/lib/app.ts index 640c9684625df..b591f844fdc2d 100644 --- a/packages/@aws-cdk/aws-amplify/lib/app.ts +++ b/packages/@aws-cdk/aws-amplify/lib/app.ts @@ -1,6 +1,7 @@ import * as codebuild from '@aws-cdk/aws-codebuild'; import * as iam from '@aws-cdk/aws-iam'; -import { Construct, IResource, Lazy, Resource, SecretValue } from '@aws-cdk/core'; +import { IResource, Lazy, Resource, SecretValue } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnApp } from './amplify.generated'; import { BasicAuth } from './basic-auth'; import { Branch, BranchOptions } from './branch'; diff --git a/packages/@aws-cdk/aws-amplify/lib/basic-auth.ts b/packages/@aws-cdk/aws-amplify/lib/basic-auth.ts index 0197c3f7d1f0d..afbe6dd2072fe 100644 --- a/packages/@aws-cdk/aws-amplify/lib/basic-auth.ts +++ b/packages/@aws-cdk/aws-amplify/lib/basic-auth.ts @@ -1,6 +1,7 @@ import * as kms from '@aws-cdk/aws-kms'; import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; -import { Construct, SecretValue } from '@aws-cdk/core'; +import { SecretValue } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Properties for a BasicAuth diff --git a/packages/@aws-cdk/aws-amplify/lib/branch.ts b/packages/@aws-cdk/aws-amplify/lib/branch.ts index 9739de909697c..31434b929e391 100644 --- a/packages/@aws-cdk/aws-amplify/lib/branch.ts +++ b/packages/@aws-cdk/aws-amplify/lib/branch.ts @@ -1,5 +1,6 @@ import * as codebuild from '@aws-cdk/aws-codebuild'; -import { Construct, IResource, Lazy, Resource } from '@aws-cdk/core'; +import { IResource, Lazy, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnBranch } from './amplify.generated'; import { IApp } from './app'; import { BasicAuth } from './basic-auth'; diff --git a/packages/@aws-cdk/aws-amplify/lib/domain.ts b/packages/@aws-cdk/aws-amplify/lib/domain.ts index ddb5b6b6f04e8..9a073881312f8 100644 --- a/packages/@aws-cdk/aws-amplify/lib/domain.ts +++ b/packages/@aws-cdk/aws-amplify/lib/domain.ts @@ -1,4 +1,5 @@ -import { Construct, Lazy, Resource } from '@aws-cdk/core'; +import { Lazy, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnDomain } from './amplify.generated'; import { IApp } from './app'; import { IBranch } from './branch'; diff --git a/packages/@aws-cdk/aws-amplify/package.json b/packages/@aws-cdk/aws-amplify/package.json index db112e8886c5a..8fd2db8cc1e31 100644 --- a/packages/@aws-cdk/aws-amplify/package.json +++ b/packages/@aws-cdk/aws-amplify/package.json @@ -78,7 +78,7 @@ "@aws-cdk/aws-codecommit": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/aws-iam": "0.0.0", @@ -87,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.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-amplify/test/integ.app-codecommit.ts b/packages/@aws-cdk/aws-amplify/test/integ.app-codecommit.ts index 9274cb4b734ef..dce7f81b21e8d 100644 --- a/packages/@aws-cdk/aws-amplify/test/integ.app-codecommit.ts +++ b/packages/@aws-cdk/aws-amplify/test/integ.app-codecommit.ts @@ -1,5 +1,6 @@ import * as codecommit from '@aws-cdk/aws-codecommit'; -import { App, Construct, Stack, StackProps } from '@aws-cdk/core'; +import { App, Stack, StackProps } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as amplify from '../lib'; class TestStack extends Stack { diff --git a/packages/@aws-cdk/aws-amplify/test/integ.app.ts b/packages/@aws-cdk/aws-amplify/test/integ.app.ts index 867aa1fb6638a..83ff527a292e2 100644 --- a/packages/@aws-cdk/aws-amplify/test/integ.app.ts +++ b/packages/@aws-cdk/aws-amplify/test/integ.app.ts @@ -1,4 +1,5 @@ -import { App, Construct, Stack, StackProps } from '@aws-cdk/core'; +import { App, Stack, StackProps } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as amplify from '../lib'; class TestStack extends Stack { diff --git a/packages/@aws-cdk/aws-apigateway/lib/api-definition.ts b/packages/@aws-cdk/aws-apigateway/lib/api-definition.ts index 652c531de9c38..c057b54895933 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/api-definition.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/api-definition.ts @@ -1,6 +1,6 @@ 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'; +import { Construct } from 'constructs'; /** * Represents an OpenAPI definition asset. @@ -80,7 +80,7 @@ export abstract class ApiDefinition { * @param scope The binding scope. Don't be smart about trying to down-cast or * assume it's initialized. You may just use it as a construct scope. */ - public abstract bind(scope: cdk.Construct): ApiDefinitionConfig; + public abstract bind(scope: Construct): ApiDefinitionConfig; } /** @@ -100,7 +100,7 @@ export interface ApiDefinitionS3Location { } /** - * Post-Binding Configuration for a CDK construct + * Post-Binding Configuration for constructs * @experimental */ export interface ApiDefinitionConfig { @@ -136,7 +136,7 @@ export class S3ApiDefinition extends ApiDefinition { this.bucketName = bucket.bucketName; } - public bind(_scope: cdk.Construct): ApiDefinitionConfig { + public bind(_scope: Construct): ApiDefinitionConfig { return { s3Location: { bucket: this.bucketName, @@ -164,7 +164,7 @@ export class InlineApiDefinition extends ApiDefinition { } } - public bind(_scope: cdk.Construct): ApiDefinitionConfig { + public bind(_scope: Construct): ApiDefinitionConfig { return { inlineDefinition: this.definition, }; @@ -182,7 +182,7 @@ export class AssetApiDefinition extends ApiDefinition { super(); } - public bind(scope: cdk.Construct): ApiDefinitionConfig { + public bind(scope: Construct): ApiDefinitionConfig { // If the same AssetAPIDefinition is used multiple times, retain only the first instantiation. if (this.asset === undefined) { this.asset = new s3_assets.Asset(scope, 'APIDefinition', { diff --git a/packages/@aws-cdk/aws-apigateway/lib/api-key.ts b/packages/@aws-cdk/aws-apigateway/lib/api-key.ts index 172b77aa40309..ec667d03f95bf 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/api-key.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/api-key.ts @@ -1,4 +1,5 @@ -import { Construct, IResource as IResourceBase, Resource } from '@aws-cdk/core'; +import { IResource as IResourceBase, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnApiKey } from './apigateway.generated'; import { ResourceOptions } from './resource'; import { RestApi } from './restapi'; diff --git a/packages/@aws-cdk/aws-apigateway/lib/apigatewayv2.ts b/packages/@aws-cdk/aws-apigateway/lib/apigatewayv2.ts index 0332859518b01..4d88396191e44 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/apigatewayv2.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/apigatewayv2.ts @@ -4,6 +4,7 @@ // tslint:disable:max-line-length import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Properties for defining a `AWS::ApiGatewayV2::Api` @@ -288,7 +289,7 @@ export class CfnApiV2 extends cdk.CfnResource implements cdk.IInspectable { * @param id - scoped id of the resource * @param props - resource properties */ - constructor(scope: cdk.Construct, id: string, props: CfnApiV2Props = {}) { + constructor(scope: Construct, id: string, props: CfnApiV2Props = {}) { super(scope, id, { type: CfnApiV2.CFN_RESOURCE_TYPE_NAME, properties: props }); this.apiKeySelectionExpression = props.apiKeySelectionExpression; @@ -616,7 +617,7 @@ export class CfnApiMappingV2 extends cdk.CfnResource implements cdk.IInspectable * @param id - scoped id of the resource * @param props - resource properties */ - constructor(scope: cdk.Construct, id: string, props: CfnApiMappingV2Props) { + constructor(scope: Construct, id: string, props: CfnApiMappingV2Props) { super(scope, id, { type: CfnApiMappingV2.CFN_RESOURCE_TYPE_NAME, properties: props }); cdk.requireProperty(props, 'apiId', this); cdk.requireProperty(props, 'domainName', this); @@ -842,7 +843,7 @@ export class CfnAuthorizerV2 extends cdk.CfnResource implements cdk.IInspectable * @param id - scoped id of the resource * @param props - resource properties */ - constructor(scope: cdk.Construct, id: string, props: CfnAuthorizerV2Props) { + constructor(scope: Construct, id: string, props: CfnAuthorizerV2Props) { super(scope, id, { type: CfnAuthorizerV2.CFN_RESOURCE_TYPE_NAME, properties: props }); cdk.requireProperty(props, 'apiId', this); cdk.requireProperty(props, 'authorizerType', this); @@ -1047,7 +1048,7 @@ export class CfnDeploymentV2 extends cdk.CfnResource implements cdk.IInspectable * @param id - scoped id of the resource * @param props - resource properties */ - constructor(scope: cdk.Construct, id: string, props: CfnDeploymentV2Props) { + constructor(scope: Construct, id: string, props: CfnDeploymentV2Props) { super(scope, id, { type: CfnDeploymentV2.CFN_RESOURCE_TYPE_NAME, properties: props }); cdk.requireProperty(props, 'apiId', this); @@ -1192,7 +1193,7 @@ export class CfnDomainNameV2 extends cdk.CfnResource implements cdk.IInspectable * @param id - scoped id of the resource * @param props - resource properties */ - constructor(scope: cdk.Construct, id: string, props: CfnDomainNameV2Props) { + constructor(scope: Construct, id: string, props: CfnDomainNameV2Props) { super(scope, id, { type: CfnDomainNameV2.CFN_RESOURCE_TYPE_NAME, properties: props }); cdk.requireProperty(props, 'domainName', this); this.attrRegionalDomainName = cdk.Token.asString(this.getAtt('RegionalDomainName')); @@ -1546,7 +1547,7 @@ export class CfnIntegrationV2 extends cdk.CfnResource implements cdk.IInspectabl * @param id - scoped id of the resource * @param props - resource properties */ - constructor(scope: cdk.Construct, id: string, props: CfnIntegrationV2Props) { + constructor(scope: Construct, id: string, props: CfnIntegrationV2Props) { super(scope, id, { type: CfnIntegrationV2.CFN_RESOURCE_TYPE_NAME, properties: props }); cdk.requireProperty(props, 'apiId', this); cdk.requireProperty(props, 'integrationType', this); @@ -1762,7 +1763,7 @@ export class CfnIntegrationResponseV2 extends cdk.CfnResource implements cdk.IIn * @param id - scoped id of the resource * @param props - resource properties */ - constructor(scope: cdk.Construct, id: string, props: CfnIntegrationResponseV2Props) { + constructor(scope: Construct, id: string, props: CfnIntegrationResponseV2Props) { super(scope, id, { type: CfnIntegrationResponseV2.CFN_RESOURCE_TYPE_NAME, properties: props }); cdk.requireProperty(props, 'apiId', this); cdk.requireProperty(props, 'integrationId', this); @@ -1937,7 +1938,7 @@ export class CfnModelV2 extends cdk.CfnResource implements cdk.IInspectable { * @param id - scoped id of the resource * @param props - resource properties */ - constructor(scope: cdk.Construct, id: string, props: CfnModelV2Props) { + constructor(scope: Construct, id: string, props: CfnModelV2Props) { super(scope, id, { type: CfnModelV2.CFN_RESOURCE_TYPE_NAME, properties: props }); cdk.requireProperty(props, 'apiId', this); cdk.requireProperty(props, 'name', this); @@ -2205,7 +2206,7 @@ export class CfnRouteV2 extends cdk.CfnResource implements cdk.IInspectable { * @param id - scoped id of the resource * @param props - resource properties */ - constructor(scope: cdk.Construct, id: string, props: CfnRouteV2Props) { + constructor(scope: Construct, id: string, props: CfnRouteV2Props) { super(scope, id, { type: CfnRouteV2.CFN_RESOURCE_TYPE_NAME, properties: props }); cdk.requireProperty(props, 'apiId', this); cdk.requireProperty(props, 'routeKey', this); @@ -2452,7 +2453,7 @@ export class CfnRouteResponseV2 extends cdk.CfnResource implements cdk.IInspecta * @param id - scoped id of the resource * @param props - resource properties */ - constructor(scope: cdk.Construct, id: string, props: CfnRouteResponseV2Props) { + constructor(scope: Construct, id: string, props: CfnRouteResponseV2Props) { super(scope, id, { type: CfnRouteResponseV2.CFN_RESOURCE_TYPE_NAME, properties: props }); cdk.requireProperty(props, 'apiId', this); cdk.requireProperty(props, 'routeId', this); @@ -2757,7 +2758,7 @@ export class CfnStageV2 extends cdk.CfnResource implements cdk.IInspectable { * @param id - scoped id of the resource * @param props - resource properties */ - constructor(scope: cdk.Construct, id: string, props: CfnStageV2Props) { + constructor(scope: Construct, id: string, props: CfnStageV2Props) { super(scope, id, { type: CfnStageV2.CFN_RESOURCE_TYPE_NAME, properties: props }); cdk.requireProperty(props, 'apiId', this); cdk.requireProperty(props, 'stageName', this); diff --git a/packages/@aws-cdk/aws-apigateway/lib/authorizer.ts b/packages/@aws-cdk/aws-apigateway/lib/authorizer.ts index ea414a1c43584..8a4c5a020bb9a 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/authorizer.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/authorizer.ts @@ -1,4 +1,5 @@ -import { Construct, Resource, ResourceProps } from '@aws-cdk/core'; +import { Resource, ResourceProps } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { AuthorizationType } from './method'; import { IRestApi } from './restapi'; diff --git a/packages/@aws-cdk/aws-apigateway/lib/authorizers/lambda.ts b/packages/@aws-cdk/aws-apigateway/lib/authorizers/lambda.ts index f79d675af1e7f..3dd3186340339 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/authorizers/lambda.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/authorizers/lambda.ts @@ -1,6 +1,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as lambda from '@aws-cdk/aws-lambda'; -import { Construct, Duration, Lazy, Stack } from '@aws-cdk/core'; +import { Duration, Lazy, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnAuthorizer } from '../apigateway.generated'; import { Authorizer, IAuthorizer } from '../authorizer'; import { IRestApi } from '../restapi'; diff --git a/packages/@aws-cdk/aws-apigateway/lib/base-path-mapping.ts b/packages/@aws-cdk/aws-apigateway/lib/base-path-mapping.ts index 9a23139df0ee4..6026fe3eaecd3 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/base-path-mapping.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/base-path-mapping.ts @@ -1,4 +1,5 @@ -import { Construct, Resource, Token } from '@aws-cdk/core'; +import { Resource, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnBasePathMapping } from './apigateway.generated'; import { IDomainName } from './domain-name'; import { IRestApi, RestApi } from './restapi'; diff --git a/packages/@aws-cdk/aws-apigateway/lib/deployment.ts b/packages/@aws-cdk/aws-apigateway/lib/deployment.ts index c72dba724f878..da3787153a1e7 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/deployment.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/deployment.ts @@ -1,4 +1,5 @@ -import { CfnResource, Construct, Lazy, RemovalPolicy, Resource, Stack } from '@aws-cdk/core'; +import { CfnResource, Lazy, RemovalPolicy, Resource, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as crypto from 'crypto'; import { CfnDeployment } from './apigateway.generated'; import { IRestApi, RestApi, SpecRestApi } from './restapi'; @@ -123,7 +124,7 @@ interface LatestDeploymentResourceProps { class LatestDeploymentResource extends CfnDeployment { private hashComponents = new Array(); - private originalLogicalId: string; + private api: IRestApi; constructor(scope: Construct, id: string, props: LatestDeploymentResourceProps) { @@ -133,7 +134,31 @@ class LatestDeploymentResource extends CfnDeployment { }); this.api = props.restApi; - this.originalLogicalId = Stack.of(this).getLogicalId(this); + + const originalLogicalId = Stack.of(this).getLogicalId(this); + + this.overrideLogicalId(Lazy.stringValue({ produce: ctx => { + const hash = [ ...this.hashComponents ]; + + if (this.api instanceof RestApi || this.api instanceof SpecRestApi) { // Ignore IRestApi that are imported + + // Add CfnRestApi to the logical id so a new deployment is triggered when any of its properties change. + const cfnRestApiCF = (this.api.node.defaultChild as any)._toCloudFormation(); + hash.push(ctx.resolve(cfnRestApiCF)); + } + + let lid = originalLogicalId; + + // if hash components were added to the deployment, we use them to calculate + // a logical ID for the deployment resource. + if (hash.length > 0) { + const md5 = crypto.createHash('md5'); + hash.map(x => ctx.resolve(x)).forEach(c => md5.update(JSON.stringify(c))); + lid += md5.digest('hex'); + } + + return lid; + }})); } /** @@ -149,28 +174,4 @@ class LatestDeploymentResource extends CfnDeployment { this.hashComponents.push(data); } - - /** - * Hooks into synthesis to calculate a logical ID that hashes all the components - * add via `addToLogicalId`. - */ - protected prepare() { - if (this.api instanceof RestApi || this.api instanceof SpecRestApi) { // Ignore IRestApi that are imported - - // Add CfnRestApi to the logical id so a new deployment is triggered when any of its properties change. - const cfnRestApiCF = (this.api.node.defaultChild as any)._toCloudFormation(); - this.addToLogicalId(Stack.of(this).resolve(cfnRestApiCF)); - } - - const stack = Stack.of(this); - - // if hash components were added to the deployment, we use them to calculate - // a logical ID for the deployment resource. - if (this.hashComponents.length > 0) { - const md5 = crypto.createHash('md5'); - this.hashComponents.map(x => stack.resolve(x)).forEach(c => md5.update(JSON.stringify(c))); - this.overrideLogicalId(this.originalLogicalId + md5.digest('hex')); - } - super.prepare(); - } } diff --git a/packages/@aws-cdk/aws-apigateway/lib/domain-name.ts b/packages/@aws-cdk/aws-apigateway/lib/domain-name.ts index f44ebf953dcac..f3b5074fb65a5 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/domain-name.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/domain-name.ts @@ -1,5 +1,6 @@ import * as acm from '@aws-cdk/aws-certificatemanager'; -import { Construct, IResource, Resource, Token } from '@aws-cdk/core'; +import { IResource, Resource, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnDomainName } from './apigateway.generated'; import { BasePathMapping, BasePathMappingOptions } from './base-path-mapping'; import { EndpointType, IRestApi } from './restapi'; diff --git a/packages/@aws-cdk/aws-apigateway/lib/gateway-response.ts b/packages/@aws-cdk/aws-apigateway/lib/gateway-response.ts index 62957167fa881..e28ba7355000a 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/gateway-response.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/gateway-response.ts @@ -1,4 +1,5 @@ -import { Construct, IResource, Resource } from '@aws-cdk/core'; +import { IResource, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnGatewayResponse } from './apigateway.generated'; import { IRestApi } from './restapi'; diff --git a/packages/@aws-cdk/aws-apigateway/lib/integrations/aws.ts b/packages/@aws-cdk/aws-apigateway/lib/integrations/aws.ts index 1f95b88233ab8..fd8dbd24f39b3 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'; @@ -69,7 +70,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/lambda-api.ts b/packages/@aws-cdk/aws-apigateway/lib/lambda-api.ts index 9b3e43da970fd..1e7a64c20b3d7 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/lambda-api.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/lambda-api.ts @@ -1,5 +1,5 @@ import * as lambda from '@aws-cdk/aws-lambda'; -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { LambdaIntegration } from './integrations'; import { Method } from './method'; import { ProxyResource, Resource } from './resource'; @@ -42,7 +42,7 @@ export interface LambdaRestApiProps extends RestApiProps { * add resources and methods to the API. */ export class LambdaRestApi extends RestApi { - constructor(scope: cdk.Construct, id: string, props: LambdaRestApiProps) { + constructor(scope: Construct, id: string, props: LambdaRestApiProps) { if ((props.options && props.options.defaultIntegration) || props.defaultIntegration) { throw new Error('Cannot specify "defaultIntegration" since Lambda integration is automatically defined'); } diff --git a/packages/@aws-cdk/aws-apigateway/lib/method.ts b/packages/@aws-cdk/aws-apigateway/lib/method.ts index 6e3ed26a0c6d9..2513c29148466 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/method.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/method.ts @@ -1,4 +1,5 @@ -import { Construct, Resource, Stack } from '@aws-cdk/core'; +import { Resource, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnMethod, CfnMethodProps } from './apigateway.generated'; import { Authorizer, IAuthorizer } from './authorizer'; import { Integration, IntegrationConfig } from './integration'; diff --git a/packages/@aws-cdk/aws-apigateway/lib/model.ts b/packages/@aws-cdk/aws-apigateway/lib/model.ts index 088dee9b98750..277c0e4fa20b7 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/model.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/model.ts @@ -1,4 +1,5 @@ -import { Construct, Resource } from '@aws-cdk/core'; +import { Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnModel, CfnModelProps } from './apigateway.generated'; import * as jsonSchema from './json-schema'; import { IRestApi, RestApi } from './restapi'; diff --git a/packages/@aws-cdk/aws-apigateway/lib/rate-limited-api-key.ts b/packages/@aws-cdk/aws-apigateway/lib/rate-limited-api-key.ts index 041d34c5ba99d..a82892b112ef7 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/rate-limited-api-key.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/rate-limited-api-key.ts @@ -1,4 +1,5 @@ -import { Construct, Resource } from '@aws-cdk/core'; +import { Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ApiKey, ApiKeyProps, IApiKey } from './api-key'; import { QuotaSettings, ThrottleSettings, UsagePlan, UsagePlanPerApiStage } from './usage-plan'; diff --git a/packages/@aws-cdk/aws-apigateway/lib/requestvalidator.ts b/packages/@aws-cdk/aws-apigateway/lib/requestvalidator.ts index ce56903f79a0d..02d3e014c24da 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/requestvalidator.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/requestvalidator.ts @@ -1,4 +1,5 @@ -import { Construct, IResource, Resource } from '@aws-cdk/core'; +import { IResource, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnRequestValidator, CfnRequestValidatorProps } from './apigateway.generated'; import { IRestApi, RestApi } from './restapi'; diff --git a/packages/@aws-cdk/aws-apigateway/lib/resource.ts b/packages/@aws-cdk/aws-apigateway/lib/resource.ts index 102a17a5cdc27..bf0486a4c4568 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/resource.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/resource.ts @@ -1,4 +1,5 @@ -import { Construct, IResource as IResourceBase, Resource as ResourceConstruct } from '@aws-cdk/core'; +import { IResource as IResourceBase, Resource as ResourceConstruct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnResource, CfnResourceProps } from './apigateway.generated'; import { Cors, CorsOptions } from './cors'; import { Integration } from './integration'; diff --git a/packages/@aws-cdk/aws-apigateway/lib/restapi.ts b/packages/@aws-cdk/aws-apigateway/lib/restapi.ts index 9ba3714aed915..b538af885f70c 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/restapi.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/restapi.ts @@ -1,6 +1,7 @@ import { IVpcEndpoint } from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; -import { CfnOutput, Construct, IResource as IResourceBase, Resource, Stack } from '@aws-cdk/core'; +import { CfnOutput, IResource as IResourceBase, Resource, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ApiDefinition } from './api-definition'; import { ApiKey, ApiKeyOptions, IApiKey } from './api-key'; import { CfnAccount, CfnRestApi } from './apigateway.generated'; diff --git a/packages/@aws-cdk/aws-apigateway/lib/stage.ts b/packages/@aws-cdk/aws-apigateway/lib/stage.ts index 56f7151b1954b..04de29f1f7d35 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/stage.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/stage.ts @@ -1,4 +1,5 @@ -import { Construct, Duration, IResource, Resource, Stack } from '@aws-cdk/core'; +import { Duration, IResource, Resource, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { AccessLogFormat, IAccessLogDestination} from './access-log'; import { CfnStage } from './apigateway.generated'; import { Deployment } from './deployment'; diff --git a/packages/@aws-cdk/aws-apigateway/lib/usage-plan.ts b/packages/@aws-cdk/aws-apigateway/lib/usage-plan.ts index c6029c5840e4c..358b4c57d4edb 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/usage-plan.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/usage-plan.ts @@ -1,4 +1,5 @@ -import { Construct, Lazy, Resource, Token } from '@aws-cdk/core'; +import { Lazy, Resource, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { IApiKey } from './api-key'; import { CfnUsagePlan, CfnUsagePlanKey } from './apigateway.generated'; import { Method } from './method'; diff --git a/packages/@aws-cdk/aws-apigateway/lib/vpc-link.ts b/packages/@aws-cdk/aws-apigateway/lib/vpc-link.ts index 81f6f843b97df..db2fee5030f3f 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/vpc-link.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/vpc-link.ts @@ -1,5 +1,6 @@ import * as elbv2 from '@aws-cdk/aws-elasticloadbalancingv2'; -import { Construct, IResource, Lazy, Resource } from '@aws-cdk/core'; +import { IResource, Lazy, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnVpcLink } from './apigateway.generated'; /** diff --git a/packages/@aws-cdk/aws-apigateway/package.json b/packages/@aws-cdk/aws-apigateway/package.json index 6816f6cc02ab7..43e041b72719b 100644 --- a/packages/@aws-cdk/aws-apigateway/package.json +++ b/packages/@aws-cdk/aws-apigateway/package.json @@ -82,7 +82,7 @@ "@aws-cdk/aws-s3-assets": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -97,7 +97,7 @@ "@aws-cdk/aws-s3-assets": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.cors.ts b/packages/@aws-cdk/aws-apigateway/test/integ.cors.ts index 966e162acc228..98533de848abf 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integ.cors.ts +++ b/packages/@aws-cdk/aws-apigateway/test/integ.cors.ts @@ -1,5 +1,6 @@ import * as lambda from '@aws-cdk/aws-lambda'; -import { App, Construct, Stack, StackProps } from '@aws-cdk/core'; +import { App, Stack, StackProps } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as path from 'path'; import * as apigw from '../lib'; diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.lambda-api.latebound-deploymentstage.ts b/packages/@aws-cdk/aws-apigateway/test/integ.lambda-api.latebound-deploymentstage.ts index 31b947921f382..d6176fdb78301 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integ.lambda-api.latebound-deploymentstage.ts +++ b/packages/@aws-cdk/aws-apigateway/test/integ.lambda-api.latebound-deploymentstage.ts @@ -1,5 +1,6 @@ import { Code, Function, Runtime } from '@aws-cdk/aws-lambda'; -import { App, Construct, Stack } from '@aws-cdk/core'; +import { App, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Deployment, LambdaRestApi, Stage } from '../lib'; class LateBoundDeploymentStageStack extends Stack { diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.restapi-import.lit.ts b/packages/@aws-cdk/aws-apigateway/test/integ.restapi-import.lit.ts index bea2be6c5b05f..3c645c27bff76 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integ.restapi-import.lit.ts +++ b/packages/@aws-cdk/aws-apigateway/test/integ.restapi-import.lit.ts @@ -1,4 +1,5 @@ -import { App, CfnOutput, Construct, NestedStack, NestedStackProps, Stack } from '@aws-cdk/core'; +import { App, CfnOutput, NestedStack, NestedStackProps, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Deployment, Method, MockIntegration, PassthroughBehavior, RestApi, Stage } from '../lib'; /** diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.multistack.ts b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.multistack.ts index 86012911a589d..eef496f657d27 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.multistack.ts +++ b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.multistack.ts @@ -2,12 +2,13 @@ import * as lambda from '@aws-cdk/aws-lambda'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as apig from '../lib'; class FirstStack extends cdk.Stack { public readonly firstLambda: lambda.Function; - constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) { + constructor(scope: Construct, id: string, props?: cdk.StackProps) { super(scope, id, props); this.firstLambda = new lambda.Function(this, 'firstLambda', { @@ -29,7 +30,7 @@ interface SecondStackProps extends cdk.StackProps { } class SecondStack extends cdk.Stack { - constructor(scope: cdk.Construct, id: string, props: SecondStackProps) { + constructor(scope: Construct, id: string, props: SecondStackProps) { super(scope, id, props); const api = new apig.RestApi(this, 'BooksApi', { diff --git a/packages/@aws-cdk/aws-apigatewayv2/lib/http/api.ts b/packages/@aws-cdk/aws-apigatewayv2/lib/http/api.ts index 7856ff5f87bf7..a33a5628aa760 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/lib/http/api.ts +++ b/packages/@aws-cdk/aws-apigatewayv2/lib/http/api.ts @@ -1,4 +1,5 @@ -import { Construct, Duration, IResource, Resource } from '@aws-cdk/core'; +import { Duration, IResource, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnApi, CfnApiProps } from '../apigatewayv2.generated'; import { IHttpRouteIntegration } from './integration'; import { BatchHttpRouteOptions, HttpMethod, HttpRoute, HttpRouteKey } from './route'; diff --git a/packages/@aws-cdk/aws-apigatewayv2/lib/http/integration.ts b/packages/@aws-cdk/aws-apigatewayv2/lib/http/integration.ts index 7e9672ed5a786..8c3104b33b5d3 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/lib/http/integration.ts +++ b/packages/@aws-cdk/aws-apigatewayv2/lib/http/integration.ts @@ -1,4 +1,5 @@ -import { Construct, Resource } from '@aws-cdk/core'; +import { Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnIntegration } from '../apigatewayv2.generated'; import { IIntegration } from '../common'; import { IHttpApi } from './api'; diff --git a/packages/@aws-cdk/aws-apigatewayv2/lib/http/route.ts b/packages/@aws-cdk/aws-apigatewayv2/lib/http/route.ts index 574b2c82275e8..3277211844037 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/lib/http/route.ts +++ b/packages/@aws-cdk/aws-apigatewayv2/lib/http/route.ts @@ -1,4 +1,5 @@ -import { Construct, Resource } from '@aws-cdk/core'; +import { Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnRoute, CfnRouteProps } from '../apigatewayv2.generated'; import { IRoute } from '../common'; import { IHttpApi } from './api'; diff --git a/packages/@aws-cdk/aws-apigatewayv2/lib/http/stage.ts b/packages/@aws-cdk/aws-apigatewayv2/lib/http/stage.ts index 1335cbf839984..1b8e1c9e6aa92 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/lib/http/stage.ts +++ b/packages/@aws-cdk/aws-apigatewayv2/lib/http/stage.ts @@ -1,4 +1,5 @@ -import { Construct, Resource, Stack } from '@aws-cdk/core'; +import { Resource, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnStage } from '../apigatewayv2.generated'; import { CommonStageOptions, IStage } from '../common'; import { IHttpApi } from './api'; diff --git a/packages/@aws-cdk/aws-apigatewayv2/package.json b/packages/@aws-cdk/aws-apigatewayv2/package.json index 0920b42061902..455be870c237a 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/package.json +++ b/packages/@aws-cdk/aws-apigatewayv2/package.json @@ -74,13 +74,13 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 075cbadd2b42d..fd4d1831a83c0 100644 --- a/packages/@aws-cdk/aws-appconfig/package.json +++ b/packages/@aws-cdk/aws-appconfig/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 5407fba139087..ab79f246c2d08 100644 --- a/packages/@aws-cdk/aws-applicationautoscaling/lib/base-scalable-attribute.ts +++ b/packages/@aws-cdk/aws-applicationautoscaling/lib/base-scalable-attribute.ts @@ -1,5 +1,5 @@ import * as iam from '@aws-cdk/aws-iam'; -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ScalableTarget, ScalingSchedule, ServiceNamespace } from './scalable-target'; import { BasicStepScalingPolicyProps } from './step-scaling-policy'; import { BasicTargetTrackingScalingPolicyProps } from './target-tracking-scaling-policy'; @@ -43,10 +43,10 @@ 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 cdk.Construct { +export abstract class BaseScalableAttribute extends Construct { private target: ScalableTarget; - public constructor(scope: cdk.Construct, id: string, protected readonly props: BaseScalableAttributeProps) { + public constructor(scope: Construct, id: string, protected readonly props: BaseScalableAttributeProps) { super(scope, id); this.target = new ScalableTarget(this, 'Target', { diff --git a/packages/@aws-cdk/aws-applicationautoscaling/lib/scalable-target.ts b/packages/@aws-cdk/aws-applicationautoscaling/lib/scalable-target.ts index fc7aea99f3510..35755fd703034 100644 --- a/packages/@aws-cdk/aws-applicationautoscaling/lib/scalable-target.ts +++ b/packages/@aws-cdk/aws-applicationautoscaling/lib/scalable-target.ts @@ -1,5 +1,6 @@ import * as iam from '@aws-cdk/aws-iam'; -import { Construct, IResource, Lazy, Resource, withResolved } from '@aws-cdk/core'; +import { IResource, Lazy, Resource, withResolved } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnScalableTarget } from './applicationautoscaling.generated'; import { Schedule } from './schedule'; import { BasicStepScalingPolicyProps, StepScalingPolicy } from './step-scaling-policy'; 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 fac49b523e8ea..75bdaa69e89ea 100644 --- a/packages/@aws-cdk/aws-applicationautoscaling/lib/step-scaling-action.ts +++ b/packages/@aws-cdk/aws-applicationautoscaling/lib/step-scaling-action.ts @@ -1,4 +1,5 @@ import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnScalingPolicy } from './applicationautoscaling.generated'; import { IScalableTarget } from './scalable-target'; @@ -66,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 cdk.Construct { +export class StepScalingAction extends Construct { /** * ARN of the scaling policy */ @@ -74,7 +75,7 @@ export class StepScalingAction extends cdk.Construct { private readonly adjustments = new Array(); - constructor(scope: cdk.Construct, id: string, props: StepScalingActionProps) { + constructor(scope: Construct, id: string, props: StepScalingActionProps) { super(scope, id); // Cloudformation requires either the ResourceId, ScalableDimension, and ServiceNamespace 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 8b7b6fd8e5bea..1949e53f771e2 100644 --- a/packages/@aws-cdk/aws-applicationautoscaling/lib/step-scaling-policy.ts +++ b/packages/@aws-cdk/aws-applicationautoscaling/lib/step-scaling-policy.ts @@ -1,6 +1,7 @@ import { findAlarmThresholds, normalizeIntervals } from '@aws-cdk/aws-autoscaling-common'; import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { IScalableTarget } from './scalable-target'; import { AdjustmentType, MetricAggregationType, StepScalingAction } from './step-scaling-action'; @@ -62,13 +63,13 @@ export interface StepScalingPolicyProps extends BasicStepScalingPolicyProps { * * Implemented using one or more CloudWatch alarms and Step Scaling Policies. */ -export class StepScalingPolicy extends cdk.Construct { +export class StepScalingPolicy extends Construct { public readonly lowerAlarm?: cloudwatch.Alarm; public readonly lowerAction?: StepScalingAction; public readonly upperAlarm?: cloudwatch.Alarm; public readonly upperAction?: StepScalingAction; - constructor(scope: cdk.Construct, id: string, props: StepScalingPolicyProps) { + constructor(scope: Construct, id: string, props: StepScalingPolicyProps) { super(scope, id); if (props.scalingSteps.length < 2) { @@ -209,7 +210,7 @@ class StepScalingAlarmAction implements cloudwatch.IAlarmAction { constructor(private readonly stepScalingAction: StepScalingAction) { } - public bind(_scope: cdk.Construct, _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 8a314f0b1ac22..2bbf0244f40b6 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 @@ -1,5 +1,6 @@ import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnScalingPolicy } from './applicationautoscaling.generated'; import { IScalableTarget } from './scalable-target'; @@ -114,13 +115,13 @@ export interface TargetTrackingScalingPolicyProps extends BasicTargetTrackingSca readonly scalingTarget: IScalableTarget; } -export class TargetTrackingScalingPolicy extends cdk.Construct { +export class TargetTrackingScalingPolicy extends Construct { /** * ARN of the scaling policy */ public readonly scalingPolicyArn: string; - constructor(scope: cdk.Construct, id: string, props: TargetTrackingScalingPolicyProps) { + constructor(scope: Construct, id: string, props: TargetTrackingScalingPolicyProps) { if ((props.customMetric === undefined) === (props.predefinedMetric === undefined)) { throw new Error('Exactly one of \'customMetric\' or \'predefinedMetric\' must be specified.'); } diff --git a/packages/@aws-cdk/aws-applicationautoscaling/package.json b/packages/@aws-cdk/aws-applicationautoscaling/package.json index 64ede897c926b..66cb34dd6ad8b 100644 --- a/packages/@aws-cdk/aws-applicationautoscaling/package.json +++ b/packages/@aws-cdk/aws-applicationautoscaling/package.json @@ -75,7 +75,7 @@ "@aws-cdk/aws-cloudwatch": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -83,7 +83,7 @@ "@aws-cdk/aws-cloudwatch": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-applicationautoscaling/test/util.ts b/packages/@aws-cdk/aws-applicationautoscaling/test/util.ts index 7fd2b95a8a1d6..8c87b97eb9b13 100644 --- a/packages/@aws-cdk/aws-applicationautoscaling/test/util.ts +++ b/packages/@aws-cdk/aws-applicationautoscaling/test/util.ts @@ -1,9 +1,9 @@ import * as scalingcommon from '@aws-cdk/aws-autoscaling-common'; -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as fc from 'fast-check'; import * as appscaling from '../lib'; -export function createScalableTarget(scope: cdk.Construct) { +export function createScalableTarget(scope: Construct) { return new appscaling.ScalableTarget(scope, 'Target', { serviceNamespace: appscaling.ServiceNamespace.DYNAMODB, scalableDimension: 'test:TestCount', diff --git a/packages/@aws-cdk/aws-appmesh/lib/mesh.ts b/packages/@aws-cdk/aws-appmesh/lib/mesh.ts index 8e39cb4657d1e..aad1d409a28d0 100644 --- a/packages/@aws-cdk/aws-appmesh/lib/mesh.ts +++ b/packages/@aws-cdk/aws-appmesh/lib/mesh.ts @@ -1,5 +1,6 @@ import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnMesh } from './appmesh.generated'; import { VirtualNode, VirtualNodeBaseProps } from './virtual-node'; import { VirtualRouter, VirtualRouterBaseProps } from './virtual-router'; @@ -129,7 +130,7 @@ export class Mesh extends MeshBase { /** * Import an existing mesh by arn */ - public static fromMeshArn(scope: cdk.Construct, id: string, meshArn: string): IMesh { + public static fromMeshArn(scope: Construct, id: string, meshArn: string): IMesh { const parts = cdk.Stack.of(scope).parseArn(meshArn); class Import extends MeshBase { @@ -143,7 +144,7 @@ export class Mesh extends MeshBase { /** * Import an existing mesh by name */ - public static fromMeshName(scope: cdk.Construct, id: string, meshName: string): IMesh { + public static fromMeshName(scope: Construct, id: string, meshName: string): IMesh { const arn = cdk.Stack.of(scope).formatArn({ service: 'appmesh', resource: 'mesh', @@ -168,7 +169,7 @@ export class Mesh extends MeshBase { */ public readonly meshArn: string; - constructor(scope: cdk.Construct, id: string, props: MeshProps = {}) { + constructor(scope: Construct, id: string, props: MeshProps = {}) { super(scope, id, { physicalName: props.meshName || cdk.Lazy.stringValue({ produce: () => this.node.uniqueId }), }); diff --git a/packages/@aws-cdk/aws-appmesh/lib/route.ts b/packages/@aws-cdk/aws-appmesh/lib/route.ts index 8534ad70dcf14..9ada856825c26 100644 --- a/packages/@aws-cdk/aws-appmesh/lib/route.ts +++ b/packages/@aws-cdk/aws-appmesh/lib/route.ts @@ -1,5 +1,6 @@ import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnRoute } from './appmesh.generated'; import { IMesh } from './mesh'; import { IVirtualNode } from './virtual-node'; @@ -113,14 +114,14 @@ export class Route extends cdk.Resource implements IRoute { /** * Import an existing route given an ARN */ - public static fromRouteArn(scope: cdk.Construct, id: string, routeArn: string): IRoute { + public static fromRouteArn(scope: Construct, id: string, routeArn: string): IRoute { return new ImportedRoute(scope, id, { routeArn }); } /** * Import an existing route given its name */ - public static fromRouteName(scope: cdk.Construct, id: string, meshName: string, virtualRouterName: string, routeName: string): IRoute { + public static fromRouteName(scope: Construct, id: string, meshName: string, virtualRouterName: string, routeName: string): IRoute { return new ImportedRoute(scope, id, { meshName, virtualRouterName, routeName }); } @@ -143,7 +144,7 @@ export class Route extends cdk.Resource implements IRoute { private readonly httpRoute?: CfnRoute.HttpRouteProperty; private readonly tcpRoute?: CfnRoute.TcpRouteProperty; - constructor(scope: cdk.Construct, id: string, props: RouteProps) { + constructor(scope: Construct, id: string, props: RouteProps) { super(scope, id, { physicalName: props.routeName || cdk.Lazy.stringValue({ produce: () => this.node.uniqueId }), }); @@ -251,7 +252,7 @@ class ImportedRoute extends cdk.Resource implements IRoute { */ public readonly routeArn: string; - constructor(scope: cdk.Construct, id: string, props: RouteAttributes) { + constructor(scope: Construct, id: string, props: RouteAttributes) { super(scope, id); if (props.routeArn) { diff --git a/packages/@aws-cdk/aws-appmesh/lib/virtual-node.ts b/packages/@aws-cdk/aws-appmesh/lib/virtual-node.ts index 63c97392473c0..380d8d9299ccf 100644 --- a/packages/@aws-cdk/aws-appmesh/lib/virtual-node.ts +++ b/packages/@aws-cdk/aws-appmesh/lib/virtual-node.ts @@ -1,6 +1,7 @@ import * as cloudmap from '@aws-cdk/aws-servicediscovery'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnVirtualNode } from './appmesh.generated'; import { IMesh } from './mesh'; import { HealthCheck, PortMapping, Protocol, VirtualNodeListener } from './shared-interfaces'; @@ -210,14 +211,14 @@ export class VirtualNode extends VirtualNodeBase { /** * Import an existing VirtualNode given an ARN */ - public static fromVirtualNodeArn(scope: cdk.Construct, id: string, virtualNodeArn: string): IVirtualNode { + public static fromVirtualNodeArn(scope: Construct, id: string, virtualNodeArn: string): IVirtualNode { return new ImportedVirtualNode(scope, id, { virtualNodeArn }); } /** * Import an existing VirtualNode given its name */ - public static fromVirtualNodeName(scope: cdk.Construct, id: string, meshName: string, virtualNodeName: string): IVirtualNode { + public static fromVirtualNodeName(scope: Construct, id: string, meshName: string, virtualNodeName: string): IVirtualNode { return new ImportedVirtualNode(scope, id, { meshName, virtualNodeName, @@ -239,7 +240,7 @@ export class VirtualNode extends VirtualNodeBase { */ public readonly mesh: IMesh; - constructor(scope: cdk.Construct, id: string, props: VirtualNodeProps) { + constructor(scope: Construct, id: string, props: VirtualNodeProps) { super(scope, id, { physicalName: props.virtualNodeName || cdk.Lazy.stringValue({ produce: () => this.node.uniqueId }), }); @@ -321,7 +322,7 @@ class ImportedVirtualNode extends VirtualNodeBase { */ public readonly virtualNodeArn: string; - constructor(scope: cdk.Construct, id: string, props: VirtualNodeAttributes) { + constructor(scope: Construct, id: string, props: VirtualNodeAttributes) { super(scope, id); if (props.virtualNodeArn) { diff --git a/packages/@aws-cdk/aws-appmesh/lib/virtual-router.ts b/packages/@aws-cdk/aws-appmesh/lib/virtual-router.ts index 3403b47378c5c..a8ba3829358ea 100644 --- a/packages/@aws-cdk/aws-appmesh/lib/virtual-router.ts +++ b/packages/@aws-cdk/aws-appmesh/lib/virtual-router.ts @@ -1,5 +1,6 @@ import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnVirtualRouter } from './appmesh.generated'; import { IMesh, Mesh } from './mesh'; import { Route, RouteBaseProps } from './route'; @@ -108,21 +109,21 @@ export class VirtualRouter extends VirtualRouterBase { /** * Import an existing VirtualRouter given an ARN */ - public static fromVirtualRouterArn(scope: cdk.Construct, id: string, virtualRouterArn: string): IVirtualRouter { + public static fromVirtualRouterArn(scope: Construct, id: string, virtualRouterArn: string): IVirtualRouter { return new ImportedVirtualRouter(scope, id, { virtualRouterArn }); } /** * Import an existing VirtualRouter given names */ - public static fromVirtualRouterName(scope: cdk.Construct, id: string, meshName: string, virtualRouterName: string): IVirtualRouter { + public static fromVirtualRouterName(scope: Construct, id: string, meshName: string, virtualRouterName: string): IVirtualRouter { return new ImportedVirtualRouter(scope, id, { meshName, virtualRouterName }); } /** * Import an existing virtual router given attributes */ - public static fromVirtualRouterAttributes(scope: cdk.Construct, id: string, attrs: VirtualRouterAttributes): IVirtualRouter { + public static fromVirtualRouterAttributes(scope: Construct, id: string, attrs: VirtualRouterAttributes): IVirtualRouter { return new ImportedVirtualRouter(scope, id, attrs); } @@ -143,7 +144,7 @@ export class VirtualRouter extends VirtualRouterBase { private readonly listeners = new Array(); - constructor(scope: cdk.Construct, id: string, props: VirtualRouterProps) { + constructor(scope: Construct, id: string, props: VirtualRouterProps) { super(scope, id, { physicalName: props.virtualRouterName || cdk.Lazy.stringValue({ produce: () => this.node.uniqueId }), }); @@ -219,7 +220,7 @@ class ImportedVirtualRouter extends VirtualRouterBase { private _mesh?: IMesh; - constructor(scope: cdk.Construct, id: string, props: VirtualRouterAttributes) { + constructor(scope: Construct, id: string, props: VirtualRouterAttributes) { super(scope, id); if (props.mesh) { diff --git a/packages/@aws-cdk/aws-appmesh/lib/virtual-service.ts b/packages/@aws-cdk/aws-appmesh/lib/virtual-service.ts index 9cc678ec266a9..7f13042a96122 100644 --- a/packages/@aws-cdk/aws-appmesh/lib/virtual-service.ts +++ b/packages/@aws-cdk/aws-appmesh/lib/virtual-service.ts @@ -1,5 +1,6 @@ import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnVirtualService } from './appmesh.generated'; import { IMesh } from './mesh'; import { IVirtualNode } from './virtual-node'; @@ -75,7 +76,7 @@ export class VirtualService extends cdk.Resource implements IVirtualService { /** * Import an existing VirtualService given an ARN */ - public static fromVirtualServiceArn(scope: cdk.Construct, id: string, virtualServiceArn: string): IVirtualService { + public static fromVirtualServiceArn(scope: Construct, id: string, virtualServiceArn: string): IVirtualService { return new ImportedVirtualService(scope, id, { virtualServiceArn, }); @@ -84,7 +85,7 @@ export class VirtualService extends cdk.Resource implements IVirtualService { /** * Import an existing VirtualService given mesh and service names */ - public static fromVirtualServiceName(scope: cdk.Construct, id: string, meshName: string, virtualServiceName: string): IVirtualService { + public static fromVirtualServiceName(scope: Construct, id: string, meshName: string, virtualServiceName: string): IVirtualService { return new ImportedVirtualService(scope, id, { meshName, virtualServiceName, @@ -104,7 +105,7 @@ export class VirtualService extends cdk.Resource implements IVirtualService { private readonly virtualServiceProvider?: CfnVirtualService.VirtualServiceProviderProperty; private readonly mesh: IMesh; - constructor(scope: cdk.Construct, id: string, props: VirtualServiceProps) { + constructor(scope: Construct, id: string, props: VirtualServiceProps) { super(scope, id, { physicalName: props.virtualServiceName || cdk.Lazy.stringValue({ produce: () => this.node.uniqueId }), }); @@ -198,7 +199,7 @@ class ImportedVirtualService extends cdk.Resource implements IVirtualService { */ public readonly virtualServiceArn: string; - constructor(scope: cdk.Construct, id: string, props: VirtualServiceAttributes) { + constructor(scope: Construct, id: string, props: VirtualServiceAttributes) { super(scope, id); if (props.virtualServiceArn) { diff --git a/packages/@aws-cdk/aws-appmesh/package.json b/packages/@aws-cdk/aws-appmesh/package.json index 3bbc70c2941d8..627a3398ddd0e 100644 --- a/packages/@aws-cdk/aws-appmesh/package.json +++ b/packages/@aws-cdk/aws-appmesh/package.json @@ -80,14 +80,14 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-servicediscovery": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/aws-ec2": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-servicediscovery": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 ace96ac5c84ce..268f7d2ba7493 100644 --- a/packages/@aws-cdk/aws-appstream/package.json +++ b/packages/@aws-cdk/aws-appstream/package.json @@ -71,11 +71,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-appsync/lib/graphqlapi.ts b/packages/@aws-cdk/aws-appsync/lib/graphqlapi.ts index bbc92625c5749..026ca1c8c4df9 100644 --- a/packages/@aws-cdk/aws-appsync/lib/graphqlapi.ts +++ b/packages/@aws-cdk/aws-appsync/lib/graphqlapi.ts @@ -9,7 +9,8 @@ import { ServicePrincipal, } from '@aws-cdk/aws-iam'; import { IFunction } from '@aws-cdk/aws-lambda'; -import { Construct, Duration, IResolvable } from '@aws-cdk/core'; +import { Duration, IResolvable } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { readFileSync } from 'fs'; import { CfnApiKey, diff --git a/packages/@aws-cdk/aws-appsync/package.json b/packages/@aws-cdk/aws-appsync/package.json index ed431e29e7367..4a312f78f0575 100644 --- a/packages/@aws-cdk/aws-appsync/package.json +++ b/packages/@aws-cdk/aws-appsync/package.json @@ -76,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.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -85,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.0.2" + "constructs": "4.1.1-pre.0" }, "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 51bc934c9fdac..0efddaf0d3fc3 100644 --- a/packages/@aws-cdk/aws-athena/package.json +++ b/packages/@aws-cdk/aws-athena/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-autoscaling-common/package.json b/packages/@aws-cdk/aws-autoscaling-common/package.json index ccabb1ecb87e2..81a4863553519 100644 --- a/packages/@aws-cdk/aws-autoscaling-common/package.json +++ b/packages/@aws-cdk/aws-autoscaling-common/package.json @@ -69,13 +69,13 @@ "dependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 047a0df140a21..767abc4f04ae7 100644 --- a/packages/@aws-cdk/aws-autoscaling-hooktargets/lib/lambda-hook.ts +++ b/packages/@aws-cdk/aws-autoscaling-hooktargets/lib/lambda-hook.ts @@ -2,7 +2,7 @@ import * as autoscaling from '@aws-cdk/aws-autoscaling'; 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 { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { TopicHook } from './topic-hook'; /** 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 fc353a027cd84..2cb6997c6d5eb 100644 --- a/packages/@aws-cdk/aws-autoscaling-hooktargets/package.json +++ b/packages/@aws-cdk/aws-autoscaling-hooktargets/package.json @@ -74,7 +74,7 @@ "@aws-cdk/aws-sns-subscriptions": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -85,7 +85,7 @@ "@aws-cdk/aws-sns-subscriptions": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-autoscaling/lib/auto-scaling-group.ts b/packages/@aws-cdk/aws-autoscaling/lib/auto-scaling-group.ts index 4007b60c7ab3a..507f45b610f39 100644 --- a/packages/@aws-cdk/aws-autoscaling/lib/auto-scaling-group.ts +++ b/packages/@aws-cdk/aws-autoscaling/lib/auto-scaling-group.ts @@ -6,9 +6,10 @@ import * as iam from '@aws-cdk/aws-iam'; import * as sns from '@aws-cdk/aws-sns'; import { - CfnAutoScalingRollingUpdate, Construct, Duration, Fn, IResource, Lazy, PhysicalName, Resource, Stack, + CfnAutoScalingRollingUpdate, Duration, Fn, IResource, Lazy, PhysicalName, Resource, Stack, Tag, Tokenization, withResolved, } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnAutoScalingGroup, CfnAutoScalingGroupProps, CfnLaunchConfiguration } from './autoscaling.generated'; import { BasicLifecycleHookProps, LifecycleHook } from './lifecycle-hook'; import { BasicScheduledActionProps, ScheduledAction } from './scheduled-action'; @@ -488,7 +489,7 @@ export class AutoScalingGroup extends AutoScalingGroupBase implements }); this.connections = new ec2.Connections({ securityGroups: [this.securityGroup] }); this.securityGroups.push(this.securityGroup); - this.node.applyAspect(new Tag(NAME_TAG, this.node.path)); + Tag.add(this, NAME_TAG, this.node.path); this.role = props.role || new iam.Role(this, 'InstanceRole', { roleName: PhysicalName.GENERATE_IF_NEEDED, 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 b72a3245eb4d5..539b4e55481c8 100644 --- a/packages/@aws-cdk/aws-autoscaling/lib/lifecycle-hook-target.ts +++ b/packages/@aws-cdk/aws-autoscaling/lib/lifecycle-hook-target.ts @@ -1,4 +1,4 @@ -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ILifecycleHook } from './lifecycle-hook'; /** diff --git a/packages/@aws-cdk/aws-autoscaling/lib/lifecycle-hook.ts b/packages/@aws-cdk/aws-autoscaling/lib/lifecycle-hook.ts index 9c6f1d7f15322..4e4e8408ad326 100644 --- a/packages/@aws-cdk/aws-autoscaling/lib/lifecycle-hook.ts +++ b/packages/@aws-cdk/aws-autoscaling/lib/lifecycle-hook.ts @@ -1,5 +1,6 @@ import * as iam from '@aws-cdk/aws-iam'; -import { Construct, Duration, IResource, Resource } from '@aws-cdk/core'; +import { Duration, IResource, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { IAutoScalingGroup } from './auto-scaling-group'; import { CfnLifecycleHook } from './autoscaling.generated'; import { ILifecycleHookTarget } from './lifecycle-hook-target'; diff --git a/packages/@aws-cdk/aws-autoscaling/lib/scheduled-action.ts b/packages/@aws-cdk/aws-autoscaling/lib/scheduled-action.ts index a38c9d88bac64..71fde34af72cd 100644 --- a/packages/@aws-cdk/aws-autoscaling/lib/scheduled-action.ts +++ b/packages/@aws-cdk/aws-autoscaling/lib/scheduled-action.ts @@ -1,4 +1,5 @@ -import { Construct, Resource } from '@aws-cdk/core'; +import { Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { IAutoScalingGroup } from './auto-scaling-group'; import { CfnScheduledAction } from './autoscaling.generated'; import { Schedule } from './schedule'; 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 78ea9cbd0e791..65f551d1dc297 100644 --- a/packages/@aws-cdk/aws-autoscaling/lib/step-scaling-action.ts +++ b/packages/@aws-cdk/aws-autoscaling/lib/step-scaling-action.ts @@ -1,4 +1,5 @@ import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { IAutoScalingGroup } from './auto-scaling-group'; import { CfnScalingPolicy } from './autoscaling.generated'; @@ -59,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 cdk.Construct { +export class StepScalingAction extends Construct { /** * ARN of the scaling policy */ @@ -67,7 +68,7 @@ export class StepScalingAction extends cdk.Construct { private readonly adjustments = new Array(); - constructor(scope: cdk.Construct, id: string, props: StepScalingActionProps) { + constructor(scope: Construct, id: string, props: StepScalingActionProps) { super(scope, id); const resource = new CfnScalingPolicy(this, 'Resource', { 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 e9d530804d77c..2d35d875e03e0 100644 --- a/packages/@aws-cdk/aws-autoscaling/lib/step-scaling-policy.ts +++ b/packages/@aws-cdk/aws-autoscaling/lib/step-scaling-policy.ts @@ -1,6 +1,7 @@ import { findAlarmThresholds, normalizeIntervals } from '@aws-cdk/aws-autoscaling-common'; import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { IAutoScalingGroup } from './auto-scaling-group'; import { AdjustmentType, MetricAggregationType, StepScalingAction } from './step-scaling-action'; @@ -63,13 +64,13 @@ export interface StepScalingPolicyProps extends BasicStepScalingPolicyProps { * * Implemented using one or more CloudWatch alarms and Step Scaling Policies. */ -export class StepScalingPolicy extends cdk.Construct { +export class StepScalingPolicy extends Construct { public readonly lowerAlarm?: cloudwatch.Alarm; public readonly lowerAction?: StepScalingAction; public readonly upperAlarm?: cloudwatch.Alarm; public readonly upperAction?: StepScalingAction; - constructor(scope: cdk.Construct, id: string, props: StepScalingPolicyProps) { + constructor(scope: Construct, id: string, props: StepScalingPolicyProps) { super(scope, id); if (props.scalingSteps.length < 2) { @@ -210,7 +211,7 @@ class StepScalingAlarmAction implements cloudwatch.IAlarmAction { constructor(private readonly stepScalingAction: StepScalingAction) { } - public bind(_scope: cdk.Construct, _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 c57bd62008093..ae87ce82e5a0f 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 @@ -1,5 +1,6 @@ import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { IAutoScalingGroup } from './auto-scaling-group'; import { CfnScalingPolicy } from './autoscaling.generated'; @@ -97,7 +98,7 @@ export interface TargetTrackingScalingPolicyProps extends BasicTargetTrackingSca readonly autoScalingGroup: IAutoScalingGroup; } -export class TargetTrackingScalingPolicy extends cdk.Construct { +export class TargetTrackingScalingPolicy extends Construct { /** * ARN of the scaling policy */ @@ -108,7 +109,7 @@ export class TargetTrackingScalingPolicy extends cdk.Construct { */ private resource: CfnScalingPolicy; - constructor(scope: cdk.Construct, id: string, props: TargetTrackingScalingPolicyProps) { + constructor(scope: Construct, id: string, props: TargetTrackingScalingPolicyProps) { if ((props.customMetric === undefined) === (props.predefinedMetric === undefined)) { throw new Error('Exactly one of \'customMetric\' or \'predefinedMetric\' must be specified.'); } diff --git a/packages/@aws-cdk/aws-autoscaling/package.json b/packages/@aws-cdk/aws-autoscaling/package.json index a7090a8e2284f..a87777c5adb7e 100644 --- a/packages/@aws-cdk/aws-autoscaling/package.json +++ b/packages/@aws-cdk/aws-autoscaling/package.json @@ -81,7 +81,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -93,7 +93,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-autoscaling/test/test.auto-scaling-group.ts b/packages/@aws-cdk/aws-autoscaling/test/test.auto-scaling-group.ts index 05ac3029b6e4c..f2746e407e071 100644 --- a/packages/@aws-cdk/aws-autoscaling/test/test.auto-scaling-group.ts +++ b/packages/@aws-cdk/aws-autoscaling/test/test.auto-scaling-group.ts @@ -511,8 +511,9 @@ export = { pauseTime: cdk.Duration.seconds(345), }, }); - asg.node.applyAspect(new cdk.Tag('superfood', 'acai')); - asg.node.applyAspect(new cdk.Tag('notsuper', 'caramel', { applyToLaunchedInstances: false })); + + cdk.Tag.add(asg, 'superfood', 'acai'); + cdk.Tag.add(asg, 'notsuper', 'caramel', { applyToLaunchedInstances: false }); // THEN expect(stack).to(haveResource('AWS::AutoScaling::AutoScalingGroup', { diff --git a/packages/@aws-cdk/aws-autoscaling/test/test.lifecyclehooks.ts b/packages/@aws-cdk/aws-autoscaling/test/test.lifecyclehooks.ts index 5b002ad102c2b..c20122901b17a 100644 --- a/packages/@aws-cdk/aws-autoscaling/test/test.lifecyclehooks.ts +++ b/packages/@aws-cdk/aws-autoscaling/test/test.lifecyclehooks.ts @@ -2,6 +2,7 @@ import { expect, haveResource, ResourcePart } from '@aws-cdk/assert'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Test } from 'nodeunit'; import * as autoscaling from '../lib'; @@ -71,7 +72,7 @@ export = { }; class FakeNotificationTarget implements autoscaling.ILifecycleHookTarget { - public bind(_scope: cdk.Construct, lifecycleHook: autoscaling.ILifecycleHook): autoscaling.LifecycleHookTargetConfig { + public bind(_scope: Construct, lifecycleHook: autoscaling.ILifecycleHook): autoscaling.LifecycleHookTargetConfig { lifecycleHook.role.addToPolicy(new iam.PolicyStatement({ actions: ['action:Work'], resources: ['*'], diff --git a/packages/@aws-cdk/aws-autoscaling/test/test.scaling.ts b/packages/@aws-cdk/aws-autoscaling/test/test.scaling.ts index 6168e215cfd43..3be8259b7618c 100644 --- a/packages/@aws-cdk/aws-autoscaling/test/test.scaling.ts +++ b/packages/@aws-cdk/aws-autoscaling/test/test.scaling.ts @@ -3,6 +3,7 @@ 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 { Construct } from 'constructs'; import { Test } from 'nodeunit'; import * as autoscaling from '../lib'; @@ -223,11 +224,11 @@ export = { }, }; -class ASGFixture extends cdk.Construct { +class ASGFixture extends Construct { public readonly vpc: ec2.Vpc; public readonly asg: autoscaling.AutoScalingGroup; - constructor(scope: cdk.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-autoscaling/test/test.scheduled-action.ts b/packages/@aws-cdk/aws-autoscaling/test/test.scheduled-action.ts index 05dd627b6302b..5f7408e758d76 100644 --- a/packages/@aws-cdk/aws-autoscaling/test/test.scheduled-action.ts +++ b/packages/@aws-cdk/aws-autoscaling/test/test.scheduled-action.ts @@ -1,6 +1,7 @@ import { expect, haveResource, MatchStyle } from '@aws-cdk/assert'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Test } from 'nodeunit'; import * as autoscaling from '../lib'; @@ -107,7 +108,7 @@ export = { }, }; -function makeAutoScalingGroup(scope: cdk.Construct) { +function makeAutoScalingGroup(scope: Construct) { const vpc = new ec2.Vpc(scope, 'VPC'); return new autoscaling.AutoScalingGroup(scope, 'ASG', { vpc, diff --git a/packages/@aws-cdk/aws-autoscalingplans/package.json b/packages/@aws-cdk/aws-autoscalingplans/package.json index fb38d6163ae88..33d06952fd906 100644 --- a/packages/@aws-cdk/aws-autoscalingplans/package.json +++ b/packages/@aws-cdk/aws-autoscalingplans/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 99301fde7bde9..3476b56817dc1 100644 --- a/packages/@aws-cdk/aws-backup/lib/plan.ts +++ b/packages/@aws-cdk/aws-backup/lib/plan.ts @@ -1,4 +1,5 @@ -import { Construct, IResource, Lazy, Resource } from '@aws-cdk/core'; +import { IResource, Lazy, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnBackupPlan } from './backup.generated'; import { BackupPlanRule } from './rule'; import { BackupSelection, BackupSelectionOptions } from './selection'; diff --git a/packages/@aws-cdk/aws-backup/lib/resource.ts b/packages/@aws-cdk/aws-backup/lib/resource.ts index c0cd0fd2b8878..07ac3f2103ec0 100644 --- a/packages/@aws-cdk/aws-backup/lib/resource.ts +++ b/packages/@aws-cdk/aws-backup/lib/resource.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 { Construct, Stack } from '@aws-cdk/core'; +import { Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * An operation that is applied to a key-value pair diff --git a/packages/@aws-cdk/aws-backup/lib/selection.ts b/packages/@aws-cdk/aws-backup/lib/selection.ts index 4e1ba54b472cb..63d69e8679142 100644 --- a/packages/@aws-cdk/aws-backup/lib/selection.ts +++ b/packages/@aws-cdk/aws-backup/lib/selection.ts @@ -1,5 +1,7 @@ import * as iam from '@aws-cdk/aws-iam'; -import { Construct, Lazy, Resource } from '@aws-cdk/core'; +import { Aspects, Lazy, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; + import { CfnBackupSelection } from './backup.generated'; import { BackupableResourcesCollector } from './backupable-resources-collector'; import { IBackupPlan } from './plan'; @@ -126,7 +128,7 @@ export class BackupSelection extends Resource implements iam.IGrantable { } if (resource.construct) { - resource.construct.node.applyAspect(this.backupableResourcesCollector); + Aspects.of(resource.construct).apply(this.backupableResourcesCollector); // Cannot push `this.backupableResourcesCollector.resources` to // `this.resources` here because it has not been evaluated yet. // Will be concatenated to `this.resources` in a `Lazy.listValue` diff --git a/packages/@aws-cdk/aws-backup/lib/vault.ts b/packages/@aws-cdk/aws-backup/lib/vault.ts index e9f85d8b160b1..2ce17af04a5a2 100644 --- a/packages/@aws-cdk/aws-backup/lib/vault.ts +++ b/packages/@aws-cdk/aws-backup/lib/vault.ts @@ -1,7 +1,9 @@ import * as iam from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; import * as sns from '@aws-cdk/aws-sns'; -import { Construct, IResource, RemovalPolicy, Resource } from '@aws-cdk/core'; +import { IResource, RemovalPolicy, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; + import { CfnBackupVault } from './backup.generated'; /** diff --git a/packages/@aws-cdk/aws-backup/package.json b/packages/@aws-cdk/aws-backup/package.json index 43461ce79359f..ee3f9d9bb52df 100644 --- a/packages/@aws-cdk/aws-backup/package.json +++ b/packages/@aws-cdk/aws-backup/package.json @@ -81,7 +81,7 @@ "@aws-cdk/aws-rds": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/aws-dynamodb": "0.0.0", @@ -93,7 +93,7 @@ "@aws-cdk/aws-rds": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-backup/test/integ.backup.ts b/packages/@aws-cdk/aws-backup/test/integ.backup.ts index a45a5abbfa077..bf71de03a1cb8 100644 --- a/packages/@aws-cdk/aws-backup/test/integ.backup.ts +++ b/packages/@aws-cdk/aws-backup/test/integ.backup.ts @@ -1,6 +1,7 @@ import * as dynamodb from '@aws-cdk/aws-dynamodb'; import * as efs from '@aws-cdk/aws-efs'; -import { App, Construct, RemovalPolicy, Stack, StackProps } from '@aws-cdk/core'; +import { App, RemovalPolicy, Stack, StackProps } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as backup from '../lib'; class TestStack extends Stack { diff --git a/packages/@aws-cdk/aws-backup/test/selection.test.ts b/packages/@aws-cdk/aws-backup/test/selection.test.ts index 75d1f6e6eade8..25b0816721e39 100644 --- a/packages/@aws-cdk/aws-backup/test/selection.test.ts +++ b/packages/@aws-cdk/aws-backup/test/selection.test.ts @@ -2,7 +2,8 @@ import '@aws-cdk/assert/jest'; 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 { Construct, Stack } from '@aws-cdk/core'; +import { Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { BackupPlan, BackupResource, BackupSelection } from '../lib'; let stack: Stack; diff --git a/packages/@aws-cdk/aws-batch/lib/compute-environment.ts b/packages/@aws-cdk/aws-batch/lib/compute-environment.ts index 5d18ae0ca635e..82c11c09d29b9 100644 --- a/packages/@aws-cdk/aws-batch/lib/compute-environment.ts +++ b/packages/@aws-cdk/aws-batch/lib/compute-environment.ts @@ -1,6 +1,7 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; -import { Construct, IResource, Resource, Stack, Tag } from '@aws-cdk/core'; +import { IResource, Resource, Stack, Tag } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnComputeEnvironment } from './batch.generated'; /** 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 1d075c7e2d756..a1913a2f7e641 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 @@ -1,6 +1,6 @@ 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 { JobDefinitionContainer } from './job-definition'; /** @@ -58,13 +58,13 @@ export class JobDefinitionImageConfig { */ public readonly imageName: string; - constructor(scope: cdk.Construct, container: JobDefinitionContainer) { + constructor(scope: Construct, container: JobDefinitionContainer) { const config = this.bindImageConfig(scope, container); this.imageName = config.imageName; } - private bindImageConfig(scope: cdk.Construct, container: JobDefinitionContainer): ecs.ContainerImageConfig { + private bindImageConfig(scope: Construct, container: JobDefinitionContainer): ecs.ContainerImageConfig { return container.image.bind(scope, new ecs.ContainerDefinition(scope, 'Resource-Batch-Job-Container-Definition', { command: container.command, cpu: container.vcpus, diff --git a/packages/@aws-cdk/aws-batch/lib/job-definition.ts b/packages/@aws-cdk/aws-batch/lib/job-definition.ts index 23aba0289c9e1..9ff2f40c585d2 100644 --- a/packages/@aws-cdk/aws-batch/lib/job-definition.ts +++ b/packages/@aws-cdk/aws-batch/lib/job-definition.ts @@ -1,7 +1,8 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as ecs from '@aws-cdk/aws-ecs'; import * as iam from '@aws-cdk/aws-iam'; -import { Construct, Duration, IResource, Resource, Stack } from '@aws-cdk/core'; +import { Duration, IResource, Resource, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnJobDefinition } from './batch.generated'; import { JobDefinitionImageConfig } from './job-definition-image-config'; diff --git a/packages/@aws-cdk/aws-batch/lib/job-queue.ts b/packages/@aws-cdk/aws-batch/lib/job-queue.ts index f501331054e11..0b5943b3fac91 100644 --- a/packages/@aws-cdk/aws-batch/lib/job-queue.ts +++ b/packages/@aws-cdk/aws-batch/lib/job-queue.ts @@ -1,4 +1,5 @@ -import { Construct, IResource, Resource, Stack } from '@aws-cdk/core'; +import { IResource, Resource, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnJobQueue } from './batch.generated'; import { IComputeEnvironment } from './compute-environment'; diff --git a/packages/@aws-cdk/aws-batch/package.json b/packages/@aws-cdk/aws-batch/package.json index 958c8a3b3ab96..03cf0b3a097ac 100644 --- a/packages/@aws-cdk/aws-batch/package.json +++ b/packages/@aws-cdk/aws-batch/package.json @@ -76,7 +76,7 @@ "@aws-cdk/aws-ecr": "0.0.0", "@aws-cdk/aws-ecs": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -85,7 +85,7 @@ "@aws-cdk/aws-ecr": "0.0.0", "@aws-cdk/aws-ecs": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 72264798000e0..665e1f65bad6d 100644 --- a/packages/@aws-cdk/aws-budgets/package.json +++ b/packages/@aws-cdk/aws-budgets/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-certificatemanager/lib/certificate.ts b/packages/@aws-cdk/aws-certificatemanager/lib/certificate.ts index fcc7ec3cf33c2..24a66b0678cb2 100644 --- a/packages/@aws-cdk/aws-certificatemanager/lib/certificate.ts +++ b/packages/@aws-cdk/aws-certificatemanager/lib/certificate.ts @@ -1,4 +1,5 @@ -import { Construct, IResource, Resource, Token } from '@aws-cdk/core'; +import { IResource, Resource, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnCertificate } from './certificatemanager.generated'; import { apexDomain } from './util'; 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 d6b7a18a345e3..2c03e138aed13 100644 --- a/packages/@aws-cdk/aws-certificatemanager/lib/dns-validated-certificate.ts +++ b/packages/@aws-cdk/aws-certificatemanager/lib/dns-validated-certificate.ts @@ -2,6 +2,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as lambda from '@aws-cdk/aws-lambda'; import * as route53 from '@aws-cdk/aws-route53'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as path from 'path'; import { CertificateProps, ICertificate } from './certificate'; @@ -60,7 +61,7 @@ export class DnsValidatedCertificate extends cdk.Resource implements ICertificat private hostedZoneId: string; private domainName: string; - constructor(scope: cdk.Construct, id: string, props: DnsValidatedCertificateProps) { + constructor(scope: Construct, id: string, props: DnsValidatedCertificateProps) { super(scope, id); this.domainName = props.domainName; diff --git a/packages/@aws-cdk/aws-certificatemanager/package.json b/packages/@aws-cdk/aws-certificatemanager/package.json index adb40b6ddbe4e..ea1e12a742290 100644 --- a/packages/@aws-cdk/aws-certificatemanager/package.json +++ b/packages/@aws-cdk/aws-certificatemanager/package.json @@ -74,7 +74,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-route53": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -82,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.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-certificatemanager/test/example.dns-validated-request.lit.ts b/packages/@aws-cdk/aws-certificatemanager/test/example.dns-validated-request.lit.ts index 3852b9ea8ac6c..b30827a63173d 100644 --- a/packages/@aws-cdk/aws-certificatemanager/test/example.dns-validated-request.lit.ts +++ b/packages/@aws-cdk/aws-certificatemanager/test/example.dns-validated-request.lit.ts @@ -1,5 +1,6 @@ import * as route53 from '@aws-cdk/aws-route53'; -import { App, Construct, Stack } from '@aws-cdk/core'; +import { App, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as certmgr from '../lib'; class CertStack extends Stack { diff --git a/packages/@aws-cdk/aws-certificatemanager/test/example.simple-request.lit.ts b/packages/@aws-cdk/aws-certificatemanager/test/example.simple-request.lit.ts index 36ce17dd9d6a4..b03d5b32e7ae7 100644 --- a/packages/@aws-cdk/aws-certificatemanager/test/example.simple-request.lit.ts +++ b/packages/@aws-cdk/aws-certificatemanager/test/example.simple-request.lit.ts @@ -1,4 +1,5 @@ -import { App, CfnOutput, Construct, Stack } from '@aws-cdk/core'; +import { App, CfnOutput, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as certmgr from '../lib'; class CertStack extends Stack { diff --git a/packages/@aws-cdk/aws-cloud9/lib/environment.ts b/packages/@aws-cdk/aws-cloud9/lib/environment.ts index d414069e2788b..a28b2627c3b34 100644 --- a/packages/@aws-cdk/aws-cloud9/lib/environment.ts +++ b/packages/@aws-cdk/aws-cloud9/lib/environment.ts @@ -1,6 +1,7 @@ import * as codecommit from '@aws-cdk/aws-codecommit'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnEnvironmentEC2 } from '../lib/cloud9.generated'; /** @@ -79,7 +80,7 @@ export class Ec2Environment extends cdk.Resource implements IEc2Environment { /** * import from EnvironmentEc2Name */ - public static fromEc2EnvironmentName(scope: cdk.Construct, id: string, ec2EnvironmentName: string): IEc2Environment { + public static fromEc2EnvironmentName(scope: Construct, id: string, ec2EnvironmentName: string): IEc2Environment { class Import extends cdk.Resource { public ec2EnvironmentName = ec2EnvironmentName; public ec2EnvironmentArn = cdk.Stack.of(this).formatArn({ @@ -120,7 +121,7 @@ export class Ec2Environment extends cdk.Resource implements IEc2Environment { */ public readonly vpc: ec2.IVpc; - constructor(scope: cdk.Construct, id: string, props: Ec2EnvironmentProps) { + constructor(scope: Construct, id: string, props: Ec2EnvironmentProps) { super(scope, id); this.vpc = props.vpc; diff --git a/packages/@aws-cdk/aws-cloud9/package.json b/packages/@aws-cdk/aws-cloud9/package.json index 8bb9f055c5d9d..977a087bc3ec6 100644 --- a/packages/@aws-cdk/aws-cloud9/package.json +++ b/packages/@aws-cdk/aws-cloud9/package.json @@ -74,14 +74,14 @@ "@aws-cdk/core": "0.0.0", "@aws-cdk/aws-codecommit": "0.0.0", "@aws-cdk/aws-ec2": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-cloud9/test/integ.cloud9.ts b/packages/@aws-cdk/aws-cloud9/test/integ.cloud9.ts index d2d008687f429..6ddc1d55e89a2 100644 --- a/packages/@aws-cdk/aws-cloud9/test/integ.cloud9.ts +++ b/packages/@aws-cdk/aws-cloud9/test/integ.cloud9.ts @@ -1,10 +1,11 @@ import * as codecommit from '@aws-cdk/aws-codecommit'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as cloud9 from '../lib'; export class Cloud9Env extends cdk.Stack { - constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) { + constructor(scope: Construct, id: string, props?: cdk.StackProps) { super(scope, id, props); const vpc = new ec2.Vpc(this, 'VPC', { diff --git a/packages/@aws-cdk/aws-cloudformation/lib/custom-resource.ts b/packages/@aws-cdk/aws-cloudformation/lib/custom-resource.ts index 6db44400cfa89..4da65ab69b1d0 100644 --- a/packages/@aws-cdk/aws-cloudformation/lib/custom-resource.ts +++ b/packages/@aws-cdk/aws-cloudformation/lib/custom-resource.ts @@ -1,6 +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'; +import { Construct } from 'constructs'; /** * Collection of arbitrary properties @@ -28,7 +29,7 @@ export interface ICustomResourceProvider { * @param scope The resource that uses this provider. * @returns provider configuration */ - bind(scope: core.Construct): CustomResourceProviderConfig; + bind(scope: Construct): CustomResourceProviderConfig; } /** @@ -68,7 +69,7 @@ export class CustomResourceProvider implements ICustomResourceProvider { */ private constructor(public readonly serviceToken: string) { } - public bind(_: core.Construct): CustomResourceProviderConfig { + public bind(_: Construct): CustomResourceProviderConfig { return { serviceToken: this.serviceToken }; } } @@ -151,7 +152,7 @@ export interface CustomResourceProps { * @deprecated use `core.CustomResource` */ export class CustomResource extends core.CustomResource { - constructor(scope: core.Construct, id: string, props: CustomResourceProps) { + constructor(scope: Construct, id: string, props: CustomResourceProps) { super(scope, id, { pascalCaseProperties: true, properties: props.properties, diff --git a/packages/@aws-cdk/aws-cloudformation/lib/nested-stack.ts b/packages/@aws-cdk/aws-cloudformation/lib/nested-stack.ts index bb9481d2a75c2..0f32579101427 100644 --- a/packages/@aws-cdk/aws-cloudformation/lib/nested-stack.ts +++ b/packages/@aws-cdk/aws-cloudformation/lib/nested-stack.ts @@ -1,5 +1,6 @@ import * as sns from '@aws-cdk/aws-sns'; import * as core from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Initialization props for the `NestedStack` construct. @@ -63,7 +64,7 @@ export interface NestedStackProps { * @experimental */ export class NestedStack extends core.NestedStack { - constructor(scope: core.Construct, id: string, props: NestedStackProps = { }) { + constructor(scope: Construct, id: string, props: NestedStackProps = { }) { super(scope, id, { parameters: props.parameters, timeout: props.timeout, diff --git a/packages/@aws-cdk/aws-cloudformation/package.json b/packages/@aws-cdk/aws-cloudformation/package.json index f458900221640..e52f11a6126c1 100644 --- a/packages/@aws-cdk/aws-cloudformation/package.json +++ b/packages/@aws-cdk/aws-cloudformation/package.json @@ -83,7 +83,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -93,7 +93,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 2c219f757825d..9441600af6843 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 @@ -6,7 +6,8 @@ * - GetAtt.Attribute1: "foo" * - GetAtt.Attribute2: 1234 */ -import { App, CfnOutput, Construct, CustomResource, CustomResourceProvider, CustomResourceProviderRuntime, Stack, Token } from '@aws-cdk/core'; +import { App, CfnOutput, CustomResource, CustomResourceProvider, CustomResourceProviderRuntime, Stack, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; class TestStack extends Stack { constructor(scope: Construct, id: string) { 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 c0afbe7e760bc..4fed9722407d7 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stack.ts +++ b/packages/@aws-cdk/aws-cloudformation/test/integ.nested-stack.ts @@ -2,7 +2,8 @@ import * as lambda from '@aws-cdk/aws-lambda'; import * as sns from '@aws-cdk/aws-sns'; import * as sns_subscriptions from '@aws-cdk/aws-sns-subscriptions'; import * as sqs from '@aws-cdk/aws-sqs'; -import { App, CfnParameter, Construct, Stack } from '@aws-cdk/core'; +import { App, CfnParameter, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as cfn from '../lib'; interface MyNestedStackProps { 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 02f2a1e55b638..b18d9e69738d2 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 @@ -1,5 +1,6 @@ import * as lambda from '@aws-cdk/aws-lambda'; -import { App, Construct, Stack } from '@aws-cdk/core'; +import { App, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as path from 'path'; import * as cfn from '../lib'; 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 160fa076e7b01..2d9d0435cbd05 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 @@ -1,5 +1,6 @@ import * as sns from '@aws-cdk/aws-sns'; -import { App, Construct, Stack } from '@aws-cdk/core'; +import { App, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as cfn from '../lib'; class YourNestedStack extends cfn.NestedStack { 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 a563445adaedd..4cdb316d2e91b 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 @@ -3,7 +3,8 @@ // nested stack references a resource from a non-nested non-parent stack import * as sns from '@aws-cdk/aws-sns'; -import { App, Construct, Stack } from '@aws-cdk/core'; +import { App, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as cfn from '../lib'; class ConsumerNestedStack extends cfn.NestedStack { 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 74efee0c43e85..887588446e6a3 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 @@ -1,6 +1,7 @@ /// !cdk-integ * import * as sns from '@aws-cdk/aws-sns'; -import { App, Construct, Fn, Stack } from '@aws-cdk/core'; +import { App, Fn, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as cfn from '../lib'; // non-nested non-parent stack consumes a resource from a nested stack 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 87b6f587a5ef5..356242cdceb42 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 @@ -1,6 +1,7 @@ /// !cdk-integ * import * as sns from '@aws-cdk/aws-sns'; -import { App, Construct, Fn, Stack } from '@aws-cdk/core'; +import { App, Fn, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as cfn from '../lib'; // references between siblings 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 2eb4618612a11..9b482e5a94141 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,5 +1,6 @@ import * as lambda from '@aws-cdk/aws-lambda'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as fs from 'fs'; import { CustomResource, CustomResourceProvider } from '../lib'; @@ -15,10 +16,10 @@ interface DemoResourceProps { failCreate?: boolean; } -class DemoResource extends cdk.Construct { +class DemoResource extends Construct { public readonly response: string; - constructor(scope: cdk.Construct, id: string, props: DemoResourceProps) { + constructor(scope: Construct, id: string, props: DemoResourceProps) { super(scope, id); const resource = new CustomResource(this, 'Resource', { 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 4a71ab81e0ea3..bb2e37e12c851 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/test.nested-stack.ts +++ b/packages/@aws-cdk/aws-cloudformation/test/test.nested-stack.ts @@ -1,7 +1,8 @@ import { expect, haveResource, matchTemplate, SynthUtils } from '@aws-cdk/assert'; import * as s3_assets from '@aws-cdk/aws-s3-assets'; import * as sns from '@aws-cdk/aws-sns'; -import { App, CfnParameter, CfnResource, Construct, ContextProvider, Stack } from '@aws-cdk/core'; +import { App, CfnParameter, CfnResource, ContextProvider, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as fs from 'fs'; import { Test } from 'nodeunit'; import * as path from 'path'; diff --git a/packages/@aws-cdk/aws-cloudformation/test/test.resource.ts b/packages/@aws-cdk/aws-cloudformation/test/test.resource.ts index b66d845634353..4a54f541abd58 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/test.resource.ts +++ b/packages/@aws-cdk/aws-cloudformation/test/test.resource.ts @@ -2,6 +2,7 @@ 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'; @@ -208,10 +209,10 @@ export = testCase({ }, }); -class TestCustomResource extends cdk.Construct { +class TestCustomResource extends Construct { public readonly resource: CustomResource; - constructor(scope: cdk.Construct, id: string, opts: { removalPolicy?: cdk.RemovalPolicy } = {}) { + constructor(scope: Construct, id: string, opts: { removalPolicy?: cdk.RemovalPolicy } = {}) { super(scope, id); const singletonLambda = new lambda.SingletonFunction(this, 'Lambda', { diff --git a/packages/@aws-cdk/aws-cloudfront/lib/origin_access_identity.ts b/packages/@aws-cdk/aws-cloudfront/lib/origin_access_identity.ts index 39eca95d01803..a8823306c4d1e 100644 --- a/packages/@aws-cdk/aws-cloudfront/lib/origin_access_identity.ts +++ b/packages/@aws-cdk/aws-cloudfront/lib/origin_access_identity.ts @@ -1,5 +1,6 @@ import * as iam from '@aws-cdk/aws-iam'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnCloudFrontOriginAccessIdentity } from './cloudfront.generated'; /** @@ -62,14 +63,14 @@ export class OriginAccessIdentity extends OriginAccessIdentityBase implements IO * Creates a OriginAccessIdentity by providing the OriginAccessIdentityName */ public static fromOriginAccessIdentityName( - scope: cdk.Construct, + scope: Construct, id: string, originAccessIdentityName: string): IOriginAccessIdentity { class Import extends OriginAccessIdentityBase { public readonly originAccessIdentityName = originAccessIdentityName; public readonly grantPrincipal = new iam.ArnPrincipal(this.arn()); - constructor(s: cdk.Construct, i: string) { + constructor(s: Construct, i: string) { super(s, i, { physicalName: originAccessIdentityName }); } } @@ -103,7 +104,7 @@ export class OriginAccessIdentity extends OriginAccessIdentityBase implements IO */ private readonly resource: CfnCloudFrontOriginAccessIdentity; - constructor(scope: cdk.Construct, id: string, props?: OriginAccessIdentityProps) { + constructor(scope: Construct, id: string, props?: OriginAccessIdentityProps) { super(scope, id); this.resource = new CfnCloudFrontOriginAccessIdentity(this, 'Resource', { diff --git a/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts b/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts index ab5eda0eb0834..856e40a299219 100644 --- a/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts +++ b/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts @@ -3,6 +3,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 cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnDistribution } from './cloudfront.generated'; import { IDistribution } from './distribution'; import { IOriginAccessIdentity } from './origin_access_identity'; @@ -674,7 +675,7 @@ interface BehaviorWithOrigin extends Behavior { * * */ -export class CloudFrontWebDistribution extends cdk.Construct implements IDistribution { +export class CloudFrontWebDistribution extends Construct implements IDistribution { /** * The logging bucket for this CloudFront distribution. * If logging is not enabled for this distribution - this property will be undefined. @@ -713,7 +714,7 @@ export class CloudFrontWebDistribution extends cdk.Construct implements IDistrib [SSLMethod.VIP]: [SecurityPolicyProtocol.SSL_V3, SecurityPolicyProtocol.TLS_V1], }; - constructor(scope: cdk.Construct, id: string, props: CloudFrontWebDistributionProps) { + constructor(scope: Construct, id: string, props: CloudFrontWebDistributionProps) { super(scope, id); let distributionConfig: CfnDistribution.DistributionConfigProperty = { diff --git a/packages/@aws-cdk/aws-cloudfront/package.json b/packages/@aws-cdk/aws-cloudfront/package.json index 8c2f655f0ad81..bcb3052981e62 100644 --- a/packages/@aws-cdk/aws-cloudfront/package.json +++ b/packages/@aws-cdk/aws-cloudfront/package.json @@ -78,7 +78,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -88,7 +88,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-cloudfront/test/example.acm-cert-alias.lit.ts b/packages/@aws-cdk/aws-cloudfront/test/example.acm-cert-alias.lit.ts index 6980e248e7c27..861df3df10bdd 100644 --- a/packages/@aws-cdk/aws-cloudfront/test/example.acm-cert-alias.lit.ts +++ b/packages/@aws-cdk/aws-cloudfront/test/example.acm-cert-alias.lit.ts @@ -1,6 +1,7 @@ import * as certificatemanager from '@aws-cdk/aws-certificatemanager'; import * as s3 from '@aws-cdk/aws-s3'; -import { App, Construct, Stack } from '@aws-cdk/core'; +import { App, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as cloudfront from '../lib'; class AcmCertificateAliasStack extends Stack { diff --git a/packages/@aws-cdk/aws-cloudfront/test/example.default-cert-alias.lit.ts b/packages/@aws-cdk/aws-cloudfront/test/example.default-cert-alias.lit.ts index 8b1e24e88addb..68882bcb9b7ee 100644 --- a/packages/@aws-cdk/aws-cloudfront/test/example.default-cert-alias.lit.ts +++ b/packages/@aws-cdk/aws-cloudfront/test/example.default-cert-alias.lit.ts @@ -1,5 +1,6 @@ import * as s3 from '@aws-cdk/aws-s3'; -import { App, Construct, Stack } from '@aws-cdk/core'; +import { App, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as cloudfront from '../lib'; class AcmCertificateAliasStack extends Stack { diff --git a/packages/@aws-cdk/aws-cloudfront/test/example.iam-cert-alias.lit.ts b/packages/@aws-cdk/aws-cloudfront/test/example.iam-cert-alias.lit.ts index 36ee43e180771..9c8f50f191c9f 100644 --- a/packages/@aws-cdk/aws-cloudfront/test/example.iam-cert-alias.lit.ts +++ b/packages/@aws-cdk/aws-cloudfront/test/example.iam-cert-alias.lit.ts @@ -1,5 +1,6 @@ import * as s3 from '@aws-cdk/aws-s3'; -import { App, Construct, Stack } from '@aws-cdk/core'; +import { App, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as cloudfront from '../lib'; class AcmCertificateAliasStack extends Stack { diff --git a/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-custom-s3.ts b/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-custom-s3.ts index 587f648cd044d..79ebb4c45d94a 100644 --- a/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-custom-s3.ts +++ b/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-custom-s3.ts @@ -1,5 +1,6 @@ import * as s3 from '@aws-cdk/aws-s3'; -import { App, Construct, Stack } from '@aws-cdk/core'; +import { App, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as cloudfront from '../lib'; class TestStack extends Stack { diff --git a/packages/@aws-cdk/aws-cloudtrail/lib/cloudtrail.ts b/packages/@aws-cdk/aws-cloudtrail/lib/cloudtrail.ts index a802c32d79d9f..5f8504197f342 100644 --- a/packages/@aws-cdk/aws-cloudtrail/lib/cloudtrail.ts +++ b/packages/@aws-cdk/aws-cloudtrail/lib/cloudtrail.ts @@ -5,7 +5,8 @@ import * as lambda from '@aws-cdk/aws-lambda'; import * as logs from '@aws-cdk/aws-logs'; import * as s3 from '@aws-cdk/aws-s3'; import * as sns from '@aws-cdk/aws-sns'; -import { Construct, Resource, Stack } from '@aws-cdk/core'; +import { Resource, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnTrail } from './cloudtrail.generated'; /** diff --git a/packages/@aws-cdk/aws-cloudtrail/package.json b/packages/@aws-cdk/aws-cloudtrail/package.json index 0582cc87ac301..235774d2a52c3 100644 --- a/packages/@aws-cdk/aws-cloudtrail/package.json +++ b/packages/@aws-cdk/aws-cloudtrail/package.json @@ -81,7 +81,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -93,7 +93,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 2241796f47d2b..d548120e1c716 100644 --- a/packages/@aws-cdk/aws-cloudwatch-actions/lib/appscaling.ts +++ b/packages/@aws-cdk/aws-cloudwatch-actions/lib/appscaling.ts @@ -1,6 +1,6 @@ import * as appscaling from '@aws-cdk/aws-applicationautoscaling'; import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Use an ApplicationAutoScaling StepScalingAction as an Alarm Action @@ -13,7 +13,7 @@ export class ApplicationScalingAction implements cloudwatch.IAlarmAction { * Returns an alarm action configuration to use an ApplicationScaling StepScalingAction * as an alarm action */ - public bind(_scope: cdk.Construct, _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-cloudwatch-actions/lib/autoscaling.ts b/packages/@aws-cdk/aws-cloudwatch-actions/lib/autoscaling.ts index 5ec6e62fe246c..0c4ad825572c9 100644 --- a/packages/@aws-cdk/aws-cloudwatch-actions/lib/autoscaling.ts +++ b/packages/@aws-cdk/aws-cloudwatch-actions/lib/autoscaling.ts @@ -1,6 +1,6 @@ import * as autoscaling from '@aws-cdk/aws-autoscaling'; import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Use an AutoScaling StepScalingAction as an Alarm Action @@ -13,7 +13,7 @@ export class AutoScalingAction implements cloudwatch.IAlarmAction { * Returns an alarm action configuration to use an AutoScaling StepScalingAction * as an alarm action */ - public bind(_scope: cdk.Construct, _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-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 b0fda2aa4968d..c062d152c1a6a 100644 --- a/packages/@aws-cdk/aws-cloudwatch-actions/package.json +++ b/packages/@aws-cdk/aws-cloudwatch-actions/package.json @@ -73,7 +73,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -83,7 +83,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 7b48d0f055873..66e47e8568d5f 100644 --- a/packages/@aws-cdk/aws-cloudwatch/lib/alarm-action.ts +++ b/packages/@aws-cdk/aws-cloudwatch/lib/alarm-action.ts @@ -1,4 +1,4 @@ -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { IAlarm } from './alarm-base'; /** diff --git a/packages/@aws-cdk/aws-cloudwatch/lib/alarm.ts b/packages/@aws-cdk/aws-cloudwatch/lib/alarm.ts index 299220eb8d42f..0e251c0a87a26 100644 --- a/packages/@aws-cdk/aws-cloudwatch/lib/alarm.ts +++ b/packages/@aws-cdk/aws-cloudwatch/lib/alarm.ts @@ -1,4 +1,5 @@ -import { Construct, Lazy, Stack, Token } from '@aws-cdk/core'; +import { Lazy, Stack, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { AlarmBase, IAlarm } from './alarm-base'; import { CfnAlarm, CfnAlarmProps } from './cloudwatch.generated'; import { HorizontalAnnotation } from './graph'; diff --git a/packages/@aws-cdk/aws-cloudwatch/lib/composite-alarm.ts b/packages/@aws-cdk/aws-cloudwatch/lib/composite-alarm.ts index 4d20f5f3f1300..6f889b5762b58 100644 --- a/packages/@aws-cdk/aws-cloudwatch/lib/composite-alarm.ts +++ b/packages/@aws-cdk/aws-cloudwatch/lib/composite-alarm.ts @@ -1,4 +1,5 @@ -import { Construct, Lazy, Stack } from '@aws-cdk/core'; +import { Lazy, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { AlarmBase, IAlarm, IAlarmRule } from './alarm-base'; import { CfnCompositeAlarm } from './cloudwatch.generated'; diff --git a/packages/@aws-cdk/aws-cloudwatch/lib/dashboard.ts b/packages/@aws-cdk/aws-cloudwatch/lib/dashboard.ts index bee34bc87b518..16d0ba487773d 100644 --- a/packages/@aws-cdk/aws-cloudwatch/lib/dashboard.ts +++ b/packages/@aws-cdk/aws-cloudwatch/lib/dashboard.ts @@ -1,4 +1,5 @@ -import { Construct, Lazy, Resource, Stack, Token } from '@aws-cdk/core'; +import { Lazy, Resource, Stack, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnDashboard } from './cloudwatch.generated'; import { Column, Row } from './layout'; import { IWidget } from './widget'; diff --git a/packages/@aws-cdk/aws-cloudwatch/lib/metric.ts b/packages/@aws-cdk/aws-cloudwatch/lib/metric.ts index e554edf80cc8d..f20471f1e7eee 100644 --- a/packages/@aws-cdk/aws-cloudwatch/lib/metric.ts +++ b/packages/@aws-cdk/aws-cloudwatch/lib/metric.ts @@ -1,5 +1,6 @@ import * as iam from '@aws-cdk/aws-iam'; import * as cdk from '@aws-cdk/core'; +import { Construct } 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'; @@ -272,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: cdk.Construct): Metric { + public attachTo(scope: Construct): Metric { const stack = cdk.Stack.of(scope); return this.with({ @@ -350,7 +351,7 @@ export class Metric implements IMetric { * Combines both properties that may adjust the metric (aggregation) as well * as alarm properties. */ - public createAlarm(scope: cdk.Construct, id: string, props: CreateAlarmOptions): Alarm { + public createAlarm(scope: Construct, id: string, props: CreateAlarmOptions): Alarm { return new Alarm(scope, id, { metric: this.with({ statistic: props.statistic, @@ -502,7 +503,7 @@ export class MathExpression implements IMetric { * Combines both properties that may adjust the metric (aggregation) as well * as alarm properties. */ - public createAlarm(scope: cdk.Construct, id: string, props: CreateAlarmOptions): Alarm { + public createAlarm(scope: Construct, id: string, props: CreateAlarmOptions): Alarm { return new Alarm(scope, id, { metric: this.with({ period: props.period, diff --git a/packages/@aws-cdk/aws-cloudwatch/package.json b/packages/@aws-cdk/aws-cloudwatch/package.json index 7d9738d6f98b3..1d0fba8dda1ea 100644 --- a/packages/@aws-cdk/aws-cloudwatch/package.json +++ b/packages/@aws-cdk/aws-cloudwatch/package.json @@ -73,13 +73,13 @@ "dependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "awslint": { "exclude": [ diff --git a/packages/@aws-cdk/aws-cloudwatch/test/test.alarm.ts b/packages/@aws-cdk/aws-cloudwatch/test/test.alarm.ts index c86fca7f6a22d..6b863af88b1cd 100644 --- a/packages/@aws-cdk/aws-cloudwatch/test/test.alarm.ts +++ b/packages/@aws-cdk/aws-cloudwatch/test/test.alarm.ts @@ -1,5 +1,6 @@ import { ABSENT, expect, haveResource } from '@aws-cdk/assert'; -import { Construct, Duration, Stack } from '@aws-cdk/core'; +import { Duration, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Test } from 'nodeunit'; import { Alarm, IAlarm, IAlarmAction, Metric } from '../lib'; diff --git a/packages/@aws-cdk/aws-codebuild/lib/artifacts.ts b/packages/@aws-cdk/aws-codebuild/lib/artifacts.ts index eda705fe16860..bbf84ed26c4b3 100644 --- a/packages/@aws-cdk/aws-codebuild/lib/artifacts.ts +++ b/packages/@aws-cdk/aws-codebuild/lib/artifacts.ts @@ -1,5 +1,5 @@ import * as s3 from '@aws-cdk/aws-s3'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnProject } from './codebuild.generated'; import { IProject } from './project'; diff --git a/packages/@aws-cdk/aws-codebuild/lib/file-location.ts b/packages/@aws-cdk/aws-codebuild/lib/file-location.ts index d32e5fb15168f..fc57f64e3a61b 100644 --- a/packages/@aws-cdk/aws-codebuild/lib/file-location.ts +++ b/packages/@aws-cdk/aws-codebuild/lib/file-location.ts @@ -1,4 +1,4 @@ -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnProject } from './codebuild.generated'; import { IProject } from './project'; diff --git a/packages/@aws-cdk/aws-codebuild/lib/pipeline-project.ts b/packages/@aws-cdk/aws-codebuild/lib/pipeline-project.ts index 8c06e079b2a97..8986f8bc75c4b 100644 --- a/packages/@aws-cdk/aws-codebuild/lib/pipeline-project.ts +++ b/packages/@aws-cdk/aws-codebuild/lib/pipeline-project.ts @@ -1,4 +1,4 @@ -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CodePipelineArtifacts } from './codepipeline-artifacts'; import { CodePipelineSource } from './codepipeline-source'; import { CommonProjectProps, Project } from './project'; @@ -11,7 +11,7 @@ export interface PipelineProjectProps extends CommonProjectProps { * A convenience class for CodeBuild Projects that are used in CodePipeline. */ export class PipelineProject extends Project { - constructor(scope: cdk.Construct, id: string, props?: PipelineProjectProps) { + constructor(scope: Construct, id: string, props?: PipelineProjectProps) { super(scope, id, { source: new CodePipelineSource(), artifacts: new CodePipelineArtifacts(), diff --git a/packages/@aws-cdk/aws-codebuild/lib/project.ts b/packages/@aws-cdk/aws-codebuild/lib/project.ts index d4f349431b544..0a0a815dac45c 100644 --- a/packages/@aws-cdk/aws-codebuild/lib/project.ts +++ b/packages/@aws-cdk/aws-codebuild/lib/project.ts @@ -7,7 +7,8 @@ import * as iam from '@aws-cdk/aws-iam'; 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, Construct, Duration, IResource, Lazy, PhysicalName, Resource, Stack } from '@aws-cdk/core'; +import { Aws, Duration, IResource, Lazy, PhysicalName, Resource, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { IArtifacts } from './artifacts'; import { BuildSpec } from './build-spec'; import { Cache } from './cache'; diff --git a/packages/@aws-cdk/aws-codebuild/lib/report-group-utils.ts b/packages/@aws-cdk/aws-codebuild/lib/report-group-utils.ts index c830737d14649..9789807652866 100644 --- a/packages/@aws-cdk/aws-codebuild/lib/report-group-utils.ts +++ b/packages/@aws-cdk/aws-codebuild/lib/report-group-utils.ts @@ -1,10 +1,11 @@ import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; // this file contains a bunch of functions shared // between Project and ResourceGroup, // which we don't want to make part of the public API of this module -export function renderReportGroupArn(scope: cdk.Construct, reportGroupName: string): string { +export function renderReportGroupArn(scope: Construct, reportGroupName: string): string { return cdk.Stack.of(scope).formatArn(reportGroupArnComponents(reportGroupName)); } diff --git a/packages/@aws-cdk/aws-codebuild/lib/report-group.ts b/packages/@aws-cdk/aws-codebuild/lib/report-group.ts index aa643b3e65cce..8e15a1726155e 100644 --- a/packages/@aws-cdk/aws-codebuild/lib/report-group.ts +++ b/packages/@aws-cdk/aws-codebuild/lib/report-group.ts @@ -1,6 +1,7 @@ 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 { CfnReportGroup } from './codebuild.generated'; import { renderReportGroupArn, reportGroupArnComponents } from './report-group-utils'; @@ -104,7 +105,7 @@ export class ReportGroup extends ReportGroupBase { * defined outside of the CDK code, * by name. */ - public static fromReportGroupName(scope: cdk.Construct, id: string, reportGroupName: string): IReportGroup { + public static fromReportGroupName(scope: Construct, id: string, reportGroupName: string): IReportGroup { class Import extends ReportGroupBase { public readonly reportGroupName = reportGroupName; public readonly reportGroupArn = renderReportGroupArn(scope, reportGroupName); @@ -118,7 +119,7 @@ export class ReportGroup extends ReportGroupBase { public readonly reportGroupName: string; protected readonly exportBucket?: s3.IBucket; - constructor(scope: cdk.Construct, id: string, props: ReportGroupProps = {}) { + constructor(scope: Construct, id: string, props: ReportGroupProps = {}) { super(scope, id, { physicalName: props.reportGroupName, }); diff --git a/packages/@aws-cdk/aws-codebuild/lib/source-credentials.ts b/packages/@aws-cdk/aws-codebuild/lib/source-credentials.ts index be5545f540ebd..f8f12a9958d71 100644 --- a/packages/@aws-cdk/aws-codebuild/lib/source-credentials.ts +++ b/packages/@aws-cdk/aws-codebuild/lib/source-credentials.ts @@ -1,4 +1,5 @@ -import { Construct, Resource, SecretValue } from '@aws-cdk/core'; +import { Resource, SecretValue } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnSourceCredential } from './codebuild.generated'; /** diff --git a/packages/@aws-cdk/aws-codebuild/lib/source.ts b/packages/@aws-cdk/aws-codebuild/lib/source.ts index a2853188f5412..53a7ae7d047b8 100644 --- a/packages/@aws-cdk/aws-codebuild/lib/source.ts +++ b/packages/@aws-cdk/aws-codebuild/lib/source.ts @@ -1,7 +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 '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnProject } from './codebuild.generated'; import { IProject } from './project'; import { diff --git a/packages/@aws-cdk/aws-codebuild/package.json b/packages/@aws-cdk/aws-codebuild/package.json index fe25059df3db7..ddfd79158f15d 100644 --- a/packages/@aws-cdk/aws-codebuild/package.json +++ b/packages/@aws-cdk/aws-codebuild/package.json @@ -91,7 +91,7 @@ "@aws-cdk/aws-s3-assets": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -108,7 +108,7 @@ "@aws-cdk/aws-s3-assets": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-codecommit/lib/repository.ts b/packages/@aws-cdk/aws-codecommit/lib/repository.ts index 7dfb132138936..65d801f3fc0dd 100644 --- a/packages/@aws-cdk/aws-codecommit/lib/repository.ts +++ b/packages/@aws-cdk/aws-codecommit/lib/repository.ts @@ -1,6 +1,7 @@ import * as events from '@aws-cdk/aws-events'; import * as iam from '@aws-cdk/aws-iam'; -import { Construct, IConstruct, IResource, Lazy, Resource, Stack } from '@aws-cdk/core'; +import { IResource, Lazy, Resource, Stack } from '@aws-cdk/core'; +import { Construct, IConstruct } from 'constructs'; import { CfnRepository } from './codecommit.generated'; export interface IRepository extends IResource { diff --git a/packages/@aws-cdk/aws-codecommit/package.json b/packages/@aws-cdk/aws-codecommit/package.json index 89a7688dd7b4e..4771e2e597860 100644 --- a/packages/@aws-cdk/aws-codecommit/package.json +++ b/packages/@aws-cdk/aws-codecommit/package.json @@ -81,14 +81,14 @@ "@aws-cdk/aws-events": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-codedeploy/lib/ecs/application.ts b/packages/@aws-cdk/aws-codedeploy/lib/ecs/application.ts index 7ab5833afbb10..e8a06374523b3 100644 --- a/packages/@aws-cdk/aws-codedeploy/lib/ecs/application.ts +++ b/packages/@aws-cdk/aws-codedeploy/lib/ecs/application.ts @@ -1,4 +1,5 @@ -import { Construct, IResource, Resource } from '@aws-cdk/core'; +import { IResource, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnApplication } from '../codedeploy.generated'; import { arnForApplication } from '../utils'; 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 9ebcc42724db8..f9f41e12202a7 100644 --- a/packages/@aws-cdk/aws-codedeploy/lib/ecs/deployment-config.ts +++ b/packages/@aws-cdk/aws-codedeploy/lib/ecs/deployment-config.ts @@ -1,4 +1,4 @@ -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { arnForDeploymentConfig } from '../utils'; /** @@ -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 */ @@ -35,7 +35,7 @@ export class EcsDeploymentConfig { * @param ecsDeploymentConfigName the name of the referenced custom Deployment Configuration * @returns a Construct representing a reference to an existing custom Deployment Configuration */ - public static fromEcsDeploymentConfigName(_scope: cdk.Construct, _id: string, ecsDeploymentConfigName: string): IEcsDeploymentConfig { + public static fromEcsDeploymentConfigName(_scope: Construct, _id: string, ecsDeploymentConfigName: string): IEcsDeploymentConfig { return deploymentConfig(ecsDeploymentConfigName); } 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 376e86aef2806..7664e616b0124 100644 --- a/packages/@aws-cdk/aws-codedeploy/lib/ecs/deployment-group.ts +++ b/packages/@aws-cdk/aws-codedeploy/lib/ecs/deployment-group.ts @@ -1,5 +1,5 @@ import * as cdk from '@aws-cdk/core'; - +import { Construct } from 'constructs'; import { arnForDeploymentGroup } from '../utils'; import { IEcsApplication } from './application'; import { EcsDeploymentConfig, IEcsDeploymentConfig } from './deployment-config'; @@ -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 */ @@ -49,7 +49,7 @@ export class EcsDeploymentGroup { * @returns a Construct representing a reference to an existing Deployment Group */ public static fromEcsDeploymentGroupAttributes( - scope: cdk.Construct, + scope: Construct, id: string, attrs: EcsDeploymentGroupAttributes): IEcsDeploymentGroup { return new ImportedEcsDeploymentGroup(scope, id, attrs); @@ -92,7 +92,7 @@ class ImportedEcsDeploymentGroup extends cdk.Resource implements IEcsDeploymentG public readonly deploymentGroupArn: string; public readonly deploymentConfig: IEcsDeploymentConfig; - constructor(scope: cdk.Construct, id: string, props: EcsDeploymentGroupAttributes) { + constructor(scope: Construct, id: string, props: EcsDeploymentGroupAttributes) { super(scope, id); this.application = props.application; this.deploymentGroupName = props.deploymentGroupName; diff --git a/packages/@aws-cdk/aws-codedeploy/lib/lambda/application.ts b/packages/@aws-cdk/aws-codedeploy/lib/lambda/application.ts index a01d96bb0f029..309bd02ba3647 100644 --- a/packages/@aws-cdk/aws-codedeploy/lib/lambda/application.ts +++ b/packages/@aws-cdk/aws-codedeploy/lib/lambda/application.ts @@ -1,4 +1,5 @@ -import { Construct, IResource, Resource } from '@aws-cdk/core'; +import { IResource, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnApplication } from '../codedeploy.generated'; import { arnForApplication } from '../utils'; 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 1fe2734b3f242..dbfae395a5b47 100644 --- a/packages/@aws-cdk/aws-codedeploy/lib/lambda/deployment-config.ts +++ b/packages/@aws-cdk/aws-codedeploy/lib/lambda/deployment-config.ts @@ -1,4 +1,4 @@ -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { arnForDeploymentConfig } from '../utils'; /** @@ -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 */ @@ -56,7 +56,7 @@ export class LambdaDeploymentConfig { * @param props the properties of the referenced custom Deployment Configuration * @returns a Construct representing a reference to an existing custom Deployment Configuration */ - public static import(_scope: cdk.Construct, _id: string, props: LambdaDeploymentConfigImportProps): ILambdaDeploymentConfig { + public static import(_scope: Construct, _id: string, props: LambdaDeploymentConfigImportProps): ILambdaDeploymentConfig { return deploymentConfig(props.deploymentConfigName); } diff --git a/packages/@aws-cdk/aws-codedeploy/lib/lambda/deployment-group.ts b/packages/@aws-cdk/aws-codedeploy/lib/lambda/deployment-group.ts index 074667136417f..742531df6902f 100644 --- a/packages/@aws-cdk/aws-codedeploy/lib/lambda/deployment-group.ts +++ b/packages/@aws-cdk/aws-codedeploy/lib/lambda/deployment-group.ts @@ -2,7 +2,7 @@ import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; 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 { CfnDeploymentGroup } from '../codedeploy.generated'; import { AutoRollbackConfig } from '../rollback-config'; import { arnForDeploymentGroup, renderAlarmConfiguration, renderAutoRollbackConfiguration } from '../utils'; @@ -130,7 +130,7 @@ export class LambdaDeploymentGroup extends cdk.Resource implements ILambdaDeploy * @returns a Construct representing a reference to an existing Deployment Group */ public static fromLambdaDeploymentGroupAttributes( - scope: cdk.Construct, + scope: Construct, id: string, attrs: LambdaDeploymentGroupAttributes): ILambdaDeploymentGroup { return new ImportedLambdaDeploymentGroup(scope, id, attrs); @@ -146,7 +146,7 @@ export class LambdaDeploymentGroup extends cdk.Resource implements ILambdaDeploy private preHook?: lambda.IFunction; private postHook?: lambda.IFunction; - constructor(scope: cdk.Construct, id: string, props: LambdaDeploymentGroupProps) { + constructor(scope: Construct, id: string, props: LambdaDeploymentGroupProps) { super(scope, id, { physicalName: props.deploymentGroupName, }); @@ -282,7 +282,7 @@ class ImportedLambdaDeploymentGroup extends cdk.Resource implements ILambdaDeplo public readonly deploymentGroupArn: string; public readonly deploymentConfig: ILambdaDeploymentConfig; - constructor(scope: cdk.Construct, id: string, props: LambdaDeploymentGroupAttributes) { + constructor(scope: Construct, id: string, props: LambdaDeploymentGroupAttributes) { super(scope, id); this.application = props.application; this.deploymentGroupName = props.deploymentGroupName; diff --git a/packages/@aws-cdk/aws-codedeploy/lib/server/application.ts b/packages/@aws-cdk/aws-codedeploy/lib/server/application.ts index a4690ad3a05bf..6de47a5fff381 100644 --- a/packages/@aws-cdk/aws-codedeploy/lib/server/application.ts +++ b/packages/@aws-cdk/aws-codedeploy/lib/server/application.ts @@ -1,4 +1,5 @@ -import { Construct, IResource, Resource } from '@aws-cdk/core'; +import { IResource, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnApplication } from '../codedeploy.generated'; import { arnForApplication } from '../utils'; diff --git a/packages/@aws-cdk/aws-codedeploy/lib/server/deployment-config.ts b/packages/@aws-cdk/aws-codedeploy/lib/server/deployment-config.ts index 7acced1438fef..cd6b3f5d08c10 100644 --- a/packages/@aws-cdk/aws-codedeploy/lib/server/deployment-config.ts +++ b/packages/@aws-cdk/aws-codedeploy/lib/server/deployment-config.ts @@ -1,4 +1,5 @@ import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnDeploymentConfig } from '../codedeploy.generated'; import { arnForDeploymentConfig } from '../utils'; @@ -93,7 +94,7 @@ export class ServerDeploymentConfig extends cdk.Resource implements IServerDeplo * @returns a Construct representing a reference to an existing custom Deployment Configuration */ public static fromServerDeploymentConfigName( - scope: cdk.Construct, + scope: Construct, id: string, serverDeploymentConfigName: string): IServerDeploymentConfig { @@ -105,7 +106,7 @@ export class ServerDeploymentConfig extends cdk.Resource implements IServerDeplo public readonly deploymentConfigName: string; public readonly deploymentConfigArn: string; - constructor(scope: cdk.Construct, id: string, props: ServerDeploymentConfigProps) { + constructor(scope: Construct, id: string, props: ServerDeploymentConfigProps) { super(scope, id, { physicalName: props.deploymentConfigName, }); diff --git a/packages/@aws-cdk/aws-codedeploy/lib/server/deployment-group.ts b/packages/@aws-cdk/aws-codedeploy/lib/server/deployment-group.ts index 27f1b32fd3a46..1e9eff2f8f2f2 100644 --- a/packages/@aws-cdk/aws-codedeploy/lib/server/deployment-group.ts +++ b/packages/@aws-cdk/aws-codedeploy/lib/server/deployment-group.ts @@ -4,6 +4,7 @@ import * as ec2 from '@aws-cdk/aws-ec2'; 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 { CfnDeploymentGroup } from '../codedeploy.generated'; import { AutoRollbackConfig } from '../rollback-config'; import { arnForDeploymentGroup, renderAlarmConfiguration, renderAutoRollbackConfiguration } from '../utils'; @@ -71,7 +72,7 @@ abstract class ServerDeploymentGroupBase extends cdk.Resource implements IServer public readonly deploymentConfig: IServerDeploymentConfig; public abstract readonly autoScalingGroups?: autoscaling.AutoScalingGroup[]; - constructor(scope: cdk.Construct, id: string, deploymentConfig?: IServerDeploymentConfig, props?: cdk.ResourceProps) { + constructor(scope: Construct, id: string, deploymentConfig?: IServerDeploymentConfig, props?: cdk.ResourceProps) { super(scope, id, props); this.deploymentConfig = deploymentConfig || ServerDeploymentConfig.ONE_AT_A_TIME; } @@ -84,7 +85,7 @@ class ImportedServerDeploymentGroup extends ServerDeploymentGroupBase { public readonly deploymentGroupArn: string; public readonly autoScalingGroups?: autoscaling.AutoScalingGroup[] = undefined; - constructor(scope: cdk.Construct, id: string, props: ServerDeploymentGroupAttributes) { + constructor(scope: Construct, id: string, props: ServerDeploymentGroupAttributes) { super(scope, id, props.deploymentConfig); this.application = props.application; @@ -247,7 +248,7 @@ export class ServerDeploymentGroup extends ServerDeploymentGroupBase { * @returns a Construct representing a reference to an existing Deployment Group */ public static fromServerDeploymentGroupAttributes( - scope: cdk.Construct, + scope: Construct, id: string, attrs: ServerDeploymentGroupAttributes): IServerDeploymentGroup { return new ImportedServerDeploymentGroup(scope, id, attrs); @@ -263,7 +264,7 @@ export class ServerDeploymentGroup extends ServerDeploymentGroupBase { private readonly codeDeployBucket: s3.IBucket; private readonly alarms: cloudwatch.IAlarm[]; - constructor(scope: cdk.Construct, id: string, props: ServerDeploymentGroupProps = {}) { + constructor(scope: Construct, id: string, props: ServerDeploymentGroupProps = {}) { super(scope, id, props.deploymentConfig, { physicalName: props.deploymentGroupName, }); diff --git a/packages/@aws-cdk/aws-codedeploy/package.json b/packages/@aws-cdk/aws-codedeploy/package.json index 65599aa94455b..a424b23f6b4b1 100644 --- a/packages/@aws-cdk/aws-codedeploy/package.json +++ b/packages/@aws-cdk/aws-codedeploy/package.json @@ -83,7 +83,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -96,7 +96,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-codeguruprofiler/lib/profiling-group.ts b/packages/@aws-cdk/aws-codeguruprofiler/lib/profiling-group.ts index f4d356e093204..598317c20e723 100644 --- a/packages/@aws-cdk/aws-codeguruprofiler/lib/profiling-group.ts +++ b/packages/@aws-cdk/aws-codeguruprofiler/lib/profiling-group.ts @@ -1,5 +1,6 @@ import { Grant, IGrantable } from '@aws-cdk/aws-iam'; -import { Construct, IResource, Lazy, Resource, Stack } from '@aws-cdk/core'; +import { IResource, Lazy, Resource, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnProfilingGroup } from './codeguruprofiler.generated'; /** diff --git a/packages/@aws-cdk/aws-codeguruprofiler/package.json b/packages/@aws-cdk/aws-codeguruprofiler/package.json index a114721c9e514..263f1b6b57e8f 100644 --- a/packages/@aws-cdk/aws-codeguruprofiler/package.json +++ b/packages/@aws-cdk/aws-codeguruprofiler/package.json @@ -73,12 +73,13 @@ }, "dependencies": { "@aws-cdk/aws-iam": "0.0.0", - "@aws-cdk/core": "0.0.0" + "@aws-cdk/core": "0.0.0", + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 8eccb4b1bc89f..cbc7783e790c9 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/action.ts @@ -1,6 +1,7 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as events from '@aws-cdk/aws-events'; -import { Construct, Lazy } from '@aws-cdk/core'; +import { Lazy } 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 ebbe9fd060168..d36d11d27fddb 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 @@ -1,5 +1,6 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; -import { Construct, SecretValue } from '@aws-cdk/core'; +import { SecretValue } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Action } from '../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 6fb8770796824..97c0682a4ee33 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,6 +1,6 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as iam from '@aws-cdk/aws-iam'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Action } from '../action'; import { sourceArtifactBounds } from '../common'; 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 44ad86f4c3f34..b642df012b9f5 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,6 +2,7 @@ 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'; /** @@ -82,7 +83,7 @@ abstract class CloudFormationAction extends Action { this.props = props; } - protected bound(_scope: cdk.Construct, _stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): + protected bound(_scope: Construct, _stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig { const singletonPolicy = SingletonPolicy.forRole(options.role); @@ -123,7 +124,7 @@ export class CloudFormationExecuteChangeSetAction extends CloudFormationAction { this.props2 = props; } - protected bound(scope: cdk.Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): + protected bound(scope: Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig { SingletonPolicy.forRole(options.role).grantExecuteChangeSet(this.props2); @@ -261,7 +262,7 @@ abstract class CloudFormationDeployAction extends CloudFormationAction { return this.getDeploymentRole('property role()'); } - protected bound(scope: cdk.Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): + protected bound(scope: Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig { if (this.props2.deploymentRole) { this._deploymentRole = this.props2.deploymentRole; @@ -361,7 +362,7 @@ export class CloudFormationCreateReplaceChangeSetAction extends CloudFormationDe this.props3 = props; } - protected bound(scope: cdk.Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): + protected bound(scope: Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig { // the super call order is to preserve the existing order of statements in policies const actionConfig = super.bound(scope, stage, options); @@ -430,7 +431,7 @@ export class CloudFormationCreateUpdateStackAction extends CloudFormationDeployA this.props3 = props; } - protected bound(scope: cdk.Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): + protected bound(scope: Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig { // the super call order is to preserve the existing order of statements in policies const actionConfig = super.bound(scope, stage, options); @@ -470,7 +471,7 @@ export class CloudFormationDeleteStackAction extends CloudFormationDeployAction this.props3 = props; } - protected bound(scope: cdk.Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): + protected bound(scope: Construct, stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig { // the super call order is to preserve the existing order of statements in policies const actionConfig = super.bound(scope, stage, options); @@ -496,7 +497,7 @@ export class CloudFormationDeleteStackAction extends CloudFormationDeployAction * Statements created outside of this class are not considered when adding new * permissions. */ -class SingletonPolicy extends cdk.Construct implements iam.IGrantable { +class SingletonPolicy extends Construct implements iam.IGrantable { /** * Obtain a SingletonPolicy for a given role. * @param role the Role this policy is bound to. @@ -514,7 +515,7 @@ class SingletonPolicy extends cdk.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 53d789b665262..455507f0b82c0 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,6 +2,7 @@ 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'; @@ -114,7 +115,7 @@ export class CodeBuildAction extends Action { return this.variableExpression(variableName); } - protected bound(scope: cdk.Construct, _stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): + protected bound(scope: Construct, _stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig { // check for a cross-account action if there are any outputs if ((this.actionProperties.outputs || []).length > 0) { 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 2fa7a67b29b93..2e89dc8f325b2 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 @@ -2,7 +2,7 @@ import * as codecommit from '@aws-cdk/aws-codecommit'; import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as targets from '@aws-cdk/aws-events-targets'; import * as iam from '@aws-cdk/aws-iam'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Action } from '../action'; import { sourceArtifactBounds } from '../common'; 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 9f0df0fbb0066..6f2484532f6c4 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 @@ -1,7 +1,7 @@ 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 { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Action } from '../action'; /** 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 98606a8aac9a1..718aba585ff01 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,7 +1,7 @@ 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 { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Action } from '../action'; import { deployArtifactBounds } from '../common'; 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 3b51ffd0630ab..796d0207b3461 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,5 +1,5 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * The creation attributes used for defining a configuration property @@ -114,8 +114,8 @@ export interface CustomActionRegistrationProps { * representing your custom Action, extending the Action class, * and taking the `actionProperties` as properly typed, construction properties. */ -export class CustomActionRegistration extends cdk.Construct { - constructor(parent: cdk.Construct, id: string, props: CustomActionRegistrationProps) { +export class CustomActionRegistration extends Construct { + constructor(parent: Construct, id: string, props: CustomActionRegistrationProps) { super(parent, id); new codepipeline.CfnCustomActionType(this, 'Resource', { 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 b9261cf34d878..3f98f08030296 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 @@ -2,7 +2,7 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as ecr from '@aws-cdk/aws-ecr'; import * as targets from '@aws-cdk/aws-events-targets'; import * as iam from '@aws-cdk/aws-iam'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Action } from '../action'; import { sourceArtifactBounds } from '../common'; 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 eb2bd88a72100..f537b8e63e19b 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 @@ -1,7 +1,7 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as ecs from '@aws-cdk/aws-ecs'; import * as iam from '@aws-cdk/aws-iam'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Action } from '../action'; import { deployArtifactBounds } from '../common'; 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 4283b7617f010..10ed2b2bccc88 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 @@ -1,5 +1,6 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; -import { Construct, SecretValue } from '@aws-cdk/core'; +import { SecretValue } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Action } from '../action'; import { sourceArtifactBounds } from '../common'; 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 5ebb614ea4ee7..c7a9a63b808f6 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,5 +1,5 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Action } from '../action'; import { IJenkinsProvider, jenkinsArtifactsBounds } from './jenkins-provider'; 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 8dccba5b97f19..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,5 +1,5 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; -import * as cdk from '@aws-cdk/core'; +import { Construct, IConstruct } from 'constructs'; import { CustomActionRegistration } from '../custom-action-registration'; /** @@ -11,7 +11,7 @@ import { CustomActionRegistration } from '../custom-action-registration'; * 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; @@ -102,12 +102,12 @@ export interface JenkinsProviderProps { readonly forTest?: boolean; } -export abstract class BaseJenkinsProvider extends cdk.Construct implements IJenkinsProvider { +export abstract class BaseJenkinsProvider extends Construct implements IJenkinsProvider { public abstract readonly providerName: string; public abstract readonly serverUrl: string; public readonly version: string; - protected constructor(scope: cdk.Construct, id: string, version?: string) { + protected constructor(scope: Construct, id: string, version?: string) { super(scope, id); this.version = version || '1'; @@ -139,7 +139,7 @@ export class JenkinsProvider extends BaseJenkinsProvider { * @param attrs the properties used to identify the existing provider * @returns a new Construct representing a reference to an existing Jenkins provider */ - public static fromJenkinsProviderAttributes(scope: cdk.Construct, id: string, attrs: JenkinsProviderAttributes): IJenkinsProvider { + public static fromJenkinsProviderAttributes(scope: Construct, id: string, attrs: JenkinsProviderAttributes): IJenkinsProvider { return new ImportedJenkinsProvider(scope, id, attrs); } @@ -148,7 +148,7 @@ export class JenkinsProvider extends BaseJenkinsProvider { private buildIncluded = false; private testIncluded = false; - constructor(scope: cdk.Construct, id: string, props: JenkinsProviderProps) { + constructor(scope: Construct, id: string, props: JenkinsProviderProps) { super(scope, id, props.version); this.providerName = props.providerName; @@ -208,7 +208,7 @@ class ImportedJenkinsProvider extends BaseJenkinsProvider { public readonly providerName: string; public readonly serverUrl: string; - constructor(scope: cdk.Construct, id: string, props: JenkinsProviderAttributes) { + constructor(scope: Construct, id: string, props: JenkinsProviderAttributes) { super(scope, id, props.version); this.providerName = props.providerName; 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 7cabc529fbf07..e9059a273e563 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 @@ -1,7 +1,8 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as iam from '@aws-cdk/aws-iam'; import * as lambda from '@aws-cdk/aws-lambda'; -import { Construct, Stack } from '@aws-cdk/core'; +import { Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Action } from '../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 5ddfdb974c4e9..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,7 +1,7 @@ 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 * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Action } from './action'; /** @@ -60,7 +60,7 @@ export class ManualApprovalAction extends Action { return this._notificationTopic; } - protected bound(scope: cdk.Construct, _stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): + protected bound(scope: Construct, _stage: codepipeline.IStage, options: codepipeline.ActionBindOptions): codepipeline.ActionConfig { if (this.props.notificationTopic) { this._notificationTopic = this.props.notificationTopic; 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 7168719bde5f6..f0a23250f4171 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 @@ -1,7 +1,8 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as s3 from '@aws-cdk/aws-s3'; -import { Construct, Duration } from '@aws-cdk/core'; +import { Duration } from '@aws-cdk/core'; import { kebab as toKebabCase } from 'case'; +import { Construct } from 'constructs'; import { Action } from '../action'; import { deployArtifactBounds } from '../common'; 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 7608aa3d94ae0..16cf4a297ddbd 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 @@ -1,7 +1,7 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as targets from '@aws-cdk/aws-events-targets'; import * as s3 from '@aws-cdk/aws-s3'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Action } from '../action'; import { sourceArtifactBounds } from '../common'; diff --git a/packages/@aws-cdk/aws-codepipeline-actions/package.json b/packages/@aws-cdk/aws-codepipeline-actions/package.json index b34c52fc4c7ec..6436d1dfaf6f4 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/package.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/package.json @@ -90,7 +90,7 @@ "@aws-cdk/aws-sns-subscriptions": "0.0.0", "@aws-cdk/core": "0.0.0", "case": "1.6.3", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -110,7 +110,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/aws-sns-subscriptions": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "bundledDependencies": [ "case" diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/cloudformation/test.pipeline-actions.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/cloudformation/test.pipeline-actions.ts index 610c55176c061..fbb51c7ea2050 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/cloudformation/test.pipeline-actions.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/cloudformation/test.pipeline-actions.ts @@ -3,6 +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 { Construct, IConstruct, Node } from 'constructs'; import * as _ from 'lodash'; import * as nodeunit from 'nodeunit'; import * as cpactions from '../../lib'; @@ -26,7 +27,7 @@ export = nodeunit.testCase({ actions: [action], }); - cdk.ConstructNode.prepare(stack.node); + app.synth(); _assertPermissionGranted(test, stack, pipelineRole.statements, 'iam:PassRole', action.deploymentRole.roleArn); @@ -311,7 +312,7 @@ function _isOrContains(stack: cdk.Stack, entity: string | string[], value: strin return false; } -function _stackArn(stackName: string, scope: cdk.IConstruct): string { +function _stackArn(stackName: string, scope: IConstruct): string { return cdk.Stack.of(scope).formatArn({ service: 'cloudformation', resource: 'stack', @@ -325,7 +326,7 @@ class PipelineDouble extends cdk.Resource implements codepipeline.IPipeline { public readonly role: iam.Role; public readonly artifactBucket: s3.IBucket; - constructor(scope: cdk.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 }); @@ -355,7 +356,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'); } @@ -363,10 +364,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, @@ -388,7 +389,7 @@ class StageDouble implements codepipeline.IStage { class RoleDouble extends iam.Role { public readonly statements = new Array(); - constructor(scope: cdk.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/test.pipeline.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/test.pipeline.ts index 64f9c44a41147..a4b51e77e0a68 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/test.pipeline.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/test.pipeline.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 { Test } from 'nodeunit'; import * as cpactions from '../lib'; @@ -46,7 +46,8 @@ export = { }); test.notDeepEqual(SynthUtils.toCloudFormation(stack), {}); - test.deepEqual([], ConstructNode.validate(pipeline.node)); + // TODO: this was ConstructNode.validate() + test.deepEqual([], pipeline.node.validate()); test.done(); }, @@ -276,7 +277,7 @@ export = { ], })); - test.deepEqual([], ConstructNode.validate(p.node)); + test.deepEqual([], p.node.validate()); test.done(); }, @@ -367,7 +368,7 @@ export = { ], })); - 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 d417195622a46..ea290c7774a77 100644 --- a/packages/@aws-cdk/aws-codepipeline/lib/action.ts +++ b/packages/@aws-cdk/aws-codepipeline/lib/action.ts @@ -1,7 +1,8 @@ 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 { Construct, IResource } from '@aws-cdk/core'; +import { IResource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Artifact } from './artifact'; export enum ActionCategory { diff --git a/packages/@aws-cdk/aws-codepipeline/lib/cross-region-support-stack.ts b/packages/@aws-cdk/aws-codepipeline/lib/cross-region-support-stack.ts index 00d0c5ca29493..e5ddb86acb438 100644 --- a/packages/@aws-cdk/aws-codepipeline/lib/cross-region-support-stack.ts +++ b/packages/@aws-cdk/aws-codepipeline/lib/cross-region-support-stack.ts @@ -1,6 +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'; +import { Construct } from 'constructs'; const REQUIRED_ALIAS_PREFIX = 'alias/'; @@ -28,10 +29,10 @@ function lastNCharacters(str: string, n: number) { return str.substring(startIndex); } -export class CrossRegionSupportConstruct extends cdk.Construct { +export class CrossRegionSupportConstruct extends Construct { public readonly replicationBucket: s3.IBucket; - constructor(scope: cdk.Construct, id: string) { + constructor(scope: Construct, id: string) { super(scope, id); const encryptionKey = new kms.Key(this, 'CrossRegionCodePipelineReplicationBucketEncryptionKey', { @@ -85,7 +86,7 @@ export class CrossRegionSupportStack extends cdk.Stack { */ public readonly replicationBucket: s3.IBucket; - constructor(scope: cdk.Construct, id: string, props: CrossRegionSupportStackProps) { + constructor(scope: Construct, id: string, props: CrossRegionSupportStackProps) { super(scope, id, { stackName: generateStackName(props), env: { diff --git a/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts b/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts index b498c20945f83..fde41cf320dd8 100644 --- a/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts +++ b/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts @@ -3,9 +3,10 @@ import * as iam from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; import * as s3 from '@aws-cdk/aws-s3'; import { - App, BootstraplessSynthesizer, Construct, DefaultStackSynthesizer, + App, BootstraplessSynthesizer, DefaultStackSynthesizer, IStackSynthesizer, Lazy, PhysicalName, RemovalPolicy, Resource, Stack, Token, } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ActionCategory, IAction, IPipeline, IStage } from './action'; import { CfnPipeline } from './codepipeline.generated'; import { CrossRegionSupportConstruct, CrossRegionSupportStack } from './cross-region-support-stack'; diff --git a/packages/@aws-cdk/aws-codepipeline/lib/stage.ts b/packages/@aws-cdk/aws-codepipeline/lib/stage.ts index 3eb0896ff03f2..38edcf69078b2 100644 --- a/packages/@aws-cdk/aws-codepipeline/lib/stage.ts +++ b/packages/@aws-cdk/aws-codepipeline/lib/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 0a94e85b6a724..e79af2610b30e 100644 --- a/packages/@aws-cdk/aws-codepipeline/package.json +++ b/packages/@aws-cdk/aws-codepipeline/package.json @@ -82,7 +82,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -91,7 +91,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-codepipeline/test/fake-build-action.ts b/packages/@aws-cdk/aws-codepipeline/test/fake-build-action.ts index 63a3ef4d551c5..69e660050cd18 100644 --- a/packages/@aws-cdk/aws-codepipeline/test/fake-build-action.ts +++ b/packages/@aws-cdk/aws-codepipeline/test/fake-build-action.ts @@ -1,6 +1,6 @@ import * as events from '@aws-cdk/aws-events'; import * as iam from '@aws-cdk/aws-iam'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as codepipeline from '../lib'; export interface FakeBuildActionProps extends codepipeline.CommonActionProps { diff --git a/packages/@aws-cdk/aws-codepipeline/test/fake-source-action.ts b/packages/@aws-cdk/aws-codepipeline/test/fake-source-action.ts index 2c198c365410c..ab2f56471f1dd 100644 --- a/packages/@aws-cdk/aws-codepipeline/test/fake-source-action.ts +++ b/packages/@aws-cdk/aws-codepipeline/test/fake-source-action.ts @@ -1,5 +1,6 @@ import * as events from '@aws-cdk/aws-events'; -import { Construct, Lazy } from '@aws-cdk/core'; +import { Lazy } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as codepipeline from '../lib'; export interface IFakeSourceActionVariables { diff --git a/packages/@aws-cdk/aws-codepipeline/test/test.artifacts.ts b/packages/@aws-cdk/aws-codepipeline/test/test.artifacts.ts index b638a3c1c7b90..25efecb557eb1 100644 --- a/packages/@aws-cdk/aws-codepipeline/test/test.artifacts.ts +++ b/packages/@aws-cdk/aws-codepipeline/test/test.artifacts.ts @@ -1,5 +1,6 @@ import { expect, haveResourceLike } from '@aws-cdk/assert'; import * as cdk from '@aws-cdk/core'; +import { IConstruct } from 'constructs'; import { Test } from 'nodeunit'; import * as codepipeline from '../lib'; import { FakeBuildAction } from './fake-build-action'; @@ -285,7 +286,6 @@ export = { }, }; -function validate(construct: cdk.IConstruct): cdk.ValidationError[] { - cdk.ConstructNode.prepare(construct.node); - return cdk.ConstructNode.validate(construct.node); +function validate(construct: IConstruct) { + return construct.node.validate(); } diff --git a/packages/@aws-cdk/aws-codepipeline/test/test.general-validation.ts b/packages/@aws-cdk/aws-codepipeline/test/test.general-validation.ts index d1d4f288e8563..f85fa8eeaeb51 100644 --- a/packages/@aws-cdk/aws-codepipeline/test/test.general-validation.ts +++ b/packages/@aws-cdk/aws-codepipeline/test/test.general-validation.ts @@ -49,7 +49,7 @@ export = { 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 @@ export = { ], }); - 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/lib/github-repository.ts b/packages/@aws-cdk/aws-codestar/lib/github-repository.ts index 0afd45eb0c826..5156ce211b9a8 100644 --- a/packages/@aws-cdk/aws-codestar/lib/github-repository.ts +++ b/packages/@aws-cdk/aws-codestar/lib/github-repository.ts @@ -1,5 +1,6 @@ import * as s3 from '@aws-cdk/aws-s3'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as codestar from './codestar.generated'; /** @@ -87,7 +88,7 @@ export class GitHubRepository extends cdk.Resource implements IGitHubRepository public readonly owner: string; public readonly repo: string; - constructor(scope: cdk.Construct, id: string, props: GitHubRepositoryProps) { + constructor(scope: Construct, id: string, props: GitHubRepositoryProps) { super(scope, id); const resource = new codestar.CfnGitHubRepository(this, 'Resource', { diff --git a/packages/@aws-cdk/aws-codestar/package.json b/packages/@aws-cdk/aws-codestar/package.json index 2b1d9cfc7773c..b0e7360eb20ff 100644 --- a/packages/@aws-cdk/aws-codestar/package.json +++ b/packages/@aws-cdk/aws-codestar/package.json @@ -74,12 +74,12 @@ "dependencies": { "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 fc2af8c156c95..e0f83c904a3bf 100644 --- a/packages/@aws-cdk/aws-codestarnotifications/package.json +++ b/packages/@aws-cdk/aws-codestarnotifications/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-cognito/lib/user-pool-client.ts b/packages/@aws-cdk/aws-cognito/lib/user-pool-client.ts index c584ca8be7e46..96c13fc236b71 100644 --- a/packages/@aws-cdk/aws-cognito/lib/user-pool-client.ts +++ b/packages/@aws-cdk/aws-cognito/lib/user-pool-client.ts @@ -1,4 +1,5 @@ -import { Construct, IResource, Resource } from '@aws-cdk/core'; +import { IResource, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnUserPoolClient } from './cognito.generated'; import { IUserPool } from './user-pool'; diff --git a/packages/@aws-cdk/aws-cognito/lib/user-pool-domain.ts b/packages/@aws-cdk/aws-cognito/lib/user-pool-domain.ts index b910cc24a41f0..62c47ce4237d4 100644 --- a/packages/@aws-cdk/aws-cognito/lib/user-pool-domain.ts +++ b/packages/@aws-cdk/aws-cognito/lib/user-pool-domain.ts @@ -1,6 +1,7 @@ import { ICertificate } from '@aws-cdk/aws-certificatemanager'; -import { Construct, IResource, Resource, Stack, Token } from '@aws-cdk/core'; +import { IResource, Resource, Stack, Token } from '@aws-cdk/core'; import { AwsCustomResource, AwsCustomResourcePolicy, AwsSdkCall, PhysicalResourceId } from '@aws-cdk/custom-resources'; +import { Construct } from 'constructs'; import { CfnUserPoolDomain } from './cognito.generated'; import { IUserPool } from './user-pool'; import { UserPoolClient } from './user-pool-client'; diff --git a/packages/@aws-cdk/aws-cognito/lib/user-pool-idp.ts b/packages/@aws-cdk/aws-cognito/lib/user-pool-idp.ts index 30e8cb61bfe6d..c569ccd778fd8 100644 --- a/packages/@aws-cdk/aws-cognito/lib/user-pool-idp.ts +++ b/packages/@aws-cdk/aws-cognito/lib/user-pool-idp.ts @@ -1,4 +1,5 @@ -import { Construct, IResource, Resource } from '@aws-cdk/core'; +import { IResource, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Represents a UserPoolIdentityProvider diff --git a/packages/@aws-cdk/aws-cognito/lib/user-pool-idps/amazon.ts b/packages/@aws-cdk/aws-cognito/lib/user-pool-idps/amazon.ts index 04d5098b7f83a..dbc57a86b4191 100644 --- a/packages/@aws-cdk/aws-cognito/lib/user-pool-idps/amazon.ts +++ b/packages/@aws-cdk/aws-cognito/lib/user-pool-idps/amazon.ts @@ -1,4 +1,4 @@ -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnUserPoolIdentityProvider } from '../cognito.generated'; import { UserPoolIdentityProviderBase, UserPoolIdentityProviderProps } from './base'; diff --git a/packages/@aws-cdk/aws-cognito/lib/user-pool-idps/base.ts b/packages/@aws-cdk/aws-cognito/lib/user-pool-idps/base.ts index 8be81c88334be..6987050e65e82 100644 --- a/packages/@aws-cdk/aws-cognito/lib/user-pool-idps/base.ts +++ b/packages/@aws-cdk/aws-cognito/lib/user-pool-idps/base.ts @@ -1,4 +1,5 @@ -import { Construct, Resource } from '@aws-cdk/core'; +import { Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { StandardAttributeNames } from '../private/attr-names'; import { IUserPool } from '../user-pool'; import { IUserPoolIdentityProvider } from '../user-pool-idp'; diff --git a/packages/@aws-cdk/aws-cognito/lib/user-pool-idps/facebook.ts b/packages/@aws-cdk/aws-cognito/lib/user-pool-idps/facebook.ts index fee333011ffe6..1825a474bada4 100644 --- a/packages/@aws-cdk/aws-cognito/lib/user-pool-idps/facebook.ts +++ b/packages/@aws-cdk/aws-cognito/lib/user-pool-idps/facebook.ts @@ -1,4 +1,4 @@ -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnUserPoolIdentityProvider } from '../cognito.generated'; import { UserPoolIdentityProviderBase, UserPoolIdentityProviderProps } from './base'; diff --git a/packages/@aws-cdk/aws-cognito/lib/user-pool.ts b/packages/@aws-cdk/aws-cognito/lib/user-pool.ts index 6ff23e96dde5d..fed31b9f76674 100644 --- a/packages/@aws-cdk/aws-cognito/lib/user-pool.ts +++ b/packages/@aws-cdk/aws-cognito/lib/user-pool.ts @@ -1,6 +1,7 @@ import { IRole, PolicyDocument, PolicyStatement, Role, ServicePrincipal } from '@aws-cdk/aws-iam'; import * as lambda from '@aws-cdk/aws-lambda'; -import { Construct, Duration, IResource, Lazy, Resource, Stack, Token } from '@aws-cdk/core'; +import { Duration, IResource, Lazy, Resource, Stack, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnUserPool } from './cognito.generated'; import { StandardAttributeNames } from './private/attr-names'; import { ICustomAttribute, StandardAttribute, StandardAttributes } from './user-pool-attr'; diff --git a/packages/@aws-cdk/aws-cognito/package.json b/packages/@aws-cdk/aws-cognito/package.json index 5a72c3d09f551..4affcf8a748c0 100644 --- a/packages/@aws-cdk/aws-cognito/package.json +++ b/packages/@aws-cdk/aws-cognito/package.json @@ -78,7 +78,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -87,7 +87,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-cognito/test/user-pool.test.ts b/packages/@aws-cdk/aws-cognito/test/user-pool.test.ts index 801879f6ea55a..7693ff3c088ea 100644 --- a/packages/@aws-cdk/aws-cognito/test/user-pool.test.ts +++ b/packages/@aws-cdk/aws-cognito/test/user-pool.test.ts @@ -2,7 +2,8 @@ import '@aws-cdk/assert/jest'; import { ABSENT } from '@aws-cdk/assert/lib/assertions/have-resource'; import { Role } from '@aws-cdk/aws-iam'; import * as lambda from '@aws-cdk/aws-lambda'; -import { CfnParameter, Construct, Duration, Stack, Tag } from '@aws-cdk/core'; +import { CfnParameter, Duration, Stack, Tag } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { AccountRecovery, Mfa, NumberAttribute, StringAttribute, UserPool, UserPoolIdentityProvider, UserPoolOperation, VerificationEmailStyle } from '../lib'; describe('User Pool', () => { diff --git a/packages/@aws-cdk/aws-config/lib/managed-rules.ts b/packages/@aws-cdk/aws-config/lib/managed-rules.ts index 5b1821b9598a0..50682d40286f6 100644 --- a/packages/@aws-cdk/aws-config/lib/managed-rules.ts +++ b/packages/@aws-cdk/aws-config/lib/managed-rules.ts @@ -1,6 +1,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as sns from '@aws-cdk/aws-sns'; -import { Construct, Duration, Lazy, Stack } from '@aws-cdk/core'; +import { Duration, Lazy, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ManagedRule, RuleProps } from './rule'; /** diff --git a/packages/@aws-cdk/aws-config/lib/rule.ts b/packages/@aws-cdk/aws-config/lib/rule.ts index 0659fefa8089b..385a23f50b5dc 100644 --- a/packages/@aws-cdk/aws-config/lib/rule.ts +++ b/packages/@aws-cdk/aws-config/lib/rule.ts @@ -1,7 +1,8 @@ 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 { Construct, IResource, Lazy, Resource } from '@aws-cdk/core'; +import { IResource, Lazy, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnConfigRule } from './config.generated'; /** diff --git a/packages/@aws-cdk/aws-config/package.json b/packages/@aws-cdk/aws-config/package.json index 7f12b80773cb3..815002b198693 100644 --- a/packages/@aws-cdk/aws-config/package.json +++ b/packages/@aws-cdk/aws-config/package.json @@ -77,7 +77,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -86,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.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-datapipeline/package.json b/packages/@aws-cdk/aws-datapipeline/package.json index 0c3c5712c7919..6241408d8b4db 100644 --- a/packages/@aws-cdk/aws-datapipeline/package.json +++ b/packages/@aws-cdk/aws-datapipeline/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-dax/package.json b/packages/@aws-cdk/aws-dax/package.json index 7fe462acd30c6..832eef0889ffc 100644 --- a/packages/@aws-cdk/aws-dax/package.json +++ b/packages/@aws-cdk/aws-dax/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-directoryservice/package.json b/packages/@aws-cdk/aws-directoryservice/package.json index 462f8cdfcdf8d..864be4883ac18 100644 --- a/packages/@aws-cdk/aws-directoryservice/package.json +++ b/packages/@aws-cdk/aws-directoryservice/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 52e12eb311682..7a1501c04cf14 100644 --- a/packages/@aws-cdk/aws-dlm/package.json +++ b/packages/@aws-cdk/aws-dlm/package.json @@ -71,11 +71,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 901a5631b8aba..d18b689160ac1 100644 --- a/packages/@aws-cdk/aws-dms/package.json +++ b/packages/@aws-cdk/aws-dms/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-docdb/lib/cluster.ts b/packages/@aws-cdk/aws-docdb/lib/cluster.ts index 339ef8f0b51a0..529f446c265b9 100644 --- a/packages/@aws-cdk/aws-docdb/lib/cluster.ts +++ b/packages/@aws-cdk/aws-docdb/lib/cluster.ts @@ -1,7 +1,8 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as kms from '@aws-cdk/aws-kms'; import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; -import { CfnResource, Construct, Duration, RemovalPolicy, Resource, Token } from '@aws-cdk/core'; +import { CfnResource, Duration, RemovalPolicy, Resource, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { DatabaseClusterAttributes, IDatabaseCluster } from './cluster-ref'; import { DatabaseSecret } from './database-secret'; import { CfnDBCluster, CfnDBInstance, CfnDBSubnetGroup } from './docdb.generated'; diff --git a/packages/@aws-cdk/aws-docdb/lib/database-secret.ts b/packages/@aws-cdk/aws-docdb/lib/database-secret.ts index 25a94410674aa..605609b4b6ab2 100644 --- a/packages/@aws-cdk/aws-docdb/lib/database-secret.ts +++ b/packages/@aws-cdk/aws-docdb/lib/database-secret.ts @@ -1,6 +1,7 @@ import { IKey } from '@aws-cdk/aws-kms'; import { ISecret, Secret } from '@aws-cdk/aws-secretsmanager'; -import { Aws, Construct } from '@aws-cdk/core'; +import { Aws } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Construction properties for a DatabaseSecret. diff --git a/packages/@aws-cdk/aws-docdb/lib/instance.ts b/packages/@aws-cdk/aws-docdb/lib/instance.ts index ab6400f5480e4..f97fefa2dcf7e 100644 --- a/packages/@aws-cdk/aws-docdb/lib/instance.ts +++ b/packages/@aws-cdk/aws-docdb/lib/instance.ts @@ -1,6 +1,6 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as cdk from '@aws-cdk/core'; - +import { Construct } from 'constructs'; import { IDatabaseCluster } from './cluster-ref'; import { CfnDBInstance } from './docdb.generated'; import { Endpoint } from './endpoint'; @@ -66,7 +66,7 @@ abstract class DatabaseInstanceBase extends cdk.Resource implements IDatabaseIns /** * Import an existing database instance. */ - public static fromDatabaseInstanceAttributes(scope: cdk.Construct, id: string, attrs: DatabaseInstanceAttributes): IDatabaseInstance { + public static fromDatabaseInstanceAttributes(scope: Construct, id: string, attrs: DatabaseInstanceAttributes): IDatabaseInstance { class Import extends DatabaseInstanceBase implements IDatabaseInstance { public readonly defaultPort = ec2.Port.tcp(attrs.port); public readonly instanceIdentifier = attrs.instanceIdentifier; @@ -199,7 +199,7 @@ export class DatabaseInstance extends DatabaseInstanceBase implements IDatabaseI */ public readonly instanceEndpoint: Endpoint; - constructor(scope: cdk.Construct, id: string, props: DatabaseInstanceProps) { + constructor(scope: Construct, id: string, props: DatabaseInstanceProps) { super(scope, id); const instance = new CfnDBInstance(this, 'Resource', { diff --git a/packages/@aws-cdk/aws-docdb/lib/parameter-group.ts b/packages/@aws-cdk/aws-docdb/lib/parameter-group.ts index f98c74cbcf403..5a9e377916f2d 100644 --- a/packages/@aws-cdk/aws-docdb/lib/parameter-group.ts +++ b/packages/@aws-cdk/aws-docdb/lib/parameter-group.ts @@ -1,4 +1,5 @@ -import { Construct, IResource, Resource } from '@aws-cdk/core'; +import { IResource, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnDBClusterParameterGroup } from './docdb.generated'; /** diff --git a/packages/@aws-cdk/aws-docdb/package.json b/packages/@aws-cdk/aws-docdb/package.json index 3fa00723a3c94..7d481895413bf 100644 --- a/packages/@aws-cdk/aws-docdb/package.json +++ b/packages/@aws-cdk/aws-docdb/package.json @@ -77,7 +77,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/aws-efs": "0.0.0", @@ -85,7 +85,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-docdb/test/instance.test.ts b/packages/@aws-cdk/aws-docdb/test/instance.test.ts index b36d6af554ef1..b6f1749d3cd31 100644 --- a/packages/@aws-cdk/aws-docdb/test/instance.test.ts +++ b/packages/@aws-cdk/aws-docdb/test/instance.test.ts @@ -1,7 +1,7 @@ import { expect as expectCDK, haveOutput, haveResource, ResourcePart } from '@aws-cdk/assert'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as cdk from '@aws-cdk/core'; - +import { Construct } from 'constructs'; import { DatabaseCluster, DatabaseInstance } from '../lib'; const CLUSTER_INSTANCE_TYPE = ec2.InstanceType.of(ec2.InstanceClass.R5, ec2.InstanceSize.LARGE); @@ -142,7 +142,7 @@ class TestStack extends cdk.Stack { public readonly vpc: ec2.Vpc; public readonly cluster: DatabaseCluster; - constructor(scope?: cdk.Construct, id?: string, props: cdk.StackProps = {}) { + constructor(scope?: Construct, id?: string, props: cdk.StackProps = {}) { super(scope, id, props); this.node.setContext('availability-zones:12345:us-test-1', ['us-test-1a', 'us-test-1b']); diff --git a/packages/@aws-cdk/aws-docdb/test/integ.cluster.ts b/packages/@aws-cdk/aws-docdb/test/integ.cluster.ts index e90cb8ec4af14..2f38b2a210bd3 100644 --- a/packages/@aws-cdk/aws-docdb/test/integ.cluster.ts +++ b/packages/@aws-cdk/aws-docdb/test/integ.cluster.ts @@ -1,6 +1,7 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as kms from '@aws-cdk/aws-kms'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { DatabaseCluster } from '../lib'; import { ClusterParameterGroup } from '../lib/parameter-group'; @@ -10,7 +11,7 @@ import { ClusterParameterGroup } from '../lib/parameter-group'; */ class TestStack extends cdk.Stack { - constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) { + constructor(scope: Construct, id: string, props?: cdk.StackProps) { super(scope, id, props); const vpc = new ec2.Vpc(this, 'VPC', { maxAzs: 2 }); 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 d72ff1f42c176..095e657f26f79 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,5 +1,6 @@ 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'; /** @@ -26,7 +27,7 @@ export interface GlobalTableProps extends cdk.StackProps, dynamodb.TableOptions * * @deprecated use `@aws-cdk/aws-dynamodb.Table.replicationRegions` instead */ -export class GlobalTable extends cdk.Construct { +export class GlobalTable extends Construct { /** * Creates the cloudformation custom resource that launches a lambda to tie it all together */ @@ -37,7 +38,7 @@ export class GlobalTable extends cdk.Construct { */ private readonly _regionalTables = new Array(); - constructor(scope: cdk.Construct, id: string, props: GlobalTableProps) { + constructor(scope: Construct, id: string, props: GlobalTableProps) { super(scope, id); this.node.addWarning('The @aws-cdk/aws-dynamodb-global module has been deprecated in favor of @aws-cdk/aws-dynamodb.Table.replicationRegions'); 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 2f4b2ae2a3ea3..91490957656a8 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 @@ -1,6 +1,7 @@ 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 * as path from 'path'; import { GlobalTableProps } from './aws-dynamodb-global'; @@ -9,7 +10,7 @@ import { GlobalTableProps } from './aws-dynamodb-global'; * together all the DynamoDB tables into a global table */ export class GlobalTableCoordinator extends cdk.Stack { - constructor(scope: cdk.Construct, id: string, props: GlobalTableProps) { + constructor(scope: Construct, id: string, props: GlobalTableProps) { super(scope, id, props); const lambdaFunction = new lambda.SingletonFunction(this, 'SingletonLambda', { code: lambda.Code.fromAsset(path.resolve(__dirname, '../', 'lambda-packages', 'aws-global-table-coordinator', 'lib')), diff --git a/packages/@aws-cdk/aws-dynamodb-global/package.json b/packages/@aws-cdk/aws-dynamodb-global/package.json index e214cbbbb210c..439c7a7f88aab 100644 --- a/packages/@aws-cdk/aws-dynamodb-global/package.json +++ b/packages/@aws-cdk/aws-dynamodb-global/package.json @@ -50,7 +50,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "devDependencies": { "@aws-cdk/assert": "0.0.0", @@ -65,7 +65,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 d10f023631297..a7f52db889a82 100644 --- a/packages/@aws-cdk/aws-dynamodb/lib/replica-provider.ts +++ b/packages/@aws-cdk/aws-dynamodb/lib/replica-provider.ts @@ -1,7 +1,8 @@ import * as iam from '@aws-cdk/aws-iam'; import * as lambda from '@aws-cdk/aws-lambda'; -import { Construct, Duration, NestedStack, Stack } from '@aws-cdk/core'; +import { Duration, NestedStack, Stack } from '@aws-cdk/core'; import * as cr from '@aws-cdk/custom-resources'; +import { Construct } from 'constructs'; import * as path from 'path'; export class ReplicaProvider extends NestedStack { diff --git a/packages/@aws-cdk/aws-dynamodb/lib/table.ts b/packages/@aws-cdk/aws-dynamodb/lib/table.ts index d2594c95fa9b2..3d351d7570f3d 100644 --- a/packages/@aws-cdk/aws-dynamodb/lib/table.ts +++ b/packages/@aws-cdk/aws-dynamodb/lib/table.ts @@ -3,9 +3,10 @@ import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; import * as iam from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; import { - Aws, CfnCondition, CfnCustomResource, Construct, CustomResource, Fn, + Aws, CfnCondition, CfnCustomResource, CustomResource, Fn, IResource, Lazy, RemovalPolicy, Resource, Stack, Token, } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnTable, CfnTableProps } from './dynamodb.generated'; import * as perms from './perms'; import { ReplicaProvider } from './replica-provider'; diff --git a/packages/@aws-cdk/aws-dynamodb/package.json b/packages/@aws-cdk/aws-dynamodb/package.json index 7be8d55f282bb..8d8f284019d5e 100644 --- a/packages/@aws-cdk/aws-dynamodb/package.json +++ b/packages/@aws-cdk/aws-dynamodb/package.json @@ -83,7 +83,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -94,7 +94,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 c0c0fe9633ac0..0da2017e8784e 100644 --- a/packages/@aws-cdk/aws-dynamodb/test/dynamodb.test.ts +++ b/packages/@aws-cdk/aws-dynamodb/test/dynamodb.test.ts @@ -3,7 +3,8 @@ 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, CfnDeletionPolicy, ConstructNode, Duration, RemovalPolicy, Stack, Tag } from '@aws-cdk/core'; +import { App, CfnDeletionPolicy, Duration, RemovalPolicy, Stack, Tag } from '@aws-cdk/core'; + import { Attribute, AttributeType, @@ -321,7 +322,8 @@ test('when specifying every property', () => { partitionKey: TABLE_PARTITION_KEY, sortKey: TABLE_SORT_KEY, }); - table.node.applyAspect(new Tag('Environment', 'Production')); + + Tag.add(table, 'Environment', 'Production'); expect(stack).toHaveResource('AWS::DynamoDB::Table', { @@ -354,7 +356,8 @@ test('when specifying sse with customer managed CMK', () => { encryption: TableEncryption.CUSTOMER_MANAGED, partitionKey: TABLE_PARTITION_KEY, }); - table.node.applyAspect(new Tag('Environment', 'Production')); + + Tag.add(table, 'Environment', 'Production'); expect(stack).toHaveResource('AWS::DynamoDB::Table', { 'SSESpecification': { @@ -380,7 +383,8 @@ test('when specifying only encryptionKey', () => { encryptionKey, partitionKey: TABLE_PARTITION_KEY, }); - table.node.applyAspect(new Tag('Environment', 'Production')); + + Tag.add(table, 'Environment', 'Production'); expect(stack).toHaveResource('AWS::DynamoDB::Table', { 'SSESpecification': { @@ -407,7 +411,8 @@ test('when specifying sse with customer managed CMK with encryptionKey provided encryptionKey, partitionKey: TABLE_PARTITION_KEY, }); - table.node.applyAspect(new Tag('Environment', 'Production')); + + Tag.add(table, 'Environment', 'Production'); expect(stack).toHaveResource('AWS::DynamoDB::Table', { 'SSESpecification': { @@ -1403,7 +1408,7 @@ 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'); diff --git a/packages/@aws-cdk/aws-dynamodb/test/integ.dynamodb.ondemand.ts b/packages/@aws-cdk/aws-dynamodb/test/integ.dynamodb.ondemand.ts index 3304c8defec2e..db47834ce883d 100644 --- a/packages/@aws-cdk/aws-dynamodb/test/integ.dynamodb.ondemand.ts +++ b/packages/@aws-cdk/aws-dynamodb/test/integ.dynamodb.ondemand.ts @@ -58,7 +58,7 @@ const tableWithGlobalAndLocalSecondaryIndex = new Table(stack, TABLE_WITH_GLOBAL removalPolicy: RemovalPolicy.DESTROY, }); -tableWithGlobalAndLocalSecondaryIndex.node.applyAspect(new Tag('Environment', 'Production')); +Tag.add(tableWithGlobalAndLocalSecondaryIndex, 'Environment', 'Production'); tableWithGlobalAndLocalSecondaryIndex.addGlobalSecondaryIndex({ indexName: GSI_TEST_CASE_1, diff --git a/packages/@aws-cdk/aws-dynamodb/test/integ.dynamodb.sse.ts b/packages/@aws-cdk/aws-dynamodb/test/integ.dynamodb.sse.ts index b1f3dca8b75a3..5937058988954 100644 --- a/packages/@aws-cdk/aws-dynamodb/test/integ.dynamodb.sse.ts +++ b/packages/@aws-cdk/aws-dynamodb/test/integ.dynamodb.sse.ts @@ -58,7 +58,7 @@ const tableWithGlobalAndLocalSecondaryIndex = new Table(stack, TABLE_WITH_GLOBAL removalPolicy: RemovalPolicy.DESTROY, }); -tableWithGlobalAndLocalSecondaryIndex.node.applyAspect(new Tag('Environment', 'Production')); +Tag.add(tableWithGlobalAndLocalSecondaryIndex, 'Environment', 'Production'); tableWithGlobalAndLocalSecondaryIndex.addGlobalSecondaryIndex({ indexName: GSI_TEST_CASE_1, partitionKey: GSI_PARTITION_KEY, diff --git a/packages/@aws-cdk/aws-dynamodb/test/integ.dynamodb.ts b/packages/@aws-cdk/aws-dynamodb/test/integ.dynamodb.ts index 35c81b6486d3b..7c21f360a80ef 100644 --- a/packages/@aws-cdk/aws-dynamodb/test/integ.dynamodb.ts +++ b/packages/@aws-cdk/aws-dynamodb/test/integ.dynamodb.ts @@ -56,7 +56,7 @@ const tableWithGlobalAndLocalSecondaryIndex = new Table(stack, TABLE_WITH_GLOBAL removalPolicy: RemovalPolicy.DESTROY, }); -tableWithGlobalAndLocalSecondaryIndex.node.applyAspect(new Tag('Environment', 'Production')); +Tag.add(tableWithGlobalAndLocalSecondaryIndex, 'Environment', 'Production'); tableWithGlobalAndLocalSecondaryIndex.addGlobalSecondaryIndex({ indexName: GSI_TEST_CASE_1, partitionKey: GSI_PARTITION_KEY, diff --git a/packages/@aws-cdk/aws-dynamodb/test/integ.global.ts b/packages/@aws-cdk/aws-dynamodb/test/integ.global.ts index c911a7b698f7d..e697731091ec7 100644 --- a/packages/@aws-cdk/aws-dynamodb/test/integ.global.ts +++ b/packages/@aws-cdk/aws-dynamodb/test/integ.global.ts @@ -1,4 +1,5 @@ -import { App, Construct, RemovalPolicy, Stack, StackProps } from '@aws-cdk/core'; +import { App, RemovalPolicy, Stack, StackProps } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as dynamodb from '../lib'; class TestStack extends Stack { diff --git a/packages/@aws-cdk/aws-ec2/lib/bastion-host.ts b/packages/@aws-cdk/aws-ec2/lib/bastion-host.ts index 00b6cd396ddf9..3b934a373886e 100644 --- a/packages/@aws-cdk/aws-ec2/lib/bastion-host.ts +++ b/packages/@aws-cdk/aws-ec2/lib/bastion-host.ts @@ -1,5 +1,6 @@ import { IPrincipal, IRole, PolicyStatement } from '@aws-cdk/aws-iam'; -import { CfnOutput, Construct, Stack } from '@aws-cdk/core'; +import { CfnOutput, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { AmazonLinuxGeneration, InstanceClass, InstanceSize, InstanceType } from '.'; import { Connections } from './connections'; import { IInstance, Instance } from './instance'; diff --git a/packages/@aws-cdk/aws-ec2/lib/instance.ts b/packages/@aws-cdk/aws-ec2/lib/instance.ts index 79a6bb262d053..7ddf75f86b975 100644 --- a/packages/@aws-cdk/aws-ec2/lib/instance.ts +++ b/packages/@aws-cdk/aws-ec2/lib/instance.ts @@ -1,6 +1,7 @@ import * as iam from '@aws-cdk/aws-iam'; -import { Construct, Duration, Fn, IResource, Lazy, Resource, Tag } from '@aws-cdk/core'; +import { Duration, Fn, IResource, Lazy, Resource, Tag } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Connections, IConnectable } from './connections'; import { CfnInstance } from './ec2.generated'; import { InstanceType } from './instance-types'; diff --git a/packages/@aws-cdk/aws-ec2/lib/machine-image.ts b/packages/@aws-cdk/aws-ec2/lib/machine-image.ts index 7f7862fce3539..dfce70f29f76e 100644 --- a/packages/@aws-cdk/aws-ec2/lib/machine-image.ts +++ b/packages/@aws-cdk/aws-ec2/lib/machine-image.ts @@ -1,7 +1,8 @@ import * as ssm from '@aws-cdk/aws-ssm'; import * as cxschema from '@aws-cdk/cloud-assembly-schema'; -import { Construct, ContextProvider, Stack, Token } from '@aws-cdk/core'; +import { ContextProvider, Stack, Token } from '@aws-cdk/core'; import * as cxapi from '@aws-cdk/cx-api'; +import { Construct } from 'constructs'; import { UserData } from './user-data'; import { WindowsVersion } from './windows-versions'; diff --git a/packages/@aws-cdk/aws-ec2/lib/network-acl.ts b/packages/@aws-cdk/aws-ec2/lib/network-acl.ts index 935dada98c9f0..272afbd39f7bf 100644 --- a/packages/@aws-cdk/aws-ec2/lib/network-acl.ts +++ b/packages/@aws-cdk/aws-ec2/lib/network-acl.ts @@ -1,4 +1,5 @@ -import { Construct, IResource, Resource } from '@aws-cdk/core'; +import { IResource, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnNetworkAcl, CfnNetworkAclEntry, CfnSubnetNetworkAclAssociation } from './ec2.generated'; import { AclCidr, AclTraffic } from './network-acl-types'; import { ISubnet, IVpc, SubnetSelection } from './vpc'; diff --git a/packages/@aws-cdk/aws-ec2/lib/security-group.ts b/packages/@aws-cdk/aws-ec2/lib/security-group.ts index dfc44b8f65a8c..0dec049d029fd 100644 --- a/packages/@aws-cdk/aws-ec2/lib/security-group.ts +++ b/packages/@aws-cdk/aws-ec2/lib/security-group.ts @@ -1,4 +1,5 @@ -import { Construct, IResource, Lazy, Resource, ResourceProps, Stack, Token } from '@aws-cdk/core'; +import { IResource, Lazy, Resource, ResourceProps, Stack, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Connections } from './connections'; import { CfnSecurityGroup, CfnSecurityGroupEgress, CfnSecurityGroupIngress } from './ec2.generated'; import { IPeer } from './peer'; diff --git a/packages/@aws-cdk/aws-ec2/lib/util.ts b/packages/@aws-cdk/aws-ec2/lib/util.ts index e33bc9338eccb..9d56687a41e50 100644 --- a/packages/@aws-cdk/aws-ec2/lib/util.ts +++ b/packages/@aws-cdk/aws-ec2/lib/util.ts @@ -1,4 +1,4 @@ -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ISubnet, Subnet, SubnetType } from './vpc'; /** @@ -70,7 +70,7 @@ export class ImportSubnetGroup { this.names = this.normalizeNames(names, defaultSubnetName(type), nameField); } - public import(scope: cdk.Construct): ISubnet[] { + public import(scope: Construct): ISubnet[] { return range(this.subnetIds.length).map(i => { const k = Math.floor(i / this.availabilityZones.length); return Subnet.fromSubnetAttributes(scope, subnetId(this.names[k], i), { diff --git a/packages/@aws-cdk/aws-ec2/lib/volume.ts b/packages/@aws-cdk/aws-ec2/lib/volume.ts index 6a6445dc87379..a83ea66979098 100644 --- a/packages/@aws-cdk/aws-ec2/lib/volume.ts +++ b/packages/@aws-cdk/aws-ec2/lib/volume.ts @@ -2,7 +2,8 @@ import * as crypto from 'crypto'; import { AccountRootPrincipal, Grant, IGrantable } from '@aws-cdk/aws-iam'; import { IKey, ViaServicePrincipal } from '@aws-cdk/aws-kms'; -import { Construct, IResource, Resource, Size, SizeRoundingBehavior, Stack, Tag, Token } from '@aws-cdk/core'; +import { IResource, Resource, Size, SizeRoundingBehavior, Stack, Tag, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnInstance, CfnVolume } from './ec2.generated'; import { IInstance } from './instance'; diff --git a/packages/@aws-cdk/aws-ec2/lib/vpc-endpoint-service.ts b/packages/@aws-cdk/aws-ec2/lib/vpc-endpoint-service.ts index 71380476225f3..d5d043eef0dc0 100644 --- a/packages/@aws-cdk/aws-ec2/lib/vpc-endpoint-service.ts +++ b/packages/@aws-cdk/aws-ec2/lib/vpc-endpoint-service.ts @@ -1,6 +1,7 @@ import { ArnPrincipal } from '@aws-cdk/aws-iam'; -import { Aws, Construct, Fn, IResource, Resource, Stack, Token } from '@aws-cdk/core'; +import { Aws, Fn, IResource, Resource, Stack, Token } from '@aws-cdk/core'; import { Default, RegionInfo } from '@aws-cdk/region-info'; +import { Construct } from 'constructs'; import { CfnVPCEndpointService, CfnVPCEndpointServicePermissions } from './ec2.generated'; /** diff --git a/packages/@aws-cdk/aws-ec2/lib/vpc-endpoint.ts b/packages/@aws-cdk/aws-ec2/lib/vpc-endpoint.ts index a49ff09fe6634..1bf768d9ed5fd 100644 --- a/packages/@aws-cdk/aws-ec2/lib/vpc-endpoint.ts +++ b/packages/@aws-cdk/aws-ec2/lib/vpc-endpoint.ts @@ -1,6 +1,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as cxschema from '@aws-cdk/cloud-assembly-schema'; -import { Aws, Construct, ContextProvider, IResource, Lazy, Resource, Token } from '@aws-cdk/core'; +import { Aws, ContextProvider, IResource, Lazy, Resource, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Connections, IConnectable } from './connections'; import { CfnVPCEndpoint } from './ec2.generated'; import { Peer } from './peer'; 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 cb6dd75ad49eb..cf28f3b0e1f5b 100644 --- a/packages/@aws-cdk/aws-ec2/lib/vpc-flow-logs.ts +++ b/packages/@aws-cdk/aws-ec2/lib/vpc-flow-logs.ts @@ -1,7 +1,8 @@ import * as iam from '@aws-cdk/aws-iam'; import * as logs from '@aws-cdk/aws-logs'; import * as s3 from '@aws-cdk/aws-s3'; -import { Construct, IResource, PhysicalName, RemovalPolicy, Resource } from '@aws-cdk/core'; +import { IResource, PhysicalName, RemovalPolicy, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnFlowLog } from './ec2.generated'; import { ISubnet, IVpc } from './vpc'; diff --git a/packages/@aws-cdk/aws-ec2/lib/vpc.ts b/packages/@aws-cdk/aws-ec2/lib/vpc.ts index 509c42daebaf9..8dd337a255a7e 100644 --- a/packages/@aws-cdk/aws-ec2/lib/vpc.ts +++ b/packages/@aws-cdk/aws-ec2/lib/vpc.ts @@ -1,7 +1,7 @@ import * as cxschema from '@aws-cdk/cloud-assembly-schema'; -import { ConcreteDependable, Construct, ContextProvider, DependableTrait, IConstruct, - IDependable, IResource, Lazy, Resource, Stack, Tag, Token } from '@aws-cdk/core'; +import { ContextProvider, IResource, Lazy, Resource, Stack, Tag, Token } from '@aws-cdk/core'; import * as cxapi from '@aws-cdk/cx-api'; +import { Construct, Dependable, DependencyGroup, IConstruct, IDependable } from 'constructs'; import { CfnEIP, CfnInternetGateway, CfnNatGateway, CfnRoute, CfnRouteTable, CfnSubnet, CfnSubnetRouteTableAssociation, CfnVPC, CfnVPCGatewayAttachment, CfnVPNGatewayRoutePropagation } from './ec2.generated'; @@ -1115,7 +1115,7 @@ export class Vpc extends VpcBase { */ private subnetConfiguration: SubnetConfiguration[] = []; - private readonly _internetConnectivityEstablished = new ConcreteDependable(); + private readonly _internetConnectivityEstablished = new DependencyGroup(); /** * Vpc creates a VPC that spans a whole region. @@ -1159,7 +1159,7 @@ export class Vpc extends VpcBase { this.vpcDefaultSecurityGroup = this.resource.attrDefaultSecurityGroup; this.vpcIpv6CidrBlocks = this.resource.attrIpv6CidrBlocks; - this.node.applyAspect(new Tag(NAME_TAG, this.node.path)); + Tag.add(this, NAME_TAG, this.node.path); this.availabilityZones = stack.availabilityZones; @@ -1343,8 +1343,8 @@ export class Vpc extends VpcBase { // These values will be used to recover the config upon provider import const includeResourceTypes = [CfnSubnet.CFN_RESOURCE_TYPE_NAME]; - subnet.node.applyAspect(new Tag(SUBNETNAME_TAG, subnetConfig.name, {includeResourceTypes})); - subnet.node.applyAspect(new Tag(SUBNETTYPE_TAG, subnetTypeTagValue(subnetConfig.subnetType), {includeResourceTypes})); + Tag.add(subnet, SUBNETNAME_TAG, subnetConfig.name, {includeResourceTypes}); + Tag.add(subnet, SUBNETTYPE_TAG, subnetTypeTagValue(subnetConfig.subnetType), {includeResourceTypes}); }); } } @@ -1454,7 +1454,7 @@ export class Subnet extends Resource implements ISubnet { public readonly internetConnectivityEstablished: IDependable; - private readonly _internetConnectivityEstablished = new ConcreteDependable(); + private readonly _internetConnectivityEstablished = new DependencyGroup(); private _networkAcl: INetworkAcl; @@ -1463,7 +1463,7 @@ export class Subnet extends Resource implements ISubnet { Object.defineProperty(this, VPC_SUBNET_SYMBOL, { value: true }); - this.node.applyAspect(new Tag(NAME_TAG, this.node.path)); + Tag.add(this, NAME_TAG, this.node.path); this.availabilityZone = props.availabilityZone; const subnet = new CfnSubnet(this, 'Subnet', { @@ -1566,8 +1566,8 @@ export class Subnet extends Resource implements ISubnet { public associateNetworkAcl(id: string, networkAcl: INetworkAcl) { this._networkAcl = networkAcl; - const scope = Construct.isConstruct(networkAcl) ? networkAcl : this; - const other = Construct.isConstruct(networkAcl) ? this : networkAcl; + const scope = networkAcl instanceof Construct ? networkAcl : this; + const other = networkAcl instanceof Construct ? this : networkAcl; new SubnetNetworkAclAssociation(scope, id + other.node.uniqueId, { networkAcl, subnet: this, @@ -1734,7 +1734,7 @@ class ImportedVpc extends VpcBase { public readonly privateSubnets: ISubnet[]; public readonly isolatedSubnets: ISubnet[]; public readonly availabilityZones: string[]; - public readonly internetConnectivityEstablished: IDependable = new ConcreteDependable(); + public readonly internetConnectivityEstablished: IDependable = new DependencyGroup(); private readonly cidr?: string | undefined; constructor(scope: Construct, id: string, props: VpcAttributes, isIncomplete: boolean) { @@ -1768,7 +1768,7 @@ class ImportedVpc extends VpcBase { class LookedUpVpc extends VpcBase { public readonly vpcId: string; public readonly vpnGatewayId: string | undefined; - public readonly internetConnectivityEstablished: IDependable = new ConcreteDependable(); + public readonly internetConnectivityEstablished: IDependable = new DependencyGroup(); public readonly availabilityZones: string[]; public readonly publicSubnets: ISubnet[]; public readonly privateSubnets: ISubnet[]; @@ -1836,11 +1836,11 @@ class CompositeDependable implements IDependable { constructor() { const self = this; - DependableTrait.implement(this, { - get dependencyRoots() { + Dependable.implement(this, { + get dependencies() { const ret = new Array(); for (const dep of self.dependables) { - ret.push(...DependableTrait.get(dep).dependencyRoots); + ret.push(...Dependable.of(dep).dependencies); } return ret; }, @@ -1864,7 +1864,7 @@ function tap(x: T, fn: (x: T) => void): T { } class ImportedSubnet extends Resource implements ISubnet, IPublicSubnet, IPrivateSubnet { - public readonly internetConnectivityEstablished: IDependable = new ConcreteDependable(); + public readonly internetConnectivityEstablished: IDependable = new DependencyGroup(); public readonly subnetId: string; public readonly routeTable: IRouteTable; private readonly _availabilityZone?: string; @@ -1897,8 +1897,8 @@ class ImportedSubnet extends Resource implements ISubnet, IPublicSubnet, IPrivat } public associateNetworkAcl(id: string, networkAcl: INetworkAcl): void { - const scope = Construct.isConstruct(networkAcl) ? networkAcl : this; - const other = Construct.isConstruct(networkAcl) ? this : networkAcl; + const scope = networkAcl instanceof Construct ? networkAcl : this; + const other = networkAcl instanceof Construct ? this : networkAcl; new SubnetNetworkAclAssociation(scope, id + other.node.uniqueId, { networkAcl, subnet: this, diff --git a/packages/@aws-cdk/aws-ec2/lib/vpn.ts b/packages/@aws-cdk/aws-ec2/lib/vpn.ts index 073271572ad92..9d474294b16ad 100644 --- a/packages/@aws-cdk/aws-ec2/lib/vpn.ts +++ b/packages/@aws-cdk/aws-ec2/lib/vpn.ts @@ -1,5 +1,6 @@ import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as net from 'net'; import { CfnCustomerGateway, @@ -7,7 +8,7 @@ import { CfnVPNConnectionRoute, CfnVPNGateway, } from './ec2.generated'; -import {IVpc, SubnetSelection} from './vpc'; +import { IVpc, SubnetSelection } from './vpc'; export interface IVpnConnection extends cdk.IResource { /** @@ -154,7 +155,7 @@ export class VpnGateway extends cdk.Resource implements IVpnGateway { */ public readonly gatewayId: string; - constructor(scope: cdk.Construct, id: string, props: VpnGatewayProps) { + constructor(scope: Construct, id: string, props: VpnGatewayProps) { super(scope, id); // This is 'Default' instead of 'Resource', because using 'Default' will generate @@ -213,7 +214,7 @@ export class VpnConnection extends cdk.Resource implements IVpnConnection { public readonly customerGatewayIp: string; public readonly customerGatewayAsn: number; - constructor(scope: cdk.Construct, id: string, props: VpnConnectionProps) { + constructor(scope: Construct, id: string, props: VpnConnectionProps) { super(scope, id); if (!props.vpc.vpnGatewayId) { diff --git a/packages/@aws-cdk/aws-ec2/package.json b/packages/@aws-cdk/aws-ec2/package.json index ad6075cc5ec77..66b6f7736aa9a 100644 --- a/packages/@aws-cdk/aws-ec2/package.json +++ b/packages/@aws-cdk/aws-ec2/package.json @@ -82,7 +82,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.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -96,7 +96,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.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-ec2/rosetta/conns.ts-fixture b/packages/@aws-cdk/aws-ec2/rosetta/conns.ts-fixture index f29d9a1816a6e..c155f1ee8f045 100644 --- a/packages/@aws-cdk/aws-ec2/rosetta/conns.ts-fixture +++ b/packages/@aws-cdk/aws-ec2/rosetta/conns.ts-fixture @@ -1,5 +1,6 @@ // Fixture with fake connectables -import { Construct, Stack } from '@aws-cdk/core'; +import { Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import ec2 = require('@aws-cdk/aws-ec2'); class Fixture extends Stack { diff --git a/packages/@aws-cdk/aws-ec2/rosetta/default.ts-fixture b/packages/@aws-cdk/aws-ec2/rosetta/default.ts-fixture index d4ecd7e92a6f1..1bf1585cf2d2a 100644 --- a/packages/@aws-cdk/aws-ec2/rosetta/default.ts-fixture +++ b/packages/@aws-cdk/aws-ec2/rosetta/default.ts-fixture @@ -1,5 +1,7 @@ // Fixture with packages imported, but nothing else -import { Construct, Stack } from '@aws-cdk/core'; +import { Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; + import ec2 = require('@aws-cdk/aws-ec2'); import iam = require('@aws-cdk/aws-iam'); diff --git a/packages/@aws-cdk/aws-ec2/rosetta/with-vpc.ts-fixture b/packages/@aws-cdk/aws-ec2/rosetta/with-vpc.ts-fixture index dd8e539f8cf9f..955f68dce61fd 100644 --- a/packages/@aws-cdk/aws-ec2/rosetta/with-vpc.ts-fixture +++ b/packages/@aws-cdk/aws-ec2/rosetta/with-vpc.ts-fixture @@ -1,5 +1,6 @@ // Fixture with packages imported and a VPC created -import { Construct, Stack } from '@aws-cdk/core'; +import { Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import ec2 = require('@aws-cdk/aws-ec2'); class Fixture extends Stack { diff --git a/packages/@aws-cdk/aws-ec2/test/connections.test.ts b/packages/@aws-cdk/aws-ec2/test/connections.test.ts index 2721f073cf6b0..294f405511de3 100644 --- a/packages/@aws-cdk/aws-ec2/test/connections.test.ts +++ b/packages/@aws-cdk/aws-ec2/test/connections.test.ts @@ -1,5 +1,5 @@ import { expect, haveResource } from '@aws-cdk/assert'; -import { App, ConstructNode, Stack } from '@aws-cdk/core'; +import { App, Stack } from '@aws-cdk/core'; import { nodeunitShim, Test } from 'nodeunit-shim'; import { @@ -185,7 +185,7 @@ nodeunitShim({ sg2.connections.allowFrom(sg1, Port.tcp(100)); // THEN -- both rules are in Stack2 - ConstructNode.prepare(app.node); + app.synth(); expect(stack2).to(haveResource('AWS::EC2::SecurityGroupIngress', { GroupId: { 'Fn::GetAtt': [ 'SecurityGroupDD263621', 'GroupId' ] }, @@ -216,7 +216,7 @@ nodeunitShim({ sg2.connections.allowTo(sg1, Port.tcp(100)); // THEN -- both rules are in Stack2 - ConstructNode.prepare(app.node); + app.synth(); expect(stack2).to(haveResource('AWS::EC2::SecurityGroupIngress', { GroupId: { 'Fn::ImportValue': 'Stack1:ExportsOutputFnGetAttSecurityGroupDD263621GroupIdDF6F8B09' }, @@ -249,7 +249,7 @@ nodeunitShim({ sg2.connections.allowFrom(sg1b, Port.tcp(100)); // THEN -- both egress rules are in Stack2 - ConstructNode.prepare(app.node); + app.synth(); expect(stack2).to(haveResource('AWS::EC2::SecurityGroupEgress', { GroupId: { 'Fn::ImportValue': 'Stack1:ExportsOutputFnGetAttSecurityGroupAED40ADC5GroupId1D10C76A' }, 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 cbf79ac7a4944..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,5 +1,6 @@ /// !cdk-integ * import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as ec2 from '../lib'; const app = new cdk.App(); @@ -8,8 +9,8 @@ interface ConstructThatTakesAVpcProps { vpc: ec2.IVpc; } -class ConstructThatTakesAVpc extends cdk.Construct { - constructor(scope: cdk.Construct, id: string, _props: ConstructThatTakesAVpcProps) { +class ConstructThatTakesAVpc extends Construct { + constructor(scope: Construct, id: string, _props: ConstructThatTakesAVpcProps) { super(scope, id); // new ec2.CfnInstance(this, 'Instance', { diff --git a/packages/@aws-cdk/aws-ec2/test/vpc.from-lookup.test.ts b/packages/@aws-cdk/aws-ec2/test/vpc.from-lookup.test.ts index 170f62f6f61a5..d50cd211a5a74 100644 --- a/packages/@aws-cdk/aws-ec2/test/vpc.from-lookup.test.ts +++ b/packages/@aws-cdk/aws-ec2/test/vpc.from-lookup.test.ts @@ -1,6 +1,7 @@ import * as cxschema from '@aws-cdk/cloud-assembly-schema'; -import { Construct, ContextProvider, GetContextValueOptions, GetContextValueResult, Lazy, Stack } from '@aws-cdk/core'; +import { ContextProvider, GetContextValueOptions, GetContextValueResult, Lazy, Stack } from '@aws-cdk/core'; import * as cxapi from '@aws-cdk/cx-api'; +import { Construct } from 'constructs'; import { nodeunitShim, Test } from 'nodeunit-shim'; import { GenericLinuxImage, Instance, InstanceType, SubnetType, Vpc } from '../lib'; diff --git a/packages/@aws-cdk/aws-ec2/test/vpc.test.ts b/packages/@aws-cdk/aws-ec2/test/vpc.test.ts index 280c1e2ac4e11..baacb5eb9fbe7 100644 --- a/packages/@aws-cdk/aws-ec2/test/vpc.test.ts +++ b/packages/@aws-cdk/aws-ec2/test/vpc.test.ts @@ -943,8 +943,8 @@ nodeunitShim({ const vpc = new Vpc(stack, 'TheVPC'); // overwrite to set propagate - vpc.node.applyAspect(new Tag('BusinessUnit', 'Marketing', {includeResourceTypes: [CfnVPC.CFN_RESOURCE_TYPE_NAME]})); - vpc.node.applyAspect(new Tag('VpcType', 'Good')); + Tag.add(vpc, 'BusinessUnit', 'Marketing', {includeResourceTypes: [CfnVPC.CFN_RESOURCE_TYPE_NAME]}); + Tag.add(vpc, 'VpcType', 'Good'); expect(stack).to(haveResource('AWS::EC2::VPC', hasTags(toCfnTags(allTags)))); const taggables = ['Subnet', 'InternetGateway', 'NatGateway', 'RouteTable']; const propTags = toCfnTags(tags); @@ -975,7 +975,7 @@ nodeunitShim({ const vpc = new Vpc(stack, 'TheVPC'); const tag = {Key: 'Late', Value: 'Adder'}; expect(stack).notTo(haveResource('AWS::EC2::VPC', hasTags([tag]))); - vpc.node.applyAspect(new Tag(tag.Key, tag.Value)); + Tag.add(vpc, tag.Key, tag.Value); expect(stack).to(haveResource('AWS::EC2::VPC', hasTags([tag]))); test.done(); }, 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 09c4a033a8476..b86925d322f2e 100644 --- a/packages/@aws-cdk/aws-ecr-assets/lib/image-asset.ts +++ b/packages/@aws-cdk/aws-ecr-assets/lib/image-asset.ts @@ -1,6 +1,7 @@ import * as assets from '@aws-cdk/assets'; import * as ecr from '@aws-cdk/aws-ecr'; -import { Construct, Stack, Token } from '@aws-cdk/core'; +import { Stack, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as fs from 'fs'; import * as minimatch from 'minimatch'; import * as path from 'path'; diff --git a/packages/@aws-cdk/aws-ecr-assets/package.json b/packages/@aws-cdk/aws-ecr-assets/package.json index b8bf88738da1d..97424cd312769 100644 --- a/packages/@aws-cdk/aws-ecr-assets/package.json +++ b/packages/@aws-cdk/aws-ecr-assets/package.json @@ -79,7 +79,7 @@ "@aws-cdk/assets": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "minimatch": "^3.0.4", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -90,7 +90,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "nyc": { "statements": 70 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 19ccbe42ca5a3..601d622dc192a 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,5 +1,6 @@ import * as iam from '@aws-cdk/aws-iam'; -import { App, CfnOutput, Construct, NestedStack, NestedStackProps, Stack, StackProps } from '@aws-cdk/core'; +import { App, CfnOutput, NestedStack, NestedStackProps, Stack, StackProps } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as path from 'path'; import * as ecr_assets from '../lib'; diff --git a/packages/@aws-cdk/aws-ecr/lib/repository.ts b/packages/@aws-cdk/aws-ecr/lib/repository.ts index 6a6f5b617b832..6f7d9a9ee464f 100644 --- a/packages/@aws-cdk/aws-ecr/lib/repository.ts +++ b/packages/@aws-cdk/aws-ecr/lib/repository.ts @@ -1,7 +1,8 @@ import * as events from '@aws-cdk/aws-events'; import * as iam from '@aws-cdk/aws-iam'; -import { Construct, IConstruct, IResource, Lazy, RemovalPolicy, Resource, Stack, Token } from '@aws-cdk/core'; +import { IResource, Lazy, RemovalPolicy, Resource, Stack, Token } from '@aws-cdk/core'; import * as cr from '@aws-cdk/custom-resources'; +import { Construct, IConstruct } from 'constructs'; import { CfnRepository } from './ecr.generated'; import { LifecycleRule, TagStatus } from './lifecycle'; diff --git a/packages/@aws-cdk/aws-ecr/package.json b/packages/@aws-cdk/aws-ecr/package.json index fafe098831c9b..f9c5274804822 100644 --- a/packages/@aws-cdk/aws-ecr/package.json +++ b/packages/@aws-cdk/aws-ecr/package.json @@ -79,7 +79,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -87,7 +87,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 f5908a12e704f..ce7b8221f251b 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 @@ -1,12 +1,15 @@ import { DnsValidatedCertificate, ICertificate } from '@aws-cdk/aws-certificatemanager'; import { IVpc } from '@aws-cdk/aws-ec2'; import { AwsLogDriver, BaseService, CloudMapOptions, Cluster, ContainerImage, ICluster, LogDriver, PropagatedTagSource, Secret } from '@aws-cdk/aws-ecs'; -import { ApplicationListener, ApplicationLoadBalancer, ApplicationProtocol, ApplicationTargetGroup, - IApplicationLoadBalancer, ListenerCertificate} from '@aws-cdk/aws-elasticloadbalancingv2'; +import { + ApplicationListener, ApplicationLoadBalancer, ApplicationProtocol, ApplicationTargetGroup, + IApplicationLoadBalancer, ListenerCertificate, +} from '@aws-cdk/aws-elasticloadbalancingv2'; import { IRole } from '@aws-cdk/aws-iam'; import { ARecord, IHostedZone, RecordTarget } from '@aws-cdk/aws-route53'; import { LoadBalancerTarget } from '@aws-cdk/aws-route53-targets'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * The properties for the base ApplicationLoadBalancedEc2Service or ApplicationLoadBalancedFargateService service. @@ -245,7 +248,7 @@ export interface ApplicationLoadBalancedTaskImageOptions { /** * The base class for ApplicationLoadBalancedEc2Service and ApplicationLoadBalancedFargateService services. */ -export abstract class ApplicationLoadBalancedServiceBase extends cdk.Construct { +export abstract class ApplicationLoadBalancedServiceBase extends Construct { /** * The desired number of instantiations of the task definition to keep running on the service. @@ -287,7 +290,7 @@ export abstract class ApplicationLoadBalancedServiceBase extends cdk.Construct { /** * Constructs a new instance of the ApplicationLoadBalancedServiceBase class. */ - constructor(scope: cdk.Construct, id: string, props: ApplicationLoadBalancedServiceBaseProps = {}) { + constructor(scope: Construct, id: string, props: ApplicationLoadBalancedServiceBaseProps = {}) { super(scope, id); if (props.cluster && props.vpc) { @@ -371,7 +374,7 @@ export abstract class ApplicationLoadBalancedServiceBase extends cdk.Construct { /** * Returns the default cluster. */ - protected getDefaultCluster(scope: cdk.Construct, 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 e5bb9ba08ce7f..ed91b385f7e69 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 @@ -6,7 +6,8 @@ import { ApplicationListener, ApplicationLoadBalancer, ApplicationProtocol, Appl import { IRole } from '@aws-cdk/aws-iam'; import { ARecord, IHostedZone, RecordTarget } from '@aws-cdk/aws-route53'; import { LoadBalancerTarget } from '@aws-cdk/aws-route53-targets'; -import { CfnOutput, Construct, Duration, Stack } from '@aws-cdk/core'; +import { CfnOutput, Duration, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * The properties for the base ApplicationMultipleTargetGroupsEc2Service or ApplicationMultipleTargetGroupsFargateService service. 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 567e952140b5b..34299abf98713 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 @@ -5,6 +5,7 @@ import { IRole } from '@aws-cdk/aws-iam'; import { ARecord, IHostedZone, RecordTarget } from '@aws-cdk/aws-route53'; import { LoadBalancerTarget } from '@aws-cdk/aws-route53-targets'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * The properties for the base NetworkLoadBalancedEc2Service or NetworkLoadBalancedFargateService service. @@ -221,7 +222,7 @@ export interface NetworkLoadBalancedTaskImageOptions { /** * The base class for NetworkLoadBalancedEc2Service and NetworkLoadBalancedFargateService services. */ -export abstract class NetworkLoadBalancedServiceBase extends cdk.Construct { +export abstract class NetworkLoadBalancedServiceBase extends Construct { /** * The desired number of instantiations of the task definition to keep running on the service. */ @@ -256,7 +257,7 @@ export abstract class NetworkLoadBalancedServiceBase extends cdk.Construct { /** * Constructs a new instance of the NetworkLoadBalancedServiceBase class. */ - constructor(scope: cdk.Construct, id: string, props: NetworkLoadBalancedServiceBaseProps = {}) { + constructor(scope: Construct, id: string, props: NetworkLoadBalancedServiceBaseProps = {}) { super(scope, id); if (props.cluster && props.vpc) { @@ -312,7 +313,7 @@ export abstract class NetworkLoadBalancedServiceBase extends cdk.Construct { /** * Returns the default cluster. */ - protected getDefaultCluster(scope: cdk.Construct, 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 54ec00ef64b1a..e804110dbf016 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 @@ -5,7 +5,8 @@ import { NetworkListener, NetworkLoadBalancer, NetworkTargetGroup } from '@aws-c import { IRole } from '@aws-cdk/aws-iam'; import { ARecord, IHostedZone, RecordTarget } from '@aws-cdk/aws-route53'; import { LoadBalancerTarget } from '@aws-cdk/aws-route53-targets'; -import { CfnOutput, Construct, Duration, Stack } from '@aws-cdk/core'; +import { CfnOutput, Duration, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * The properties for the base NetworkMultipleTargetGroupsEc2Service or NetworkMultipleTargetGroupsFargateService service. 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 cd9e2f85f4633..9de423b9dec36 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 @@ -2,7 +2,8 @@ import { ScalingInterval } from '@aws-cdk/aws-applicationautoscaling'; import { IVpc } from '@aws-cdk/aws-ec2'; import { AwsLogDriver, BaseService, Cluster, ContainerImage, ICluster, LogDriver, PropagatedTagSource, Secret } from '@aws-cdk/aws-ecs'; import { IQueue, Queue } from '@aws-cdk/aws-sqs'; -import { CfnOutput, Construct, Duration, Stack } from '@aws-cdk/core'; +import { CfnOutput, Duration, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * The properties for the base QueueProcessingEc2Service or QueueProcessingFargateService service. 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 47f14de90e59a..7d931abc41305 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 @@ -3,7 +3,8 @@ import { IVpc, SubnetSelection, SubnetType } from '@aws-cdk/aws-ec2'; import { AwsLogDriver, Cluster, ContainerImage, ICluster, LogDriver, Secret, TaskDefinition } from '@aws-cdk/aws-ecs'; import { Rule } from '@aws-cdk/aws-events'; import { EcsTask } from '@aws-cdk/aws-events-targets'; -import { Construct, Stack } from '@aws-cdk/core'; +import { Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * The properties for the base ScheduledEc2Task or ScheduledFargateTask task. diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/application-load-balanced-ecs-service.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/application-load-balanced-ecs-service.ts index f38cdbba5e3ca..142443de7cce2 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/application-load-balanced-ecs-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/application-load-balanced-ecs-service.ts @@ -1,5 +1,5 @@ import { Ec2Service, Ec2TaskDefinition } from '@aws-cdk/aws-ecs'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ApplicationLoadBalancedServiceBase, ApplicationLoadBalancedServiceBaseProps } from '../base/application-load-balanced-service-base'; /** diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/application-multiple-target-groups-ecs-service.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/application-multiple-target-groups-ecs-service.ts index 67b58fb8af986..1cf9b9b018753 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/application-multiple-target-groups-ecs-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/application-multiple-target-groups-ecs-service.ts @@ -1,6 +1,6 @@ import { Ec2Service, Ec2TaskDefinition } from '@aws-cdk/aws-ecs'; import { ApplicationTargetGroup } from '@aws-cdk/aws-elasticloadbalancingv2'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ApplicationMultipleTargetGroupsServiceBase, ApplicationMultipleTargetGroupsServiceBaseProps } from '../base/application-multiple-target-groups-service-base'; diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/network-load-balanced-ecs-service.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/network-load-balanced-ecs-service.ts index f6738f52ac687..64c72e0e03c94 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/network-load-balanced-ecs-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/network-load-balanced-ecs-service.ts @@ -1,5 +1,5 @@ import { Ec2Service, Ec2TaskDefinition } from '@aws-cdk/aws-ecs'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { NetworkLoadBalancedServiceBase, NetworkLoadBalancedServiceBaseProps } from '../base/network-load-balanced-service-base'; /** diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/network-multiple-target-groups-ecs-service.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/network-multiple-target-groups-ecs-service.ts index 2b8922a30900f..f5e879956e511 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/network-multiple-target-groups-ecs-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/network-multiple-target-groups-ecs-service.ts @@ -1,6 +1,6 @@ import { Ec2Service, Ec2TaskDefinition } from '@aws-cdk/aws-ecs'; import { NetworkTargetGroup } from '@aws-cdk/aws-elasticloadbalancingv2'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { NetworkMultipleTargetGroupsServiceBase, NetworkMultipleTargetGroupsServiceBaseProps } from '../base/network-multiple-target-groups-service-base'; diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/queue-processing-ecs-service.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/queue-processing-ecs-service.ts index ff7cb0e905d98..0814ac40ba206 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/queue-processing-ecs-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/queue-processing-ecs-service.ts @@ -1,5 +1,5 @@ import { Ec2Service, Ec2TaskDefinition } from '@aws-cdk/aws-ecs'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { QueueProcessingServiceBase, QueueProcessingServiceBaseProps } from '../base/queue-processing-service-base'; /** diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/scheduled-ecs-task.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/scheduled-ecs-task.ts index 7f0776dc812d4..7350ae82bb2cc 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/scheduled-ecs-task.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/ecs/scheduled-ecs-task.ts @@ -1,5 +1,5 @@ import { Ec2TaskDefinition } from '@aws-cdk/aws-ecs'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ScheduledTaskBase, ScheduledTaskBaseProps, ScheduledTaskImageProps } from '../base/scheduled-task-base'; /** diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-load-balanced-fargate-service.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-load-balanced-fargate-service.ts index baa8a191410dc..2a9063adaf9f1 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-load-balanced-fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-load-balanced-fargate-service.ts @@ -1,5 +1,5 @@ import { FargatePlatformVersion, FargateService, FargateTaskDefinition } from '@aws-cdk/aws-ecs'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ApplicationLoadBalancedServiceBase, ApplicationLoadBalancedServiceBaseProps } from '../base/application-load-balanced-service-base'; /** diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-multiple-target-groups-fargate-service.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-multiple-target-groups-fargate-service.ts index c38b262d845e3..2a9f8fe249934 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-multiple-target-groups-fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-multiple-target-groups-fargate-service.ts @@ -1,6 +1,6 @@ import { FargatePlatformVersion, FargateService, FargateTaskDefinition } from '@aws-cdk/aws-ecs'; import { ApplicationTargetGroup } from '@aws-cdk/aws-elasticloadbalancingv2'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ApplicationMultipleTargetGroupsServiceBase, ApplicationMultipleTargetGroupsServiceBaseProps } from '../base/application-multiple-target-groups-service-base'; diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/network-load-balanced-fargate-service.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/network-load-balanced-fargate-service.ts index c86e279ab2ea1..3111ccf8d2746 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/network-load-balanced-fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/network-load-balanced-fargate-service.ts @@ -1,5 +1,5 @@ import { FargatePlatformVersion, FargateService, FargateTaskDefinition } from '@aws-cdk/aws-ecs'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { NetworkLoadBalancedServiceBase, NetworkLoadBalancedServiceBaseProps } from '../base/network-load-balanced-service-base'; /** diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/network-multiple-target-groups-fargate-service.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/network-multiple-target-groups-fargate-service.ts index 7b268027e3b55..a12a1a31b8ddd 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/network-multiple-target-groups-fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/network-multiple-target-groups-fargate-service.ts @@ -1,6 +1,6 @@ import { FargatePlatformVersion, FargateService, FargateTaskDefinition } from '@aws-cdk/aws-ecs'; import { NetworkTargetGroup } from '@aws-cdk/aws-elasticloadbalancingv2'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { NetworkMultipleTargetGroupsServiceBase, NetworkMultipleTargetGroupsServiceBaseProps } from '../base/network-multiple-target-groups-service-base'; diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/queue-processing-fargate-service.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/queue-processing-fargate-service.ts index b0f92abab6f23..931fe00d9985b 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/queue-processing-fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/queue-processing-fargate-service.ts @@ -1,5 +1,5 @@ import { FargatePlatformVersion, FargateService, FargateTaskDefinition } from '@aws-cdk/aws-ecs'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { QueueProcessingServiceBase, QueueProcessingServiceBaseProps } from '../base/queue-processing-service-base'; /** diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/scheduled-fargate-task.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/scheduled-fargate-task.ts index e2c3dec274de8..8ad898693b6bd 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/scheduled-fargate-task.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/scheduled-fargate-task.ts @@ -1,5 +1,5 @@ import { FargateTaskDefinition } from '@aws-cdk/aws-ecs'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ScheduledTaskBase, ScheduledTaskBaseProps, ScheduledTaskImageProps } from '../base/scheduled-task-base'; /** diff --git a/packages/@aws-cdk/aws-ecs-patterns/package.json b/packages/@aws-cdk/aws-ecs-patterns/package.json index 16bcc51f7e25e..0ce5c9f8074f4 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/package.json +++ b/packages/@aws-cdk/aws-ecs-patterns/package.json @@ -82,7 +82,7 @@ "@aws-cdk/aws-servicediscovery": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -99,7 +99,7 @@ "@aws-cdk/aws-servicediscovery": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-ecs/lib/base/base-service.ts b/packages/@aws-cdk/aws-ecs/lib/base/base-service.ts index 6e37c99b2250a..16948e91b9166 100644 --- a/packages/@aws-cdk/aws-ecs/lib/base/base-service.ts +++ b/packages/@aws-cdk/aws-ecs/lib/base/base-service.ts @@ -5,7 +5,8 @@ import * as elb from '@aws-cdk/aws-elasticloadbalancing'; import * as elbv2 from '@aws-cdk/aws-elasticloadbalancingv2'; import * as iam from '@aws-cdk/aws-iam'; import * as cloudmap from '@aws-cdk/aws-servicediscovery'; -import { Construct, Duration, IResolvable, IResource, Lazy, Resource, Stack } from '@aws-cdk/core'; +import { Duration, IResolvable, IResource, Lazy, Resource, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { LoadBalancerTargetOptions, NetworkMode, TaskDefinition } from '../base/task-definition'; import { ICluster } from '../cluster'; import { Protocol } from '../container-definition'; diff --git a/packages/@aws-cdk/aws-ecs/lib/base/from-service-attributes.ts b/packages/@aws-cdk/aws-ecs/lib/base/from-service-attributes.ts index 9128c00b0430d..80ec042626153 100644 --- a/packages/@aws-cdk/aws-ecs/lib/base/from-service-attributes.ts +++ b/packages/@aws-cdk/aws-ecs/lib/base/from-service-attributes.ts @@ -1,4 +1,5 @@ -import { Construct, Resource, Stack } from '@aws-cdk/core'; +import { Resource, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { IBaseService } from '../base/base-service'; import { ICluster } from '../cluster'; diff --git a/packages/@aws-cdk/aws-ecs/lib/base/scalable-task-count.ts b/packages/@aws-cdk/aws-ecs/lib/base/scalable-task-count.ts index 8560a3c0e2ba7..c0ee52a2d7298 100644 --- a/packages/@aws-cdk/aws-ecs/lib/base/scalable-task-count.ts +++ b/packages/@aws-cdk/aws-ecs/lib/base/scalable-task-count.ts @@ -1,7 +1,7 @@ import * as appscaling from '@aws-cdk/aws-applicationautoscaling'; import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; import * as elbv2 from '@aws-cdk/aws-elasticloadbalancingv2'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * The properties of a scalable attribute representing task count. 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 a04e51781b018..f9fc04c555eee 100644 --- a/packages/@aws-cdk/aws-ecs/lib/base/task-definition.ts +++ b/packages/@aws-cdk/aws-ecs/lib/base/task-definition.ts @@ -1,6 +1,7 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; -import { Construct, IResource, Lazy, Resource } from '@aws-cdk/core'; +import { IResource, Lazy, Resource } from '@aws-cdk/core'; +import { Construct, IValidation } from 'constructs'; import { ContainerDefinition, ContainerDefinitionOptions, PortMapping, Protocol } from '../container-definition'; import { CfnTaskDefinition } from '../ecs.generated'; import { FirelensLogRouter, FirelensLogRouterDefinitionOptions, FirelensLogRouterType, obtainDefaultFluentBitECRImage } from '../firelens-log-router'; @@ -190,7 +191,7 @@ abstract class TaskDefinitionBase extends Resource implements ITaskDefinition { /** * The base class for all task definitions. */ -export class TaskDefinition extends TaskDefinitionBase { +export class TaskDefinition extends TaskDefinitionBase implements IValidation { /** * Imports a task definition from the specified task definition ARN. @@ -451,8 +452,8 @@ export class TaskDefinition extends TaskDefinitionBase { /** * Validates the task definition. */ - protected validate(): string[] { - const ret = super.validate(); + public validate(): 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 a16f4410af706..958244b4cb619 100644 --- a/packages/@aws-cdk/aws-ecs/lib/cluster.ts +++ b/packages/@aws-cdk/aws-ecs/lib/cluster.ts @@ -4,7 +4,8 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import * as cloudmap from '@aws-cdk/aws-servicediscovery'; import * as ssm from '@aws-cdk/aws-ssm'; -import { Construct, Duration, IResource, Resource, Stack } from '@aws-cdk/core'; +import { Duration, IResource, Resource, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { InstanceDrainHook } from './drain-hook/instance-drain-hook'; import { CfnCluster } from './ecs.generated'; diff --git a/packages/@aws-cdk/aws-ecs/lib/container-definition.ts b/packages/@aws-cdk/aws-ecs/lib/container-definition.ts index 26da3b453bf46..34653128884f9 100644 --- a/packages/@aws-cdk/aws-ecs/lib/container-definition.ts +++ b/packages/@aws-cdk/aws-ecs/lib/container-definition.ts @@ -2,6 +2,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; import * as ssm from '@aws-cdk/aws-ssm'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { NetworkMode, TaskDefinition } from './base/task-definition'; import { ContainerImage, ContainerImageConfig } from './container-image'; import { CfnTaskDefinition } from './ecs.generated'; @@ -290,7 +291,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 cdk.Construct { +export class ContainerDefinition extends Construct { /** * The Linux-specific modifications that are applied to the container, such as Linux kernel capabilities. */ @@ -366,7 +367,7 @@ export class ContainerDefinition extends cdk.Construct { /** * Constructs a new instance of the ContainerDefinition class. */ - constructor(scope: cdk.Construct, id: string, private readonly props: ContainerDefinitionProps) { + constructor(scope: Construct, id: string, private readonly props: ContainerDefinitionProps) { super(scope, id); if (props.memoryLimitMiB !== undefined && props.memoryReservationMiB !== undefined) { if (props.memoryLimitMiB < props.memoryReservationMiB) { diff --git a/packages/@aws-cdk/aws-ecs/lib/container-image.ts b/packages/@aws-cdk/aws-ecs/lib/container-image.ts index 0e954415b8afd..6413881f0074f 100644 --- a/packages/@aws-cdk/aws-ecs/lib/container-image.ts +++ b/packages/@aws-cdk/aws-ecs/lib/container-image.ts @@ -1,5 +1,6 @@ import * as ecr from '@aws-cdk/aws-ecr'; -import * as cdk from '@aws-cdk/core'; +import { DockerImageAsset } from '@aws-cdk/aws-ecr-assets'; +import { Construct } from 'constructs'; import { ContainerDefinition } from './container-definition'; import { CfnTaskDefinition } from './ecs.generated'; @@ -40,7 +41,7 @@ export abstract class ContainerImage { */ public static fromDockerImageAsset(asset: DockerImageAsset): ContainerImage { return { - bind(_scope: cdk.Construct, containerDefinition: ContainerDefinition): ContainerImageConfig { + bind(_scope: Construct, containerDefinition: ContainerDefinition): ContainerImageConfig { asset.repository.grantPull(containerDefinition.taskDefinition.obtainExecutionRole()); return { imageName: asset.imageUri, @@ -52,7 +53,7 @@ export abstract class ContainerImage { /** * Called when the image is used by a ContainerDefinition */ - public abstract bind(scope: cdk.Construct, containerDefinition: ContainerDefinition): ContainerImageConfig; + public abstract bind(scope: Construct, containerDefinition: ContainerDefinition): ContainerImageConfig; } /** @@ -70,7 +71,6 @@ export interface ContainerImageConfig { readonly repositoryCredentials?: CfnTaskDefinition.RepositoryCredentialsProperty; } -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 34f402fb97ab1..74d8510329061 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 @@ -3,6 +3,7 @@ import * as hooks from '@aws-cdk/aws-autoscaling-hooktargets'; 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 * as fs from 'fs'; import * as path from 'path'; import { ICluster } from '../cluster'; @@ -38,12 +39,12 @@ export interface InstanceDrainHookProps { /** * A hook to drain instances from ECS traffic before they're terminated */ -export class InstanceDrainHook extends cdk.Construct { +export class InstanceDrainHook extends Construct { /** * Constructs a new instance of the InstanceDrainHook class. */ - constructor(scope: cdk.Construct, id: string, props: InstanceDrainHookProps) { + constructor(scope: Construct, id: string, props: InstanceDrainHookProps) { super(scope, id); const drainTime = props.drainTime || cdk.Duration.minutes(5); 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 9d89a1f03704f..1deec680ecd1f 100644 --- a/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts +++ b/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts @@ -1,5 +1,6 @@ import * as ec2 from '@aws-cdk/aws-ec2'; -import { Construct, Lazy, Resource, Stack } from '@aws-cdk/core'; +import { Lazy, Resource, Stack } from '@aws-cdk/core'; +import { Construct, IValidation } from 'constructs'; import { BaseService, BaseServiceOptions, DeploymentControllerType, IBaseService, IService, LaunchType, PropagatedTagSource } from '../base/base-service'; import { fromServiceAtrributes } from '../base/from-service-attributes'; import { NetworkMode, TaskDefinition } from '../base/task-definition'; @@ -128,7 +129,7 @@ export interface Ec2ServiceAttributes { * * @resource AWS::ECS::Service */ -export class Ec2Service extends BaseService implements IEc2Service { +export class Ec2Service extends BaseService implements IEc2Service, IValidation { /** * Imports from the specified service ARN. @@ -262,8 +263,8 @@ export class Ec2Service extends BaseService implements IEc2Service { /** * Validates this Ec2Service. */ - protected validate(): string[] { - const ret = super.validate(); + public validate(): 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/ec2/ec2-task-definition.ts b/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-task-definition.ts index de25514330b33..67d096830b9c7 100644 --- a/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-task-definition.ts +++ b/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-task-definition.ts @@ -1,4 +1,5 @@ -import { Construct, Resource } from '@aws-cdk/core'; +import { Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CommonTaskDefinitionProps, Compatibility, IpcMode, ITaskDefinition, NetworkMode, PidMode, TaskDefinition } from '../base/task-definition'; import { PlacementConstraint } from '../placement'; diff --git a/packages/@aws-cdk/aws-ecs/lib/fargate/fargate-service.ts b/packages/@aws-cdk/aws-ecs/lib/fargate/fargate-service.ts index 4633a4b42fd57..57af68b3ab254 100644 --- a/packages/@aws-cdk/aws-ecs/lib/fargate/fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs/lib/fargate/fargate-service.ts @@ -1,5 +1,6 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { BaseService, BaseServiceOptions, DeploymentControllerType, IBaseService, IService, LaunchType, PropagatedTagSource } from '../base/base-service'; import { fromServiceAtrributes } from '../base/from-service-attributes'; import { TaskDefinition } from '../base/task-definition'; @@ -109,7 +110,7 @@ export class FargateService extends BaseService implements IFargateService { /** * Imports from the specified service ARN. */ - public static fromFargateServiceArn(scope: cdk.Construct, id: string, fargateServiceArn: string): IFargateService { + public static fromFargateServiceArn(scope: Construct, id: string, fargateServiceArn: string): IFargateService { class Import extends cdk.Resource implements IFargateService { public readonly serviceArn = fargateServiceArn; public readonly serviceName = cdk.Stack.of(scope).parseArn(fargateServiceArn).resourceName as string; @@ -120,14 +121,14 @@ export class FargateService extends BaseService implements IFargateService { /** * Imports from the specified service attrributes. */ - public static fromFargateServiceAttributes(scope: cdk.Construct, id: string, attrs: FargateServiceAttributes): IBaseService { + public static fromFargateServiceAttributes(scope: Construct, id: string, attrs: FargateServiceAttributes): IBaseService { return fromServiceAtrributes(scope, id, attrs); } /** * Constructs a new instance of the FargateService class. */ - constructor(scope: cdk.Construct, id: string, props: FargateServiceProps) { + constructor(scope: Construct, id: string, props: FargateServiceProps) { if (!props.taskDefinition.isFargateCompatible) { throw new Error('Supplied TaskDefinition is not configured for compatibility with Fargate'); } diff --git a/packages/@aws-cdk/aws-ecs/lib/fargate/fargate-task-definition.ts b/packages/@aws-cdk/aws-ecs/lib/fargate/fargate-task-definition.ts index d60f4c7cc362c..4513e55debe63 100644 --- a/packages/@aws-cdk/aws-ecs/lib/fargate/fargate-task-definition.ts +++ b/packages/@aws-cdk/aws-ecs/lib/fargate/fargate-task-definition.ts @@ -1,4 +1,5 @@ -import { Construct, Resource, Tokenization } from '@aws-cdk/core'; +import { Resource, Tokenization } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CommonTaskDefinitionProps, Compatibility, ITaskDefinition, NetworkMode, TaskDefinition } from '../base/task-definition'; /** diff --git a/packages/@aws-cdk/aws-ecs/lib/firelens-log-router.ts b/packages/@aws-cdk/aws-ecs/lib/firelens-log-router.ts index 696da01332421..0d77fca0eb0e2 100644 --- a/packages/@aws-cdk/aws-ecs/lib/firelens-log-router.ts +++ b/packages/@aws-cdk/aws-ecs/lib/firelens-log-router.ts @@ -1,6 +1,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as ssm from '@aws-cdk/aws-ssm'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { TaskDefinition } from './base/task-definition'; import { ContainerDefinition, ContainerDefinitionOptions, ContainerDefinitionProps } from './container-definition'; import { ContainerImage } from './container-image'; @@ -196,7 +197,7 @@ export class FirelensLogRouter extends ContainerDefinition { /** * Constructs a new instance of the FirelensLogRouter class. */ - constructor(scope: cdk.Construct, id: string, props: FirelensLogRouterProps) { + constructor(scope: Construct, id: string, props: FirelensLogRouterProps) { super(scope, id, props); const options = props.firelensConfig.options; if (options) { 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 0495a57e30d80..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,5 +1,5 @@ import { DockerImageAsset, DockerImageAssetOptions } from '@aws-cdk/aws-ecr-assets'; -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ContainerDefinition } from '../container-definition'; import { ContainerImage, ContainerImageConfig } from '../container-image'; @@ -22,7 +22,7 @@ export class AssetImage extends ContainerImage { super(); } - public bind(scope: cdk.Construct, 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 8b71d902c9f17..fb349ad4367d7 100644 --- a/packages/@aws-cdk/aws-ecs/lib/images/ecr.ts +++ b/packages/@aws-cdk/aws-ecs/lib/images/ecr.ts @@ -1,5 +1,5 @@ import * as ecr from '@aws-cdk/aws-ecr'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ContainerDefinition } from '../container-definition'; import { ContainerImage, ContainerImageConfig } from '../container-image'; diff --git a/packages/@aws-cdk/aws-ecs/lib/images/repository.ts b/packages/@aws-cdk/aws-ecs/lib/images/repository.ts index 95d3675d63e11..7bef7ef41ce22 100644 --- a/packages/@aws-cdk/aws-ecs/lib/images/repository.ts +++ b/packages/@aws-cdk/aws-ecs/lib/images/repository.ts @@ -1,5 +1,6 @@ import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; -import { Construct, Token } from '@aws-cdk/core'; +import { Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ContainerDefinition } from '../container-definition'; import { ContainerImage, ContainerImageConfig } from '../container-image'; diff --git a/packages/@aws-cdk/aws-ecs/lib/linux-parameters.ts b/packages/@aws-cdk/aws-ecs/lib/linux-parameters.ts index f4d42ebe1d597..d9acadd832760 100644 --- a/packages/@aws-cdk/aws-ecs/lib/linux-parameters.ts +++ b/packages/@aws-cdk/aws-ecs/lib/linux-parameters.ts @@ -1,4 +1,5 @@ import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnTaskDefinition } from './ecs.generated'; /** @@ -23,7 +24,7 @@ export interface LinuxParametersProps { /** * Linux-specific options that are applied to the container. */ -export class LinuxParameters extends cdk.Construct { +export class LinuxParameters extends Construct { /** * Whether the init process is enabled */ @@ -57,7 +58,7 @@ export class LinuxParameters extends cdk.Construct { /** * Constructs a new instance of the LinuxParameters class. */ - constructor(scope: cdk.Construct, id: string, props: LinuxParametersProps = {}) { + constructor(scope: Construct, id: string, props: LinuxParametersProps = {}) { super(scope, id); this.sharedMemorySize = props.sharedMemorySize; 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 7dfcaf01314bd..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,5 +1,6 @@ import * as logs from '@aws-cdk/aws-logs'; -import { Construct, Stack } from '@aws-cdk/core'; +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'; 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 7ab19e3d4908c..8da21b84cbb75 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,4 +1,4 @@ -import { Construct } 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'; 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 f9d3c86ef252b..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,4 +1,5 @@ -import { Construct, Duration } from '@aws-cdk/core'; +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'; 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 b19f97d68ffcd..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,4 +1,5 @@ -import { Construct, Duration } from '@aws-cdk/core'; +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'; 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 a2c3584933f1b..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,4 +1,4 @@ -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ContainerDefinition } from '../container-definition'; import { LogDriver, LogDriverConfig } from '../index'; import { removeEmpty } from './utils'; 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 0777e2f15815f..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,4 +1,4 @@ -import { Construct } 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'; 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 0b28edd8d49e5..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,4 +1,4 @@ -import { Construct } 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'; 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 86794fe0fa86d..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,4 +1,4 @@ -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ContainerDefinition } from '../container-definition'; import { AwsLogDriver, AwsLogDriverProps } from './aws-log-driver'; 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 dbfd3733b5396..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,4 +1,5 @@ -import { Construct, SecretValue } from '@aws-cdk/core'; +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'; 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 ef6ca6c9f8773..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,4 +1,4 @@ -import { Construct } 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'; 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 80000b4b921dd..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,4 +1,4 @@ -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { TaskDefinition } from '../base/task-definition'; import { CfnTaskDefinition } from '../ecs.generated'; import { ProxyConfiguration } from './proxy-configuration'; 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 dfd8375d8d382..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,4 +1,4 @@ -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { TaskDefinition } from '../base/task-definition'; import { CfnTaskDefinition } from '../ecs.generated'; diff --git a/packages/@aws-cdk/aws-ecs/package.json b/packages/@aws-cdk/aws-ecs/package.json index 8668c5ff06380..af006d82275b3 100644 --- a/packages/@aws-cdk/aws-ecs/package.json +++ b/packages/@aws-cdk/aws-ecs/package.json @@ -96,7 +96,7 @@ "@aws-cdk/aws-ssm": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -122,7 +122,7 @@ "@aws-cdk/aws-ssm": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-efs/lib/access-point.ts b/packages/@aws-cdk/aws-efs/lib/access-point.ts index 6fd4b6e927bce..29d168ea62527 100644 --- a/packages/@aws-cdk/aws-efs/lib/access-point.ts +++ b/packages/@aws-cdk/aws-efs/lib/access-point.ts @@ -1,4 +1,5 @@ -import { Construct, IResource, Resource, Stack } from '@aws-cdk/core'; +import { IResource, Resource, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { IFileSystem } from './efs-file-system'; import { CfnAccessPoint } from './efs.generated'; diff --git a/packages/@aws-cdk/aws-efs/lib/efs-file-system.ts b/packages/@aws-cdk/aws-efs/lib/efs-file-system.ts index 35c6ef381a8d5..aea05201638be 100644 --- a/packages/@aws-cdk/aws-efs/lib/efs-file-system.ts +++ b/packages/@aws-cdk/aws-efs/lib/efs-file-system.ts @@ -1,6 +1,7 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as kms from '@aws-cdk/aws-kms'; -import { Construct, IResource, RemovalPolicy, Resource, Size, Tag } from '@aws-cdk/core'; +import { IResource, RemovalPolicy, Resource, Size, Tag } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { AccessPoint, AccessPointOptions } from './access-point'; import { CfnFileSystem, CfnMountTarget } from './efs.generated'; diff --git a/packages/@aws-cdk/aws-efs/package.json b/packages/@aws-cdk/aws-efs/package.json index 0710626c4c7e2..5ad4e98cca10f 100644 --- a/packages/@aws-cdk/aws-efs/package.json +++ b/packages/@aws-cdk/aws-efs/package.json @@ -75,7 +75,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.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -84,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.0.2" + "constructs": "4.1.1-pre.0" }, "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 0e5aae3ae9310..24c2f6f24dcda 100644 --- a/packages/@aws-cdk/aws-eks-legacy/lib/aws-auth.ts +++ b/packages/@aws-cdk/aws-eks-legacy/lib/aws-auth.ts @@ -1,5 +1,6 @@ import * as iam from '@aws-cdk/aws-iam'; -import { Construct, Lazy, Stack } from '@aws-cdk/core'; +import { Lazy, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Mapping } from './aws-auth-mapping'; import { Cluster } from './cluster'; import { KubernetesResource } from './k8s-resource'; 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 af6e20c3b7781..c604a2eddc048 100644 --- a/packages/@aws-cdk/aws-eks-legacy/lib/cluster-resource.ts +++ b/packages/@aws-cdk/aws-eks-legacy/lib/cluster-resource.ts @@ -1,7 +1,8 @@ import * as cfn from '@aws-cdk/aws-cloudformation'; import * as iam from '@aws-cdk/aws-iam'; import * as lambda from '@aws-cdk/aws-lambda'; -import { Construct, Duration, Token } from '@aws-cdk/core'; +import { Duration, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as path from 'path'; import { CfnClusterProps } from './eks.generated'; import { KubectlLayer } from './kubectl-layer'; diff --git a/packages/@aws-cdk/aws-eks-legacy/lib/cluster.ts b/packages/@aws-cdk/aws-eks-legacy/lib/cluster.ts index 0c5fcc2fb2e92..73fd08de5995a 100644 --- a/packages/@aws-cdk/aws-eks-legacy/lib/cluster.ts +++ b/packages/@aws-cdk/aws-eks-legacy/lib/cluster.ts @@ -3,7 +3,8 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import * as lambda from '@aws-cdk/aws-lambda'; import * as ssm from '@aws-cdk/aws-ssm'; -import { CfnOutput, Construct, Duration, IResource, Resource, Stack, Tag, Token } from '@aws-cdk/core'; +import { CfnOutput, Duration, IResource, Resource, Stack, Tag, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as path from 'path'; import { AwsAuth } from './aws-auth'; import { ClusterResource } from './cluster-resource'; @@ -640,7 +641,7 @@ export class Cluster extends Resource implements ICluster { continue; } - subnet.node.applyAspect(new Tag(tag, '1')); + Tag.add(subnet, tag, '1'); } }; 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 714fc97e4da0d..1717805fe8fce 100644 --- a/packages/@aws-cdk/aws-eks-legacy/lib/helm-chart.ts +++ b/packages/@aws-cdk/aws-eks-legacy/lib/helm-chart.ts @@ -1,6 +1,7 @@ import { CustomResource, CustomResourceProvider } from '@aws-cdk/aws-cloudformation'; import * as lambda from '@aws-cdk/aws-lambda'; -import { Construct, Duration, Stack } from '@aws-cdk/core'; +import { Duration, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as path from 'path'; import { Cluster } from './cluster'; import { KubectlLayer } from './kubectl-layer'; 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 d5fd29d272903..dc9c6b9dab21d 100644 --- a/packages/@aws-cdk/aws-eks-legacy/lib/k8s-resource.ts +++ b/packages/@aws-cdk/aws-eks-legacy/lib/k8s-resource.ts @@ -1,5 +1,6 @@ import * as cfn from '@aws-cdk/aws-cloudformation'; -import { Construct, Stack } from '@aws-cdk/core'; +import { Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Cluster } from './cluster'; 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 73168622e4ff4..795631f6a0e70 100644 --- a/packages/@aws-cdk/aws-eks-legacy/lib/kubectl-layer.ts +++ b/packages/@aws-cdk/aws-eks-legacy/lib/kubectl-layer.ts @@ -1,5 +1,6 @@ import * as lambda from '@aws-cdk/aws-lambda'; -import { CfnResource, Construct, Stack, Token } from '@aws-cdk/core'; +import { CfnResource, Stack, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as crypto from 'crypto'; const KUBECTL_APP_ARN = 'arn:aws:serverlessrepo:us-east-1:903779448426:applications/lambda-layer-kubectl'; diff --git a/packages/@aws-cdk/aws-eks-legacy/package.json b/packages/@aws-cdk/aws-eks-legacy/package.json index b00924740d28b..8a2be7d7ea219 100644 --- a/packages/@aws-cdk/aws-eks-legacy/package.json +++ b/packages/@aws-cdk/aws-eks-legacy/package.json @@ -78,7 +78,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-ssm": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -89,7 +89,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-ssm": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-eks-legacy/test/integ.eks-helm.lit.ts b/packages/@aws-cdk/aws-eks-legacy/test/integ.eks-helm.lit.ts index 35113435a740b..0aaa4fe8c50cf 100644 --- a/packages/@aws-cdk/aws-eks-legacy/test/integ.eks-helm.lit.ts +++ b/packages/@aws-cdk/aws-eks-legacy/test/integ.eks-helm.lit.ts @@ -2,7 +2,8 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; -import { App, Construct } from '@aws-cdk/core'; +import { App } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Cluster } from '../lib'; import { TestStack } from './util'; diff --git a/packages/@aws-cdk/aws-eks-legacy/test/integ.eks-kubectl.lit.ts b/packages/@aws-cdk/aws-eks-legacy/test/integ.eks-kubectl.lit.ts index 8aacab4e45a96..b39f59f27ffbb 100644 --- a/packages/@aws-cdk/aws-eks-legacy/test/integ.eks-kubectl.lit.ts +++ b/packages/@aws-cdk/aws-eks-legacy/test/integ.eks-kubectl.lit.ts @@ -2,7 +2,8 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; -import { App, Construct } from '@aws-cdk/core'; +import { App } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Cluster } from '../lib'; import { TestStack } from './util'; diff --git a/packages/@aws-cdk/aws-eks-legacy/test/integ.eks-spot.ts b/packages/@aws-cdk/aws-eks-legacy/test/integ.eks-spot.ts index ee0e8b01de4bf..07a599a4a8756 100644 --- a/packages/@aws-cdk/aws-eks-legacy/test/integ.eks-spot.ts +++ b/packages/@aws-cdk/aws-eks-legacy/test/integ.eks-spot.ts @@ -1,5 +1,6 @@ import * as ec2 from '@aws-cdk/aws-ec2'; -import { App, Construct } from '@aws-cdk/core'; +import { App } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as eks from '../lib'; import { TestStack } from './util'; diff --git a/packages/@aws-cdk/aws-eks-legacy/test/util.ts b/packages/@aws-cdk/aws-eks-legacy/test/util.ts index 7112aa374ec91..4e27e57c76e94 100644 --- a/packages/@aws-cdk/aws-eks-legacy/test/util.ts +++ b/packages/@aws-cdk/aws-eks-legacy/test/util.ts @@ -1,5 +1,6 @@ import * as ec2 from '@aws-cdk/aws-ec2'; -import { App, Construct, Stack } from '@aws-cdk/core'; +import { App, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Cluster } from '../lib'; export function testFixture() { diff --git a/packages/@aws-cdk/aws-eks/lib/aws-auth.ts b/packages/@aws-cdk/aws-eks/lib/aws-auth.ts index 390d730652c83..6087b94124cc2 100644 --- a/packages/@aws-cdk/aws-eks/lib/aws-auth.ts +++ b/packages/@aws-cdk/aws-eks/lib/aws-auth.ts @@ -1,5 +1,6 @@ import * as iam from '@aws-cdk/aws-iam'; -import { Construct, Lazy, Stack } from '@aws-cdk/core'; +import { Lazy, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { AwsAuthMapping } from './aws-auth-mapping'; import { Cluster } from './cluster'; import { KubernetesResource } from './k8s-resource'; 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 f9c1a592586ca..7958b407c3cfd 100644 --- a/packages/@aws-cdk/aws-eks/lib/cluster-resource-provider.ts +++ b/packages/@aws-cdk/aws-eks/lib/cluster-resource-provider.ts @@ -1,7 +1,8 @@ import * as iam from '@aws-cdk/aws-iam'; import * as lambda from '@aws-cdk/aws-lambda'; -import { Construct, Duration, NestedStack, Stack } from '@aws-cdk/core'; +import { Duration, NestedStack, Stack } from '@aws-cdk/core'; import * as cr from '@aws-cdk/custom-resources'; +import { Construct } from 'constructs'; import * as path from 'path'; const HANDLER_DIR = path.join(__dirname, 'cluster-resource-handler'); diff --git a/packages/@aws-cdk/aws-eks/lib/cluster-resource.ts b/packages/@aws-cdk/aws-eks/lib/cluster-resource.ts index 13b493808d0b0..5e03432372b80 100644 --- a/packages/@aws-cdk/aws-eks/lib/cluster-resource.ts +++ b/packages/@aws-cdk/aws-eks/lib/cluster-resource.ts @@ -1,5 +1,6 @@ import * as iam from '@aws-cdk/aws-iam'; -import { ArnComponents, Construct, CustomResource, Lazy, Stack, Token } from '@aws-cdk/core'; +import { ArnComponents, CustomResource, Lazy, Stack, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CLUSTER_RESOURCE_TYPE } from './cluster-resource-handler/consts'; import { ClusterResourceProvider } from './cluster-resource-provider'; import { CfnClusterProps } from './eks.generated'; diff --git a/packages/@aws-cdk/aws-eks/lib/cluster.ts b/packages/@aws-cdk/aws-eks/lib/cluster.ts index 6a245c3e3e2ef..30bb1b7737d62 100644 --- a/packages/@aws-cdk/aws-eks/lib/cluster.ts +++ b/packages/@aws-cdk/aws-eks/lib/cluster.ts @@ -2,7 +2,8 @@ import * as autoscaling from '@aws-cdk/aws-autoscaling'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import * as ssm from '@aws-cdk/aws-ssm'; -import { CfnOutput, CfnResource, Construct, IResource, Resource, Stack, Tag, Token } from '@aws-cdk/core'; +import { CfnOutput, CfnResource, IResource, Resource, Stack, Tag, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as fs from 'fs'; import * as path from 'path'; import * as YAML from 'yaml'; @@ -957,7 +958,7 @@ export class Cluster extends Resource implements ICluster { continue; } - subnet.node.applyAspect(new Tag(tag, '1')); + Tag.add(subnet, tag, '1'); } }; diff --git a/packages/@aws-cdk/aws-eks/lib/fargate-cluster.ts b/packages/@aws-cdk/aws-eks/lib/fargate-cluster.ts index a6fd1d3c2c8e5..dd1c39a2c7ff9 100644 --- a/packages/@aws-cdk/aws-eks/lib/fargate-cluster.ts +++ b/packages/@aws-cdk/aws-eks/lib/fargate-cluster.ts @@ -1,4 +1,4 @@ -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Cluster, ClusterOptions, CoreDnsComputeType } from './cluster'; import { FargateProfileOptions } from './fargate-profile'; diff --git a/packages/@aws-cdk/aws-eks/lib/fargate-profile.ts b/packages/@aws-cdk/aws-eks/lib/fargate-profile.ts index 76a32929de190..300f42bd7d6d9 100644 --- a/packages/@aws-cdk/aws-eks/lib/fargate-profile.ts +++ b/packages/@aws-cdk/aws-eks/lib/fargate-profile.ts @@ -1,6 +1,7 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; -import { Construct, CustomResource, ITaggable, Lazy, TagManager, TagType } from '@aws-cdk/core'; +import { CustomResource, ITaggable, Lazy, TagManager, TagType } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Cluster } from './cluster'; import { FARGATE_PROFILE_RESOURCE_TYPE } from './cluster-resource-handler/consts'; import { ClusterResourceProvider } from './cluster-resource-provider'; diff --git a/packages/@aws-cdk/aws-eks/lib/helm-chart.ts b/packages/@aws-cdk/aws-eks/lib/helm-chart.ts index b46f0f8bbe09d..24308d7de0776 100644 --- a/packages/@aws-cdk/aws-eks/lib/helm-chart.ts +++ b/packages/@aws-cdk/aws-eks/lib/helm-chart.ts @@ -1,4 +1,5 @@ -import { Construct, CustomResource, Duration, Stack } from '@aws-cdk/core'; +import { CustomResource, Duration, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Cluster } from './cluster'; /** diff --git a/packages/@aws-cdk/aws-eks/lib/k8s-patch.ts b/packages/@aws-cdk/aws-eks/lib/k8s-patch.ts index 63901ee7917a0..08baa7bc9c209 100644 --- a/packages/@aws-cdk/aws-eks/lib/k8s-patch.ts +++ b/packages/@aws-cdk/aws-eks/lib/k8s-patch.ts @@ -1,4 +1,5 @@ -import { Construct, CustomResource, Stack } from '@aws-cdk/core'; +import { CustomResource, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Cluster } from './cluster'; /** diff --git a/packages/@aws-cdk/aws-eks/lib/k8s-resource.ts b/packages/@aws-cdk/aws-eks/lib/k8s-resource.ts index ae0fa409c8727..03affe6e4be74 100644 --- a/packages/@aws-cdk/aws-eks/lib/k8s-resource.ts +++ b/packages/@aws-cdk/aws-eks/lib/k8s-resource.ts @@ -1,4 +1,5 @@ -import { Construct, CustomResource, Stack } from '@aws-cdk/core'; +import { CustomResource, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Cluster } from './cluster'; /** diff --git a/packages/@aws-cdk/aws-eks/lib/kubectl-layer.ts b/packages/@aws-cdk/aws-eks/lib/kubectl-layer.ts index 84efa5325854a..2fb7640cd6981 100644 --- a/packages/@aws-cdk/aws-eks/lib/kubectl-layer.ts +++ b/packages/@aws-cdk/aws-eks/lib/kubectl-layer.ts @@ -1,5 +1,6 @@ import * as lambda from '@aws-cdk/aws-lambda'; -import { CfnResource, Construct, Stack, Token } from '@aws-cdk/core'; +import { CfnResource, Stack, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as crypto from 'crypto'; const KUBECTL_APP_ARN = 'arn:aws:serverlessrepo:us-east-1:903779448426:applications/lambda-layer-kubectl'; diff --git a/packages/@aws-cdk/aws-eks/lib/kubectl-provider.ts b/packages/@aws-cdk/aws-eks/lib/kubectl-provider.ts index 9fe12c4b6169b..e7b44ffbaec04 100644 --- a/packages/@aws-cdk/aws-eks/lib/kubectl-provider.ts +++ b/packages/@aws-cdk/aws-eks/lib/kubectl-provider.ts @@ -1,7 +1,8 @@ import * as iam from '@aws-cdk/aws-iam'; import * as lambda from '@aws-cdk/aws-lambda'; -import { Construct, Duration, NestedStack } from '@aws-cdk/core'; +import { Duration, NestedStack } from '@aws-cdk/core'; import * as cr from '@aws-cdk/custom-resources'; +import { Construct } from 'constructs'; import * as path from 'path'; import { KubectlLayer } from './kubectl-layer'; diff --git a/packages/@aws-cdk/aws-eks/lib/managed-nodegroup.ts b/packages/@aws-cdk/aws-eks/lib/managed-nodegroup.ts index c7640916d70c1..4a501fc6d4b0f 100644 --- a/packages/@aws-cdk/aws-eks/lib/managed-nodegroup.ts +++ b/packages/@aws-cdk/aws-eks/lib/managed-nodegroup.ts @@ -1,6 +1,7 @@ import { InstanceType, ISecurityGroup, SubnetSelection } from '@aws-cdk/aws-ec2'; import { IRole, ManagedPolicy, Role, ServicePrincipal } from '@aws-cdk/aws-iam'; -import { Construct, IResource, Resource } from '@aws-cdk/core'; +import { IResource, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Cluster } from './cluster'; import { CfnNodegroup } from './eks.generated'; diff --git a/packages/@aws-cdk/aws-eks/lib/service-account.ts b/packages/@aws-cdk/aws-eks/lib/service-account.ts index 83da66fbfef73..d67603b820ef6 100644 --- a/packages/@aws-cdk/aws-eks/lib/service-account.ts +++ b/packages/@aws-cdk/aws-eks/lib/service-account.ts @@ -1,5 +1,6 @@ import { AddToPrincipalPolicyResult, IPrincipal, IRole, OpenIdConnectPrincipal, PolicyStatement, PrincipalPolicyFragment, Role } from '@aws-cdk/aws-iam'; -import { CfnJson, Construct } from '@aws-cdk/core'; +import { CfnJson } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Cluster } from './cluster'; /** diff --git a/packages/@aws-cdk/aws-eks/package.json b/packages/@aws-cdk/aws-eks/package.json index 17233a7c7689b..cf01a4ecc22af 100644 --- a/packages/@aws-cdk/aws-eks/package.json +++ b/packages/@aws-cdk/aws-eks/package.json @@ -81,7 +81,7 @@ "@aws-cdk/aws-ssm": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", - "constructs": "^3.0.2", + "constructs": "4.1.1-pre.0", "yaml": "1.10.0" }, "bundledDependencies": [ @@ -96,7 +96,7 @@ "@aws-cdk/aws-ssm": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-eks/test/util.ts b/packages/@aws-cdk/aws-eks/test/util.ts index 28751aa5a96b0..ac1960c9f81cb 100644 --- a/packages/@aws-cdk/aws-eks/test/util.ts +++ b/packages/@aws-cdk/aws-eks/test/util.ts @@ -1,5 +1,6 @@ import * as ec2 from '@aws-cdk/aws-ec2'; -import { App, Construct, Stack } from '@aws-cdk/core'; +import { App, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Cluster, KubernetesVersion } from '../lib'; const CLUSTER_VERSION = KubernetesVersion.V1_16; diff --git a/packages/@aws-cdk/aws-elasticache/package.json b/packages/@aws-cdk/aws-elasticache/package.json index 5c6963be97cb9..c58b9696502c1 100644 --- a/packages/@aws-cdk/aws-elasticache/package.json +++ b/packages/@aws-cdk/aws-elasticache/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 e7845ae99891f..99d0b37df6a88 100644 --- a/packages/@aws-cdk/aws-elasticbeanstalk/package.json +++ b/packages/@aws-cdk/aws-elasticbeanstalk/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-elasticloadbalancing/lib/load-balancer.ts b/packages/@aws-cdk/aws-elasticloadbalancing/lib/load-balancer.ts index d4c36abe15221..07d37dcb381a3 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancing/lib/load-balancer.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancing/lib/load-balancer.ts @@ -1,6 +1,7 @@ import { Connections, IConnectable, ISecurityGroup, IVpc, Peer, Port, SecurityGroup, SelectedSubnets, SubnetSelection, SubnetType } from '@aws-cdk/aws-ec2'; -import { Construct, Duration, Lazy, Resource } from '@aws-cdk/core'; +import { Duration, Lazy, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnLoadBalancer } from './elasticloadbalancing.generated'; /** diff --git a/packages/@aws-cdk/aws-elasticloadbalancing/package.json b/packages/@aws-cdk/aws-elasticloadbalancing/package.json index 3d2cf1442fd42..be91874ed8aa4 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancing/package.json +++ b/packages/@aws-cdk/aws-elasticloadbalancing/package.json @@ -73,13 +73,13 @@ "dependencies": { "@aws-cdk/aws-ec2": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-ec2": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 ba866cf3a4dee..5cbb397836965 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2-actions/package.json +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2-actions/package.json @@ -71,7 +71,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-cognito": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -80,7 +80,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-cognito": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2-actions/test/integ.cognito.lit.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2-actions/test/integ.cognito.lit.ts index f9ab2c015b382..b04e411d639dd 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2-actions/test/integ.cognito.lit.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2-actions/test/integ.cognito.lit.ts @@ -1,7 +1,8 @@ import * as cognito from '@aws-cdk/aws-cognito'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as elbv2 from '@aws-cdk/aws-elasticloadbalancingv2'; -import { App, CfnOutput, Construct, Stack } from '@aws-cdk/core'; +import { App, CfnOutput, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as actions from '../lib'; class CognitoStack extends Stack { diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2-targets/package.json b/packages/@aws-cdk/aws-elasticloadbalancingv2-targets/package.json index fdef0856ac238..c69449cdbca59 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2-targets/package.json +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2-targets/package.json @@ -71,7 +71,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -80,7 +80,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2-targets/test/integ.lambda-target.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2-targets/test/integ.lambda-target.ts index 912b75066f830..405fa22d03f82 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2-targets/test/integ.lambda-target.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2-targets/test/integ.lambda-target.ts @@ -1,7 +1,8 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as elbv2 from '@aws-cdk/aws-elasticloadbalancingv2'; import * as lambda from '@aws-cdk/aws-lambda'; -import { App, Construct, Stack } from '@aws-cdk/core'; +import { App, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as targets from '../lib'; class TestStack extends Stack { 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 9b3e713a6115c..3baf3899b0842 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 { Construct, Duration, IConstruct, SecretValue, Tokenization } from '@aws-cdk/core'; +import { Duration, SecretValue, Tokenization } from '@aws-cdk/core'; +import { Construct, IConstruct } from 'constructs'; import { CfnListener } from '../elasticloadbalancingv2.generated'; import { IListenerAction } from '../shared/listener-action'; import { IApplicationListener } from './application-listener'; 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 d8497da664e5b..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 @@ -1,4 +1,4 @@ -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnListenerCertificate } from '../elasticloadbalancingv2.generated'; import { IListenerCertificate } from '../shared/listener-certificate'; import { IApplicationListener } from './application-listener'; @@ -35,8 +35,8 @@ export interface ApplicationListenerCertificateProps { /** * Add certificates to a listener */ -export class ApplicationListenerCertificate extends cdk.Construct { - constructor(scope: cdk.Construct, id: string, props: ApplicationListenerCertificateProps) { +export class ApplicationListenerCertificate extends Construct { + constructor(scope: Construct, id: string, props: ApplicationListenerCertificateProps) { super(scope, id); if (!props.certificateArns && !props.certificates) { 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 a8de884e9f2c0..4fc8c39270ff3 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 @@ -1,4 +1,5 @@ import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnListenerRule } from '../elasticloadbalancingv2.generated'; import { IListenerAction } from '../shared/listener-action'; import { IApplicationListener } from './application-listener'; @@ -193,7 +194,7 @@ export interface RedirectResponse { /** * Define a new listener rule */ -export class ApplicationListenerRule extends cdk.Construct { +export class ApplicationListenerRule extends Construct { /** * The ARN of this rule */ @@ -205,7 +206,7 @@ export class ApplicationListenerRule extends cdk.Construct { private readonly listener: IApplicationListener; private action?: IListenerAction; - constructor(scope: cdk.Construct, id: string, props: ApplicationListenerRuleProps) { + constructor(scope: Construct, id: string, props: ApplicationListenerRuleProps) { super(scope, id); this.conditions = props.conditions || []; 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 6809b777a9343..dc217eb15d932 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener.ts @@ -1,5 +1,6 @@ import * as ec2 from '@aws-cdk/aws-ec2'; -import { Construct, Duration, IResource, Lazy, Resource, Token } from '@aws-cdk/core'; +import { Duration, IResource, Lazy, Resource, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { BaseListener } from '../shared/base-listener'; import { HealthCheck } from '../shared/base-target-group'; import { ApplicationProtocol, IpAddressType, SslPolicy } from '../shared/enums'; diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-load-balancer.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-load-balancer.ts index bbf91ed8834e4..71b4807671b58 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-load-balancer.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-load-balancer.ts @@ -1,6 +1,7 @@ import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; import * as ec2 from '@aws-cdk/aws-ec2'; -import { Construct, Duration, Lazy, Resource } from '@aws-cdk/core'; +import { Duration, Lazy, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { BaseLoadBalancer, BaseLoadBalancerProps, ILoadBalancerV2 } from '../shared/base-load-balancer'; import { IpAddressType } from '../shared/enums'; import { ApplicationListener, BaseApplicationListenerProps } from './application-listener'; 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 9d6561356f5e9..b568a47f7f180 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 @@ -1,6 +1,7 @@ import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; import * as ec2 from '@aws-cdk/aws-ec2'; -import { Construct, Duration, IConstruct } from '@aws-cdk/core'; +import { Duration } from '@aws-cdk/core'; +import { Construct, IConstruct } from 'constructs'; import { BaseTargetGroupProps, ITargetGroup, loadBalancerNameFromListenerArn, LoadBalancerTargetProps, TargetGroupAttributes, TargetGroupBase, TargetGroupImportProps, 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 81b45a5e3b146..2afb597b069d6 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 @@ -1,4 +1,5 @@ -import { Construct, Duration } from '@aws-cdk/core'; +import { Duration } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnListener } from '../elasticloadbalancingv2.generated'; import { IListenerAction } from '../shared/listener-action'; import { INetworkListener } from './network-listener'; diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-listener.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-listener.ts index 691d2b100a64e..f47812003c688 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-listener.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-listener.ts @@ -1,4 +1,5 @@ -import { Construct, Duration, IResource, Resource } from '@aws-cdk/core'; +import { Duration, IResource, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { BaseListener } from '../shared/base-listener'; import { HealthCheck } from '../shared/base-target-group'; import { Protocol, SslPolicy } from '../shared/enums'; diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-load-balancer.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-load-balancer.ts index cf7ccbf04b1ed..271fd75f1cef1 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-load-balancer.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-load-balancer.ts @@ -2,7 +2,8 @@ import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; import * as ec2 from '@aws-cdk/aws-ec2'; import { PolicyStatement, ServicePrincipal } from '@aws-cdk/aws-iam'; import { IBucket } from '@aws-cdk/aws-s3'; -import { Construct, Resource } from '@aws-cdk/core'; +import { Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { BaseLoadBalancer, BaseLoadBalancerProps, ILoadBalancerV2 } from '../shared/base-load-balancer'; import { BaseNetworkListenerProps, NetworkListener } from './network-listener'; 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 12e5ea3dd715f..207fe911cc0b8 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 @@ -1,6 +1,9 @@ import * as cdk from '@aws-cdk/core'; -import { BaseTargetGroupProps, HealthCheck, ITargetGroup, loadBalancerNameFromListenerArn, LoadBalancerTargetProps, - TargetGroupAttributes, TargetGroupBase, TargetGroupImportProps } from '../shared/base-target-group'; +import { Construct } from 'constructs'; +import { + BaseTargetGroupProps, HealthCheck, ITargetGroup, loadBalancerNameFromListenerArn, LoadBalancerTargetProps, + TargetGroupAttributes, TargetGroupBase, TargetGroupImportProps, +} from '../shared/base-target-group'; import { Protocol } from '../shared/enums'; import { ImportedTargetGroupBase } from '../shared/imported'; import { validateNetworkProtocol } from '../shared/util'; @@ -48,7 +51,7 @@ export class NetworkTargetGroup extends TargetGroupBase implements INetworkTarge /** * Import an existing target group */ - public static fromTargetGroupAttributes(scope: cdk.Construct, id: string, attrs: TargetGroupAttributes): INetworkTargetGroup { + public static fromTargetGroupAttributes(scope: Construct, id: string, attrs: TargetGroupAttributes): INetworkTargetGroup { return new ImportedNetworkTargetGroup(scope, id, attrs); } @@ -57,13 +60,13 @@ export class NetworkTargetGroup extends TargetGroupBase implements INetworkTarge * * @deprecated Use `fromTargetGroupAttributes` instead */ - public static import(scope: cdk.Construct, id: string, props: TargetGroupImportProps): INetworkTargetGroup { + public static import(scope: Construct, id: string, props: TargetGroupImportProps): INetworkTargetGroup { return NetworkTargetGroup.fromTargetGroupAttributes(scope, id, props); } private readonly listeners: INetworkListener[]; - constructor(scope: cdk.Construct, id: string, props: NetworkTargetGroupProps) { + constructor(scope: Construct, id: string, props: NetworkTargetGroupProps) { const proto = props.protocol || Protocol.TCP; validateNetworkProtocol(proto); 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 d9405bff1f729..ac33f4610d79c 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/base-listener.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/base-listener.ts @@ -1,4 +1,5 @@ -import { Construct, Lazy, Resource } from '@aws-cdk/core'; +import { Lazy, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnListener } from '../elasticloadbalancingv2.generated'; import { IListenerAction } from './listener-action'; diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/base-load-balancer.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/base-load-balancer.ts index a51e40c0df0db..3f0781a7c865f 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/base-load-balancer.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/base-load-balancer.ts @@ -1,7 +1,8 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import * as s3 from '@aws-cdk/aws-s3'; -import { Construct, IResource, Lazy, Resource, Stack, Token } from '@aws-cdk/core'; +import { IResource, Lazy, Resource, Stack, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnLoadBalancer } from '../elasticloadbalancingv2.generated'; import { Attributes, ifUndefined, renderAttributes } from './util'; 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 f35642e6d4c9e..b471f9f958600 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,5 +1,6 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as cdk from '@aws-cdk/core'; +import { Construct, DependencyGroup, IConstruct, IDependable } from 'constructs'; import { CfnTargetGroup } from '../elasticloadbalancingv2.generated'; import { Protocol, TargetType } from './enums'; import { Attributes, renderAttributes } from './util'; @@ -144,7 +145,7 @@ export interface HealthCheck { /** * Define the target of a load balancer */ -export abstract class TargetGroupBase extends cdk.Construct implements ITargetGroup { +export abstract class TargetGroupBase extends Construct implements ITargetGroup { /** * The ARN of the target group */ @@ -193,7 +194,7 @@ export abstract class TargetGroupBase extends cdk.Construct implements ITargetGr /** * Configurable dependable with all resources that lead to load balancer attachment */ - protected readonly loadBalancerAttachedDependencies = new cdk.ConcreteDependable(); + protected readonly loadBalancerAttachedDependencies = new DependencyGroup(); /** * The types of the directly registered members of this target group @@ -222,7 +223,7 @@ export abstract class TargetGroupBase extends cdk.Construct implements ITargetGr */ private readonly resource: CfnTargetGroup; - constructor(scope: cdk.Construct, id: string, baseProps: BaseTargetGroupProps, additionalProps: any) { + constructor(scope: Construct, id: string, baseProps: BaseTargetGroupProps, additionalProps: any) { super(scope, id); if (baseProps.deregistrationDelay !== undefined) { @@ -271,7 +272,7 @@ export abstract class TargetGroupBase extends cdk.Construct implements ITargetGr /** * List of constructs that need to be depended on to ensure the TargetGroup is associated to a load balancer */ - public get loadBalancerAttached(): cdk.IDependable { + public get loadBalancerAttached(): IDependable { return this.loadBalancerAttachedDependencies; } @@ -310,7 +311,7 @@ export abstract class TargetGroupBase extends cdk.Construct implements ITargetGr } protected validate(): string[] { - const ret = super.validate(); + const ret = []; if (this.targetType === undefined && this.targetsJson.length === 0) { this.node.addWarning("When creating an empty TargetGroup, you should specify a 'targetType' (this warning may become an error in the future)."); @@ -357,7 +358,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 */ @@ -371,7 +372,7 @@ export interface ITargetGroup extends cdk.IConstruct { /** * Return an object to depend on the listeners added to this target group */ - readonly loadBalancerAttached: cdk.IDependable; + readonly loadBalancerAttached: IDependable; } /** diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/imported.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/imported.ts index 104f11b67d264..999758e10dfdd 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/imported.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/imported.ts @@ -1,10 +1,11 @@ import * as cdk from '@aws-cdk/core'; +import { Construct, DependencyGroup, IDependable } from 'constructs'; import { ITargetGroup, TargetGroupImportProps } from './base-target-group'; /** * Base internal class for existing target groups */ -export abstract class ImportedTargetGroupBase extends cdk.Construct implements ITargetGroup { +export abstract class ImportedTargetGroupBase extends Construct implements ITargetGroup { /** * ARN of the target group */ @@ -18,9 +19,9 @@ export abstract class ImportedTargetGroupBase extends cdk.Construct implements I /** * Return an object to depend on the listeners added to this target group */ - public readonly loadBalancerAttached: cdk.IDependable = new cdk.ConcreteDependable(); + public readonly loadBalancerAttached: IDependable = new DependencyGroup(); - constructor(scope: cdk.Construct, id: string, props: TargetGroupImportProps) { + constructor(scope: Construct, id: string, props: TargetGroupImportProps) { super(scope, id); this.targetGroupArn = props.targetGroupArn; diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/package.json b/packages/@aws-cdk/aws-elasticloadbalancingv2/package.json index 0ad90f1fd4c85..2e800caf25834 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/package.json +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/package.json @@ -78,7 +78,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -89,7 +89,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/test.listener.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/test.listener.ts index 188fd80ea4eea..fd73e219648fc 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/test.listener.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/test.listener.ts @@ -2,6 +2,7 @@ import { expect, haveResource, MatchStyle } from '@aws-cdk/assert'; import { Metric } from '@aws-cdk/aws-cloudwatch'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Test } from 'nodeunit'; import * as elbv2 from '../../lib'; import { FakeSelfRegisteringTarget } from '../helpers'; @@ -124,7 +125,7 @@ export = { }); // THEN - const errors = cdk.ConstructNode.validate(stack.node); + const errors = lb.node.validate(); test.deepEqual(errors.map(e => e.message), ['HTTPS Listener needs at least one certificate (call addCertificates)']); test.done(); @@ -1357,7 +1358,7 @@ export = { }; class ResourceWithLBDependency extends cdk.CfnResource { - constructor(scope: cdk.Construct, id: string, targetGroup: elbv2.ITargetGroup) { + constructor(scope: Construct, id: string, targetGroup: elbv2.ITargetGroup) { super(scope, id, { type: 'Test::Resource' }); this.node.addDependency(targetGroup.loadBalancerAttached); } diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/helpers.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/helpers.ts index 8b54f66d6e81b..1df29adf5d6ba 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/helpers.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/helpers.ts @@ -1,13 +1,13 @@ import * as ec2 from '@aws-cdk/aws-ec2'; -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as elbv2 from '../lib'; -export class FakeSelfRegisteringTarget extends cdk.Construct implements elbv2.IApplicationLoadBalancerTarget, elbv2.INetworkLoadBalancerTarget, +export class FakeSelfRegisteringTarget extends Construct implements elbv2.IApplicationLoadBalancerTarget, elbv2.INetworkLoadBalancerTarget, ec2.IConnectable { public readonly securityGroup: ec2.SecurityGroup; public readonly connections: ec2.Connections; - constructor(scope: cdk.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 5ce09e6f82ef3..93f14f859e2e9 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/test.listener.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/nlb/test.listener.ts index a94421e357154..d9f518bf25829 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/nlb/test.listener.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/nlb/test.listener.ts @@ -2,6 +2,7 @@ import { expect, haveResource, MatchStyle } from '@aws-cdk/assert'; import * as acm from '@aws-cdk/aws-certificatemanager'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Test } from 'nodeunit'; import * as elbv2 from '../../lib'; import { FakeSelfRegisteringTarget } from '../helpers'; @@ -337,7 +338,7 @@ export = { }; class ResourceWithLBDependency extends cdk.CfnResource { - constructor(scope: cdk.Construct, id: string, targetGroup: elbv2.ITargetGroup) { + constructor(scope: Construct, id: string, targetGroup: elbv2.ITargetGroup) { super(scope, id, { type: 'Test::Resource' }); this.node.addDependency(targetGroup.loadBalancerAttached); } diff --git a/packages/@aws-cdk/aws-elasticsearch/package.json b/packages/@aws-cdk/aws-elasticsearch/package.json index 3b4da6e728f14..105ada465da78 100644 --- a/packages/@aws-cdk/aws-elasticsearch/package.json +++ b/packages/@aws-cdk/aws-elasticsearch/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 b40e51a1a0fdf..5a0773900b2d4 100644 --- a/packages/@aws-cdk/aws-emr/package.json +++ b/packages/@aws-cdk/aws-emr/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-events-targets/lib/util.ts b/packages/@aws-cdk/aws-events-targets/lib/util.ts index ddcd83adb5f1b..273852a9ff4d2 100644 --- a/packages/@aws-cdk/aws-events-targets/lib/util.ts +++ b/packages/@aws-cdk/aws-events-targets/lib/util.ts @@ -1,7 +1,7 @@ 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 { Construct, IConstruct } from '@aws-cdk/core'; +import { Construct, IConstruct } from 'constructs'; /** * Obtain the Role for the EventBridge event diff --git a/packages/@aws-cdk/aws-events-targets/package.json b/packages/@aws-cdk/aws-events-targets/package.json index 2463cf78299c4..786defdfc8051 100644 --- a/packages/@aws-cdk/aws-events-targets/package.json +++ b/packages/@aws-cdk/aws-events-targets/package.json @@ -90,7 +90,7 @@ "@aws-cdk/aws-batch": "0.0.0", "@aws-cdk/aws-kinesis": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -107,7 +107,7 @@ "@aws-cdk/aws-stepfunctions": "0.0.0", "@aws-cdk/aws-batch": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2", + "constructs": "4.1.1-pre.0", "@aws-cdk/aws-kinesis": "0.0.0" }, "engines": { diff --git a/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.ts b/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.ts index 7fd4f3e4c3457..32b7aa17a178f 100644 --- a/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.ts +++ b/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.ts @@ -2,6 +2,7 @@ import * as codecommit from '@aws-cdk/aws-codecommit'; import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as events from '@aws-cdk/aws-events'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as targets from '../../lib'; interface MockActionProps extends codepipeline.ActionProperties { @@ -17,7 +18,7 @@ class MockAction implements codepipeline.IAction { this.configuration = props.configuration; } - public bind(_scope: cdk.Construct, _stage: codepipeline.IStage, _options: codepipeline.ActionBindOptions): + public bind(_scope: Construct, _stage: codepipeline.IStage, _options: codepipeline.ActionBindOptions): codepipeline.ActionConfig { return { configuration: this.configuration, diff --git a/packages/@aws-cdk/aws-events-targets/test/codepipeline/pipeline.test.ts b/packages/@aws-cdk/aws-events-targets/test/codepipeline/pipeline.test.ts index 3e2b5e524ba3b..715afa5e4fa29 100644 --- a/packages/@aws-cdk/aws-events-targets/test/codepipeline/pipeline.test.ts +++ b/packages/@aws-cdk/aws-events-targets/test/codepipeline/pipeline.test.ts @@ -2,7 +2,8 @@ import { expect, haveResource, haveResourceLike } from '@aws-cdk/assert'; import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as events from '@aws-cdk/aws-events'; import * as iam from '@aws-cdk/aws-iam'; -import { CfnElement, Construct, Stack } from '@aws-cdk/core'; +import { CfnElement, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as targets from '../../lib'; describe('CodePipeline event target', () => { diff --git a/packages/@aws-cdk/aws-events-targets/test/lambda/lambda.test.ts b/packages/@aws-cdk/aws-events-targets/test/lambda/lambda.test.ts index 4d0feb07671bd..11953608241dd 100644 --- a/packages/@aws-cdk/aws-events-targets/test/lambda/lambda.test.ts +++ b/packages/@aws-cdk/aws-events-targets/test/lambda/lambda.test.ts @@ -2,6 +2,7 @@ import { countResources, expect, haveResource } from '@aws-cdk/assert'; import * as events from '@aws-cdk/aws-events'; import * as lambda from '@aws-cdk/aws-lambda'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as targets from '../../lib'; test('use lambda as an event rule target', () => { @@ -102,7 +103,7 @@ test('adding same singleton lambda function as target mutiple times creates perm expect(stack).to(countResources('AWS::Lambda::Permission', 1)); }); -function newTestLambda(scope: cdk.Construct) { +function newTestLambda(scope: Construct) { return new lambda.Function(scope, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'bar', diff --git a/packages/@aws-cdk/aws-events/lib/event-bus.ts b/packages/@aws-cdk/aws-events/lib/event-bus.ts index 366c259685527..db0bf52f65317 100644 --- a/packages/@aws-cdk/aws-events/lib/event-bus.ts +++ b/packages/@aws-cdk/aws-events/lib/event-bus.ts @@ -1,5 +1,6 @@ import * as iam from '@aws-cdk/aws-iam'; -import { Construct, IResource, Lazy, Resource, Stack } from '@aws-cdk/core'; +import { IResource, Lazy, Resource, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnEventBus } from './events.generated'; /** diff --git a/packages/@aws-cdk/aws-events/lib/rule.ts b/packages/@aws-cdk/aws-events/lib/rule.ts index 1b19b5f1174a9..a938f1f6fb66d 100644 --- a/packages/@aws-cdk/aws-events/lib/rule.ts +++ b/packages/@aws-cdk/aws-events/lib/rule.ts @@ -1,4 +1,5 @@ -import { App, Construct, Lazy, Resource, Stack, Token } from '@aws-cdk/core'; +import { App, Lazy, Resource, Stack, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { IEventBus } from './event-bus'; import { EventPattern } from './event-pattern'; import { CfnEventBusPolicy, CfnRule } from './events.generated'; diff --git a/packages/@aws-cdk/aws-events/lib/target.ts b/packages/@aws-cdk/aws-events/lib/target.ts index 319cf3d4f14da..d45df08456332 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 112095403d69d..eb5226ce3778d 100644 --- a/packages/@aws-cdk/aws-events/package.json +++ b/packages/@aws-cdk/aws-events/package.json @@ -74,13 +74,13 @@ "dependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 304bf91ed4dcb..3d347cdff77fa 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'; @@ -450,7 +451,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)); @@ -534,7 +535,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)); @@ -551,7 +552,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)); @@ -569,7 +570,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)); @@ -587,7 +588,7 @@ export = { const targetAccount = '234567890123'; const targetStack = new cdk.Stack(app, '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)); @@ -605,7 +606,7 @@ export = { const targetAccount = '234567890123'; const targetStack = new cdk.Stack(undefined, '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)); @@ -623,7 +624,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)); @@ -655,8 +656,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)); @@ -743,7 +744,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)); @@ -772,7 +773,7 @@ export = { }; class SomeTarget implements IRuleTarget { - 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 0df440c7cdffb..5c1b758f739d2 100644 --- a/packages/@aws-cdk/aws-eventschemas/package.json +++ b/packages/@aws-cdk/aws-eventschemas/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 cf8fbf92b10e4..fc9bc7109efc8 100644 --- a/packages/@aws-cdk/aws-fms/package.json +++ b/packages/@aws-cdk/aws-fms/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-fsx/lib/lustre-file-system.ts b/packages/@aws-cdk/aws-fsx/lib/lustre-file-system.ts index dedcf20576108..0d773d9a12fb6 100644 --- a/packages/@aws-cdk/aws-fsx/lib/lustre-file-system.ts +++ b/packages/@aws-cdk/aws-fsx/lib/lustre-file-system.ts @@ -1,5 +1,6 @@ import {Connections, ISecurityGroup, ISubnet, Port, SecurityGroup} from '@aws-cdk/aws-ec2'; -import {Aws, Construct, Token} from '@aws-cdk/core'; +import {Aws, Token} from '@aws-cdk/core'; +import { Construct } from 'constructs'; import {FileSystemAttributes, FileSystemBase, FileSystemProps, IFileSystem} from './file-system'; import {CfnFileSystem} from './fsx.generated'; import {LustreMaintenanceTime} from './maintenance-time'; diff --git a/packages/@aws-cdk/aws-fsx/package.json b/packages/@aws-cdk/aws-fsx/package.json index 9c7be9e74b414..da7c61e9718c9 100644 --- a/packages/@aws-cdk/aws-fsx/package.json +++ b/packages/@aws-cdk/aws-fsx/package.json @@ -76,14 +76,14 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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.0.2" + "constructs": "4.1.1-pre.0" }, "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 8151b203c8a9c..6773dcfbefad6 100644 --- a/packages/@aws-cdk/aws-gamelift/package.json +++ b/packages/@aws-cdk/aws-gamelift/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-globalaccelerator/lib/accelerator.ts b/packages/@aws-cdk/aws-globalaccelerator/lib/accelerator.ts index bdd5b02c0c063..721f641d3c19b 100644 --- a/packages/@aws-cdk/aws-globalaccelerator/lib/accelerator.ts +++ b/packages/@aws-cdk/aws-globalaccelerator/lib/accelerator.ts @@ -1,4 +1,5 @@ import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as ga from './globalaccelerator.generated'; /** @@ -62,7 +63,7 @@ export class Accelerator extends cdk.Resource implements IAccelerator { /** * import from attributes */ - public static fromAcceleratorAttributes(scope: cdk.Construct, id: string, attrs: AcceleratorAttributes ): IAccelerator { + public static fromAcceleratorAttributes(scope: Construct, id: string, attrs: AcceleratorAttributes ): IAccelerator { class Import extends cdk.Resource implements IAccelerator { public readonly acceleratorArn = attrs.acceleratorArn; public readonly dnsName = attrs.dnsName; @@ -80,7 +81,7 @@ export class Accelerator extends cdk.Resource implements IAccelerator { */ public readonly dnsName: string; - constructor(scope: cdk.Construct, id: string, props: AcceleratorProps = {}) { + constructor(scope: Construct, id: string, props: AcceleratorProps = {}) { super(scope, id); const resource = new ga.CfnAccelerator(this, 'Resource', { diff --git a/packages/@aws-cdk/aws-globalaccelerator/lib/endpoint-group.ts b/packages/@aws-cdk/aws-globalaccelerator/lib/endpoint-group.ts index cc81779c7131c..293ed71947c85 100644 --- a/packages/@aws-cdk/aws-globalaccelerator/lib/endpoint-group.ts +++ b/packages/@aws-cdk/aws-globalaccelerator/lib/endpoint-group.ts @@ -1,4 +1,5 @@ import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as ga from './globalaccelerator.generated'; import { IListener } from './listener'; @@ -112,12 +113,12 @@ export interface EndpointGroupProps { /** * The class for endpoint configuration */ -export class EndpointConfiguration extends cdk.Construct { +export class EndpointConfiguration extends Construct { /** * The property containing all the configuration to be rendered */ public readonly props: EndpointConfigurationProps; - constructor(scope: cdk.Construct, id: string, props: EndpointConfigurationProps) { + constructor(scope: Construct, id: string, props: EndpointConfigurationProps) { super(scope, id); this.props = props; props.endpointGroup._linkEndpoint(this); @@ -142,7 +143,7 @@ export class EndpointGroup extends cdk.Resource implements IEndpointGroup { /** * import from ARN */ - public static fromEndpointGroupArn(scope: cdk.Construct, id: string, endpointGroupArn: string): IEndpointGroup { + public static fromEndpointGroupArn(scope: Construct, id: string, endpointGroupArn: string): IEndpointGroup { class Import extends cdk.Resource implements IEndpointGroup { public readonly endpointGroupArn = endpointGroupArn; } @@ -162,7 +163,7 @@ export class EndpointGroup extends cdk.Resource implements IEndpointGroup { */ protected readonly endpoints = new Array(); - constructor(scope: cdk.Construct, id: string, props: EndpointGroupProps) { + constructor(scope: Construct, id: string, props: EndpointGroupProps) { super(scope, id); const resource = new ga.CfnEndpointGroup(this, 'Resource', { diff --git a/packages/@aws-cdk/aws-globalaccelerator/lib/listener.ts b/packages/@aws-cdk/aws-globalaccelerator/lib/listener.ts index e482d954a9cd4..2f29bde4b03c7 100644 --- a/packages/@aws-cdk/aws-globalaccelerator/lib/listener.ts +++ b/packages/@aws-cdk/aws-globalaccelerator/lib/listener.ts @@ -1,4 +1,5 @@ import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { IAccelerator } from './accelerator'; import * as ga from './globalaccelerator.generated'; @@ -104,7 +105,7 @@ export class Listener extends cdk.Resource implements IListener { /** * import from ARN */ - public static fromListenerArn(scope: cdk.Construct, id: string, listenerArn: string): IListener { + public static fromListenerArn(scope: Construct, id: string, listenerArn: string): IListener { class Import extends cdk.Resource implements IListener { public readonly listenerArn = listenerArn; } @@ -119,7 +120,7 @@ export class Listener extends cdk.Resource implements IListener { */ public readonly listenerName: string; - constructor(scope: cdk.Construct, id: string, props: ListenerProps) { + constructor(scope: Construct, id: string, props: ListenerProps) { super(scope, id); const resource = new ga.CfnListener(this, 'Resource', { diff --git a/packages/@aws-cdk/aws-globalaccelerator/package.json b/packages/@aws-cdk/aws-globalaccelerator/package.json index fb84dd0d1d5eb..f8fb6fb3c55bd 100644 --- a/packages/@aws-cdk/aws-globalaccelerator/package.json +++ b/packages/@aws-cdk/aws-globalaccelerator/package.json @@ -75,11 +75,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-globalaccelerator/test/integ.globalaccelerator.ts b/packages/@aws-cdk/aws-globalaccelerator/test/integ.globalaccelerator.ts index 2c9a632ec2734..e7ca2dc4e353c 100644 --- a/packages/@aws-cdk/aws-globalaccelerator/test/integ.globalaccelerator.ts +++ b/packages/@aws-cdk/aws-globalaccelerator/test/integ.globalaccelerator.ts @@ -2,11 +2,12 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as elbv2 from '@aws-cdk/aws-elasticloadbalancingv2'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as ga from '../lib'; import * as testfixture from './util'; class GaStack extends testfixture.TestStack { - constructor(scope: cdk.Construct, id: string) { + constructor(scope: Construct, id: string) { super(scope, id); const vpc = new ec2.Vpc(this, 'VPC', { maxAzs: 3, natGateways: 1}); diff --git a/packages/@aws-cdk/aws-globalaccelerator/test/util.ts b/packages/@aws-cdk/aws-globalaccelerator/test/util.ts index 03fc491788e21..19759e053a1cb 100644 --- a/packages/@aws-cdk/aws-globalaccelerator/test/util.ts +++ b/packages/@aws-cdk/aws-globalaccelerator/test/util.ts @@ -1,6 +1,7 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as elbv2 from '@aws-cdk/aws-elasticloadbalancingv2'; -import { App, Construct, Stack } from '@aws-cdk/core'; +import { App, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; export function testFixture() { const { stack, app } = testFixtureNoVpc(); diff --git a/packages/@aws-cdk/aws-glue/lib/database.ts b/packages/@aws-cdk/aws-glue/lib/database.ts index f548317570012..8b359251f54d2 100644 --- a/packages/@aws-cdk/aws-glue/lib/database.ts +++ b/packages/@aws-cdk/aws-glue/lib/database.ts @@ -1,4 +1,5 @@ -import { Construct, IResource, Resource, Stack } from '@aws-cdk/core'; +import { IResource, Resource, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnDatabase } from './glue.generated'; export interface IDatabase extends IResource { diff --git a/packages/@aws-cdk/aws-glue/lib/table.ts b/packages/@aws-cdk/aws-glue/lib/table.ts index f451e853dcb3a..51b5c16855bc9 100644 --- a/packages/@aws-cdk/aws-glue/lib/table.ts +++ b/packages/@aws-cdk/aws-glue/lib/table.ts @@ -1,7 +1,8 @@ import * as iam from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; import * as s3 from '@aws-cdk/aws-s3'; -import { Construct, Fn, IResource, Resource, Stack } from '@aws-cdk/core'; +import { Fn, IResource, Resource, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { DataFormat } from './data-format'; import { IDatabase } from './database'; import { CfnTable } from './glue.generated'; diff --git a/packages/@aws-cdk/aws-glue/package.json b/packages/@aws-cdk/aws-glue/package.json index d60997aff5011..7a4de9ddfd397 100644 --- a/packages/@aws-cdk/aws-glue/package.json +++ b/packages/@aws-cdk/aws-glue/package.json @@ -75,7 +75,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -83,7 +83,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 8c56995fb2838..e9c908e84d534 100644 --- a/packages/@aws-cdk/aws-greengrass/package.json +++ b/packages/@aws-cdk/aws-greengrass/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-guardduty/package.json b/packages/@aws-cdk/aws-guardduty/package.json index ecbd147877c71..121dc4f8df4ff 100644 --- a/packages/@aws-cdk/aws-guardduty/package.json +++ b/packages/@aws-cdk/aws-guardduty/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-iam/package.json b/packages/@aws-cdk/aws-iam/package.json index a0dcc893ca6da..830e6230d907e 100644 --- a/packages/@aws-cdk/aws-iam/package.json +++ b/packages/@aws-cdk/aws-iam/package.json @@ -74,12 +74,12 @@ "dependencies": { "@aws-cdk/core": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "engines": { diff --git a/packages/@aws-cdk/aws-inspector/package.json b/packages/@aws-cdk/aws-inspector/package.json index 8932c2609ee1a..046e052a2646e 100644 --- a/packages/@aws-cdk/aws-inspector/package.json +++ b/packages/@aws-cdk/aws-inspector/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 129bc07cc9612..d46e15bf36cf8 100644 --- a/packages/@aws-cdk/aws-iot/package.json +++ b/packages/@aws-cdk/aws-iot/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 9ffd414d1ce54..03d79ef4fa82b 100644 --- a/packages/@aws-cdk/aws-iot1click/package.json +++ b/packages/@aws-cdk/aws-iot1click/package.json @@ -71,11 +71,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 cb3f04b6d7327..b623e8d717e54 100644 --- a/packages/@aws-cdk/aws-iotanalytics/package.json +++ b/packages/@aws-cdk/aws-iotanalytics/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 3fcd793108886..984e3dedb530e 100644 --- a/packages/@aws-cdk/aws-iotevents/package.json +++ b/packages/@aws-cdk/aws-iotevents/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 57342d591fd11..13dffd01e7eb2 100644 --- a/packages/@aws-cdk/aws-iotthingsgraph/package.json +++ b/packages/@aws-cdk/aws-iotthingsgraph/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-kinesis/lib/stream.ts b/packages/@aws-cdk/aws-kinesis/lib/stream.ts index 7e65caaa2e239..0d9c5a01a2e5f 100644 --- a/packages/@aws-cdk/aws-kinesis/lib/stream.ts +++ b/packages/@aws-cdk/aws-kinesis/lib/stream.ts @@ -1,6 +1,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; -import { Aws, CfnCondition, Construct, Duration, Fn, IResolvable, IResource, Resource, Stack } from '@aws-cdk/core'; +import { Aws, CfnCondition, Duration, Fn, IResolvable, IResource, Resource, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnStream } from './kinesis.generated'; const READ_OPERATIONS = [ diff --git a/packages/@aws-cdk/aws-kinesis/package.json b/packages/@aws-cdk/aws-kinesis/package.json index 2e8866d2170d5..738feecf37bbd 100644 --- a/packages/@aws-cdk/aws-kinesis/package.json +++ b/packages/@aws-cdk/aws-kinesis/package.json @@ -74,7 +74,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -82,7 +82,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-kinesisanalytics/package.json b/packages/@aws-cdk/aws-kinesisanalytics/package.json index 65237840ff87d..4a1526f94f50b 100644 --- a/packages/@aws-cdk/aws-kinesisanalytics/package.json +++ b/packages/@aws-cdk/aws-kinesisanalytics/package.json @@ -73,12 +73,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 e468ddac10d1d..967f9b17d88cd 100644 --- a/packages/@aws-cdk/aws-kinesisfirehose/package.json +++ b/packages/@aws-cdk/aws-kinesisfirehose/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-kms/lib/alias.ts b/packages/@aws-cdk/aws-kms/lib/alias.ts index 2ba88fdb650ce..8593b65ac438c 100644 --- a/packages/@aws-cdk/aws-kms/lib/alias.ts +++ b/packages/@aws-cdk/aws-kms/lib/alias.ts @@ -1,5 +1,6 @@ import * as iam from '@aws-cdk/aws-iam'; -import { Construct, RemovalPolicy, Resource, Stack, Token } from '@aws-cdk/core'; +import { RemovalPolicy, Resource, Stack, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { IKey } from './key'; import { CfnAlias } from './kms.generated'; diff --git a/packages/@aws-cdk/aws-kms/lib/key.ts b/packages/@aws-cdk/aws-kms/lib/key.ts index 2edcbafa45e84..39255c72af792 100644 --- a/packages/@aws-cdk/aws-kms/lib/key.ts +++ b/packages/@aws-cdk/aws-kms/lib/key.ts @@ -1,5 +1,6 @@ import * as iam from '@aws-cdk/aws-iam'; -import { Construct, IResource, RemovalPolicy, Resource, Stack } from '@aws-cdk/core'; +import { IResource, RemovalPolicy, Resource, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Alias } from './alias'; import { CfnKey } from './kms.generated'; @@ -201,7 +202,7 @@ abstract class KeyBase extends Resource implements IKey { * undefined otherwise */ private granteeStackDependsOnKeyStack(grantee: iam.IGrantable): string | undefined { - if (!(Construct.isConstruct(grantee))) { + if (!(grantee instanceof Construct)) { return undefined; } const keyStack = Stack.of(this); @@ -215,7 +216,7 @@ abstract class KeyBase extends Resource implements IKey { } private isGranteeFromAnotherRegion(grantee: iam.IGrantable): boolean { - if (!(Construct.isConstruct(grantee))) { + if (!(grantee instanceof Construct)) { return false; } const bucketStack = Stack.of(this); @@ -224,7 +225,7 @@ abstract class KeyBase extends Resource implements IKey { } private isGranteeFromAnotherAccount(grantee: iam.IGrantable): boolean { - if (!(Construct.isConstruct(grantee))) { + if (!(grantee instanceof Construct)) { return false; } const bucketStack = Stack.of(this); diff --git a/packages/@aws-cdk/aws-kms/package.json b/packages/@aws-cdk/aws-kms/package.json index 2251944ffcb68..0ad037d4987fd 100644 --- a/packages/@aws-cdk/aws-kms/package.json +++ b/packages/@aws-cdk/aws-kms/package.json @@ -73,13 +73,13 @@ "dependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-kms/test/test.alias.ts b/packages/@aws-cdk/aws-kms/test/test.alias.ts index 33df260bbf8e2..11e373a3d9efc 100644 --- a/packages/@aws-cdk/aws-kms/test/test.alias.ts +++ b/packages/@aws-cdk/aws-kms/test/test.alias.ts @@ -1,5 +1,6 @@ import { expect, haveResource, SynthUtils } from '@aws-cdk/assert'; -import { App, CfnOutput, Construct, Stack } from '@aws-cdk/core'; +import { App, CfnOutput, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Test } from 'nodeunit'; import { Alias } from '../lib/alias'; import { IKey, Key } from '../lib/key'; diff --git a/packages/@aws-cdk/aws-kms/test/test.key.ts b/packages/@aws-cdk/aws-kms/test/test.key.ts index 7adfd1d052d5c..c599f4645ad33 100644 --- a/packages/@aws-cdk/aws-kms/test/test.key.ts +++ b/packages/@aws-cdk/aws-kms/test/test.key.ts @@ -8,7 +8,7 @@ import { SynthUtils, } from '@aws-cdk/assert'; import * as iam from '@aws-cdk/aws-iam'; -import { App, CfnOutput, RemovalPolicy, Stack, Tag } from '@aws-cdk/core'; +import { App, Aspects, CfnOutput, RemovalPolicy, Stack, Tag } from '@aws-cdk/core'; import { Test } from 'nodeunit'; import { Key } from '../lib'; @@ -160,9 +160,9 @@ export = { p.addArnPrincipal('arn'); key.addToResourcePolicy(p); - key.node.applyAspect(new Tag('tag1', 'value1')); - key.node.applyAspect(new Tag('tag2', 'value2')); - key.node.applyAspect(new Tag('tag3', '')); + Aspects.of(key).apply(new Tag('tag1', 'value1')); + Aspects.of(key).apply(new Tag('tag2', 'value2')); + Aspects.of(key).apply(new Tag('tag3', '')); expect(stack).to(exactlyMatchTemplate({ Resources: { diff --git a/packages/@aws-cdk/aws-lakeformation/package.json b/packages/@aws-cdk/aws-lakeformation/package.json index e64123f8085c2..b9460e7343370 100644 --- a/packages/@aws-cdk/aws-lakeformation/package.json +++ b/packages/@aws-cdk/aws-lakeformation/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 893a0096f92fd..a0d36c506902a 100644 --- a/packages/@aws-cdk/aws-lambda-destinations/lib/event-bridge.ts +++ b/packages/@aws-cdk/aws-lambda-destinations/lib/event-bridge.ts @@ -1,6 +1,7 @@ import * as events from '@aws-cdk/aws-events'; import * as lambda from '@aws-cdk/aws-lambda'; -import { Construct, Stack } from '@aws-cdk/core'; +import { Stack } 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 eaa6d020de3e7..bd79b94a2b378 100644 --- a/packages/@aws-cdk/aws-lambda-destinations/lib/lambda.ts +++ b/packages/@aws-cdk/aws-lambda-destinations/lib/lambda.ts @@ -1,7 +1,7 @@ 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 { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { EventBridgeDestination } from './event-bridge'; /** 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 d02ddde7aa635..74144c9646739 100644 --- a/packages/@aws-cdk/aws-lambda-destinations/package.json +++ b/packages/@aws-cdk/aws-lambda-destinations/package.json @@ -72,7 +72,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -82,7 +82,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-lambda-destinations/test/integ.destinations.ts b/packages/@aws-cdk/aws-lambda-destinations/test/integ.destinations.ts index 90c0c678efd78..d67957f7d28c9 100644 --- a/packages/@aws-cdk/aws-lambda-destinations/test/integ.destinations.ts +++ b/packages/@aws-cdk/aws-lambda-destinations/test/integ.destinations.ts @@ -1,7 +1,8 @@ import * as lambda from '@aws-cdk/aws-lambda'; import * as sns from '@aws-cdk/aws-sns'; import * as sqs from '@aws-cdk/aws-sqs'; -import { App, Construct, Duration, Stack, StackProps } from '@aws-cdk/core'; +import { App, Duration, Stack, StackProps } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as destinations from '../lib'; /* diff --git a/packages/@aws-cdk/aws-lambda-destinations/test/integ.lambda-chain.ts b/packages/@aws-cdk/aws-lambda-destinations/test/integ.lambda-chain.ts index c205ad155bd28..546e238ed86f2 100644 --- a/packages/@aws-cdk/aws-lambda-destinations/test/integ.lambda-chain.ts +++ b/packages/@aws-cdk/aws-lambda-destinations/test/integ.lambda-chain.ts @@ -1,5 +1,6 @@ import * as lambda from '@aws-cdk/aws-lambda'; -import { App, CfnOutput, Construct, Stack, StackProps } from '@aws-cdk/core'; +import { App, CfnOutput, Stack, StackProps } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as destinations from '../lib'; // Test success case with: diff --git a/packages/@aws-cdk/aws-lambda-event-sources/package.json b/packages/@aws-cdk/aws-lambda-event-sources/package.json index e381573d61ca6..ac26238da3b16 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/package.json +++ b/packages/@aws-cdk/aws-lambda-event-sources/package.json @@ -78,7 +78,7 @@ "@aws-cdk/aws-sns-subscriptions": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -94,7 +94,7 @@ "@aws-cdk/aws-sns-subscriptions": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/test-function.ts b/packages/@aws-cdk/aws-lambda-event-sources/test/test-function.ts index 1328875986981..9455957fbef7c 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/test/test-function.ts +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/test-function.ts @@ -1,8 +1,8 @@ import * as lambda from '@aws-cdk/aws-lambda'; -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; export class TestFunction extends lambda.Function { - constructor(scope: cdk.Construct, id: string) { + constructor(scope: Construct, id: string) { super(scope, id, { handler: 'index.handler', code: lambda.Code.fromInline(`exports.handler = ${handler.toString()}`), diff --git a/packages/@aws-cdk/aws-lambda-nodejs/lib/function.ts b/packages/@aws-cdk/aws-lambda-nodejs/lib/function.ts index 1138807443fec..c56f188221d29 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/lib/function.ts +++ b/packages/@aws-cdk/aws-lambda-nodejs/lib/function.ts @@ -1,5 +1,5 @@ import * as lambda from '@aws-cdk/aws-lambda'; -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as fs from 'fs'; import * as path from 'path'; import { Bundling, ParcelBaseOptions } from './bundling'; @@ -41,7 +41,7 @@ export interface NodejsFunctionProps extends lambda.FunctionOptions, ParcelBaseO * A Node.js Lambda function bundled using Parcel */ export class NodejsFunction extends lambda.Function { - constructor(scope: cdk.Construct, id: string, props: NodejsFunctionProps = {}) { + constructor(scope: Construct, id: string, props: NodejsFunctionProps = {}) { if (props.runtime && props.runtime.family !== lambda.RuntimeFamily.NODEJS) { throw new Error('Only `NODEJS` runtimes are supported.'); } diff --git a/packages/@aws-cdk/aws-lambda-nodejs/package.json b/packages/@aws-cdk/aws-lambda-nodejs/package.json index 48c612067a32b..7ede38af5cae9 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/package.json +++ b/packages/@aws-cdk/aws-lambda-nodejs/package.json @@ -67,13 +67,13 @@ "dependencies": { "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies.ts b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies.ts index acd55e7f6e8c7..f448db61a10b2 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies.ts +++ b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.dependencies.ts @@ -1,5 +1,6 @@ import { Runtime } from '@aws-cdk/aws-lambda'; -import { App, Construct, Stack, StackProps } from '@aws-cdk/core'; +import { App, Stack, StackProps } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as path from 'path'; import * as lambda from '../lib'; diff --git a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.function.ts b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.function.ts index a8fb64bd288f1..8c0604fec5728 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/test/integ.function.ts +++ b/packages/@aws-cdk/aws-lambda-nodejs/test/integ.function.ts @@ -1,5 +1,6 @@ import { Runtime } from '@aws-cdk/aws-lambda'; -import { App, Construct, Stack, StackProps } from '@aws-cdk/core'; +import { App, Stack, StackProps } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as path from 'path'; import * as lambda from '../lib'; diff --git a/packages/@aws-cdk/aws-lambda/lib/alias.ts b/packages/@aws-cdk/aws-lambda/lib/alias.ts index 638f52e11a09f..790c6051f6f36 100644 --- a/packages/@aws-cdk/aws-lambda/lib/alias.ts +++ b/packages/@aws-cdk/aws-lambda/lib/alias.ts @@ -1,5 +1,5 @@ import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { EventInvokeConfigOptions } from './event-invoke-config'; import { IFunction, QualifiedFunctionBase } from './function-base'; import { extractQualifierFromArn, IVersion } from './lambda-version'; diff --git a/packages/@aws-cdk/aws-lambda/lib/code.ts b/packages/@aws-cdk/aws-lambda/lib/code.ts index 263e67f415bd4..aacce9ab4876b 100644 --- a/packages/@aws-cdk/aws-lambda/lib/code.ts +++ b/packages/@aws-cdk/aws-lambda/lib/code.ts @@ -1,6 +1,7 @@ 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'; +import { Construct } from 'constructs'; export abstract class Code { /** @@ -83,7 +84,7 @@ export abstract class Code { * @param scope The binding scope. Don't be smart about trying to down-cast or * assume it's initialized. You may just use it as a construct scope. */ - public abstract bind(scope: cdk.Construct): CodeConfig; + public abstract bind(scope: Construct): CodeConfig; /** * Called after the CFN function resource has been created to allow the code @@ -124,7 +125,7 @@ export class S3Code extends Code { this.bucketName = bucket.bucketName; } - public bind(_scope: cdk.Construct): CodeConfig { + public bind(_scope: Construct): CodeConfig { return { s3Location: { bucketName: this.bucketName, @@ -153,7 +154,7 @@ export class InlineCode extends Code { } } - public bind(_scope: cdk.Construct): CodeConfig { + public bind(_scope: Construct): CodeConfig { return { inlineCode: this.code, }; @@ -174,7 +175,7 @@ export class AssetCode extends Code { super(); } - public bind(scope: cdk.Construct): CodeConfig { + public bind(scope: Construct): CodeConfig { // If the same AssetCode is used multiple times, retain only the first instantiation. if (!this.asset) { this.asset = new s3_assets.Asset(scope, 'Code', { @@ -257,7 +258,7 @@ export class CfnParametersCode extends Code { this._objectKeyParam = props.objectKeyParam; } - public bind(scope: cdk.Construct): CodeConfig { + public bind(scope: Construct): CodeConfig { if (!this._bucketNameParam) { this._bucketNameParam = new cdk.CfnParameter(scope, 'LambdaSourceBucketNameParameter', { type: 'String', diff --git a/packages/@aws-cdk/aws-lambda/lib/destination.ts b/packages/@aws-cdk/aws-lambda/lib/destination.ts index 8fb6ab956db6d..256c12820a6a3 100644 --- a/packages/@aws-cdk/aws-lambda/lib/destination.ts +++ b/packages/@aws-cdk/aws-lambda/lib/destination.ts @@ -1,4 +1,4 @@ -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { IFunction } from './function-base'; /** diff --git a/packages/@aws-cdk/aws-lambda/lib/event-invoke-config.ts b/packages/@aws-cdk/aws-lambda/lib/event-invoke-config.ts index ca2c148001d93..6c2419c6f8fd5 100644 --- a/packages/@aws-cdk/aws-lambda/lib/event-invoke-config.ts +++ b/packages/@aws-cdk/aws-lambda/lib/event-invoke-config.ts @@ -1,4 +1,5 @@ -import { Construct, Duration, Resource } from '@aws-cdk/core'; +import { Duration, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { DestinationType, IDestination } from './destination'; import { IFunction } from './function-base'; import { CfnEventInvokeConfig } from './lambda.generated'; diff --git a/packages/@aws-cdk/aws-lambda/lib/event-source-mapping.ts b/packages/@aws-cdk/aws-lambda/lib/event-source-mapping.ts index 556b0cc732af1..f70af76762795 100644 --- a/packages/@aws-cdk/aws-lambda/lib/event-source-mapping.ts +++ b/packages/@aws-cdk/aws-lambda/lib/event-source-mapping.ts @@ -1,4 +1,5 @@ import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { IEventSourceDlq } from './dlq'; import { IFunction } from './function-base'; import { CfnEventSourceMapping } from './lambda.generated'; @@ -132,7 +133,7 @@ export class EventSourceMapping extends cdk.Resource implements IEventSourceMapp /** * Import an event source into this stack from its event source id. */ - public static fromEventSourceMappingId(scope: cdk.Construct, id: string, eventSourceMappingId: string): IEventSourceMapping { + public static fromEventSourceMappingId(scope: Construct, id: string, eventSourceMappingId: string): IEventSourceMapping { class Import extends cdk.Resource implements IEventSourceMapping { public readonly eventSourceMappingId = eventSourceMappingId; } @@ -141,7 +142,7 @@ export class EventSourceMapping extends cdk.Resource implements IEventSourceMapp public readonly eventSourceMappingId: string; - constructor(scope: cdk.Construct, id: string, props: EventSourceMappingProps) { + constructor(scope: Construct, id: string, props: EventSourceMappingProps) { super(scope, id); if (props.maxBatchingWindow && props.maxBatchingWindow.toSeconds() > 300) { diff --git a/packages/@aws-cdk/aws-lambda/lib/function-base.ts b/packages/@aws-cdk/aws-lambda/lib/function-base.ts index b9a2e6b4ef166..44bd6f4ebaf3d 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 } from '@aws-cdk/core'; +import { IResource, Resource } 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. @@ -177,7 +178,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 @@ -323,7 +324,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/function.ts b/packages/@aws-cdk/aws-lambda/lib/function.ts index d99d1b1ce8377..7f37e511d5cb2 100644 --- a/packages/@aws-cdk/aws-lambda/lib/function.ts +++ b/packages/@aws-cdk/aws-lambda/lib/function.ts @@ -3,7 +3,8 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import * as logs from '@aws-cdk/aws-logs'; import * as sqs from '@aws-cdk/aws-sqs'; -import { CfnResource, Construct, Duration, Fn, Lazy, Stack } from '@aws-cdk/core'; +import { CfnResource, Duration, Fn, Lazy } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Code, CodeConfig } from './code'; import { EventInvokeConfigOptions } from './event-invoke-config'; import { IEventSource } from './event-source'; @@ -288,7 +289,6 @@ export interface FunctionProps extends FunctionOptions { * library. */ export class Function extends FunctionBase { - /** * Returns a `lambda.Version` which represents the current version of this * Lambda function. A new version will be created every time the function's @@ -307,6 +307,18 @@ export class Function extends FunctionBase { ...this.currentVersionOptions, }); + // override the version's logical ID with a lazy string which includes the + // hash of the function itself, so a new version resource is created when + // the function configuration changes. + const cfn = this._currentVersion.node.defaultChild as CfnResource; + + cfn.overrideLogicalId(Lazy.stringValue({ produce: ctx => { + const originalLogicalId: string = ctx.resolve(cfn.logicalId); + const hash = calculateFunctionHash(this); + const logicalId = trimFromStart(originalLogicalId, 255 - 32); + return `${logicalId}${hash}`; + }})); + return this._currentVersion; } @@ -666,23 +678,6 @@ export class Function extends FunctionBase { return this._logGroup; } - protected prepare() { - super.prepare(); - - // if we have a current version resource, override it's logical id - // so that it includes the hash of the function code and it's configuration. - if (this._currentVersion) { - const stack = Stack.of(this); - const cfn = this._currentVersion.node.defaultChild as CfnResource; - const originalLogicalId: string = stack.resolve(cfn.logicalId); - - const hash = calculateFunctionHash(this); - - const logicalId = trimFromStart(originalLogicalId, 255 - 32); - cfn.overrideLogicalId(`${logicalId}${hash}`); - } - } - private renderEnvironment() { if (!this.environment || Object.keys(this.environment).length === 0) { return undefined; diff --git a/packages/@aws-cdk/aws-lambda/lib/lambda-version.ts b/packages/@aws-cdk/aws-lambda/lib/lambda-version.ts index 09c62a5530690..436d2ed4d5e57 100644 --- a/packages/@aws-cdk/aws-lambda/lib/lambda-version.ts +++ b/packages/@aws-cdk/aws-lambda/lib/lambda-version.ts @@ -1,5 +1,6 @@ import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; -import { Construct, Fn, RemovalPolicy } from '@aws-cdk/core'; +import { Fn, RemovalPolicy } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Alias, AliasOptions } from './alias'; import { EventInvokeConfigOptions } from './event-invoke-config'; import { Function } from './function'; diff --git a/packages/@aws-cdk/aws-lambda/lib/layers.ts b/packages/@aws-cdk/aws-lambda/lib/layers.ts index 03e120223deba..12a92140b511a 100644 --- a/packages/@aws-cdk/aws-lambda/lib/layers.ts +++ b/packages/@aws-cdk/aws-lambda/lib/layers.ts @@ -1,4 +1,5 @@ -import { Construct, IResource, Resource } from '@aws-cdk/core'; +import { IResource, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Code } from './code'; import { CfnLayerVersion, CfnLayerVersionPermission } from './lambda.generated'; import { Runtime } from './runtime'; diff --git a/packages/@aws-cdk/aws-lambda/lib/log-retention.ts b/packages/@aws-cdk/aws-lambda/lib/log-retention.ts index 6c5fec2da7cd9..9ffbfe73dba6f 100644 --- a/packages/@aws-cdk/aws-lambda/lib/log-retention.ts +++ b/packages/@aws-cdk/aws-lambda/lib/log-retention.ts @@ -1,6 +1,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as logs from '@aws-cdk/aws-logs'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as path from 'path'; import { Code } from './code'; import { Runtime } from './runtime'; @@ -58,14 +59,14 @@ export interface LogRetentionRetryOptions { * log group. The log group is created if it doesn't already exist. The policy * is removed when `retentionDays` is `undefined` or equal to `Infinity`. */ -export class LogRetention extends cdk.Construct { +export class LogRetention extends Construct { /** * The ARN of the LogGroup. */ public readonly logGroupArn: string; - constructor(scope: cdk.Construct, id: string, props: LogRetentionProps) { + constructor(scope: Construct, id: string, props: LogRetentionProps) { super(scope, id); // Custom resource provider 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/singleton-lambda.ts b/packages/@aws-cdk/aws-lambda/lib/singleton-lambda.ts index f8515dc84e841..ae97a4a357190 100644 --- a/packages/@aws-cdk/aws-lambda/lib/singleton-lambda.ts +++ b/packages/@aws-cdk/aws-lambda/lib/singleton-lambda.ts @@ -1,5 +1,6 @@ import * as iam from '@aws-cdk/aws-iam'; import * as cdk from '@aws-cdk/core'; +import { Construct, IConstruct, IDependable, Node } from 'constructs'; import { Function as LambdaFunction, FunctionProps } from './function'; import { FunctionBase, IFunction } from './function-base'; import { Permission } from './permission'; @@ -43,11 +44,11 @@ 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: IFunction; - constructor(scope: cdk.Construct, id: string, props: SingletonFunctionProps) { + constructor(scope: Construct, id: string, props: SingletonFunctionProps) { super(scope, id); this.lambdaFunction = this.ensureLambda(props); @@ -69,7 +70,7 @@ export class SingletonFunction extends FunctionBase { * Using node.addDependency() does not work on this method as the underlying lambda function is modeled * as a singleton across the stack. Use this method instead to declare dependencies. */ - public addDependency(...up: cdk.IDependable[]) { + public addDependency(...up: IDependable[]) { this.lambdaFunction.node.addDependency(...up); } @@ -77,7 +78,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); } @@ -85,7 +86,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/lib/util.ts b/packages/@aws-cdk/aws-lambda/lib/util.ts index 16b56e524094c..fd5aa246e63cc 100644 --- a/packages/@aws-cdk/aws-lambda/lib/util.ts +++ b/packages/@aws-cdk/aws-lambda/lib/util.ts @@ -1,4 +1,4 @@ -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Alias, AliasOptions } from './alias'; import { IVersion } from './lambda-version'; diff --git a/packages/@aws-cdk/aws-lambda/package.json b/packages/@aws-cdk/aws-lambda/package.json index 73416597604ba..5c2344004c84a 100644 --- a/packages/@aws-cdk/aws-lambda/package.json +++ b/packages/@aws-cdk/aws-lambda/package.json @@ -93,7 +93,7 @@ "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -107,7 +107,7 @@ "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-lambda/test/integ.bundling.ts b/packages/@aws-cdk/aws-lambda/test/integ.bundling.ts index 6c1715bd05747..c7c9548280242 100644 --- a/packages/@aws-cdk/aws-lambda/test/integ.bundling.ts +++ b/packages/@aws-cdk/aws-lambda/test/integ.bundling.ts @@ -1,4 +1,5 @@ -import { App, CfnOutput, Construct, Stack, StackProps } from '@aws-cdk/core'; +import { App, CfnOutput, Stack, StackProps } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as path from 'path'; import * as lambda from '../lib'; diff --git a/packages/@aws-cdk/aws-lambda/test/test.lambda.ts b/packages/@aws-cdk/aws-lambda/test/test.lambda.ts index 6a697833e4700..67d736f0a341d 100644 --- a/packages/@aws-cdk/aws-lambda/test/test.lambda.ts +++ b/packages/@aws-cdk/aws-lambda/test/test.lambda.ts @@ -4,6 +4,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as logs from '@aws-cdk/aws-logs'; import * as sqs from '@aws-cdk/aws-sqs'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Test } from 'nodeunit'; import * as path from 'path'; import * as lambda from '../lib'; @@ -1527,7 +1528,7 @@ export = { }, }; -function newTestLambda(scope: cdk.Construct) { +function newTestLambda(scope: Construct) { return new lambda.Function(scope, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'bar', 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 bfa6f4a73f371..4fe7db3faf6a1 100644 --- a/packages/@aws-cdk/aws-logs-destinations/package.json +++ b/packages/@aws-cdk/aws-logs-destinations/package.json @@ -71,7 +71,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -80,7 +80,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 88e0b87c8320b..8874b9d9c1b5b 100644 --- a/packages/@aws-cdk/aws-logs/lib/cross-account-destination.ts +++ b/packages/@aws-cdk/aws-logs/lib/cross-account-destination.ts @@ -1,5 +1,6 @@ import * as iam from '@aws-cdk/aws-iam'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ILogGroup } from './log-group'; import { CfnDestination } from './logs.generated'; import { ILogSubscriptionDestination, LogSubscriptionDestinationConfig } from './subscription-filter'; @@ -64,7 +65,7 @@ export class CrossAccountDestination extends cdk.Resource implements ILogSubscri */ private readonly resource: CfnDestination; - constructor(scope: cdk.Construct, id: string, props: CrossAccountDestinationProps) { + constructor(scope: Construct, id: string, props: CrossAccountDestinationProps) { super(scope, id, { physicalName: props.destinationName || // In the underlying model, the name is not optional, but we make it so anyway. @@ -92,7 +93,7 @@ export class CrossAccountDestination extends cdk.Resource implements ILogSubscri this.policyDocument.addStatements(statement); } - public bind(_scope: cdk.Construct, _sourceLogGroup: ILogGroup): LogSubscriptionDestinationConfig { + public bind(_scope: Construct, _sourceLogGroup: ILogGroup): LogSubscriptionDestinationConfig { return { arn: this.destinationArn }; } diff --git a/packages/@aws-cdk/aws-logs/lib/log-group.ts b/packages/@aws-cdk/aws-logs/lib/log-group.ts index 70512828aea3b..1c416165703c4 100644 --- a/packages/@aws-cdk/aws-logs/lib/log-group.ts +++ b/packages/@aws-cdk/aws-logs/lib/log-group.ts @@ -1,6 +1,7 @@ import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; import * as iam from '@aws-cdk/aws-iam'; -import { Construct, IResource, RemovalPolicy, Resource, Stack, Token } from '@aws-cdk/core'; +import { IResource, RemovalPolicy, Resource, Stack, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { LogStream } from './log-stream'; import { CfnLogGroup } from './logs.generated'; import { MetricFilter } from './metric-filter'; diff --git a/packages/@aws-cdk/aws-logs/lib/log-stream.ts b/packages/@aws-cdk/aws-logs/lib/log-stream.ts index 952f979577da5..d6e072da8c3d6 100644 --- a/packages/@aws-cdk/aws-logs/lib/log-stream.ts +++ b/packages/@aws-cdk/aws-logs/lib/log-stream.ts @@ -1,4 +1,5 @@ -import { Construct, IResource, RemovalPolicy, Resource } from '@aws-cdk/core'; +import { IResource, RemovalPolicy, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ILogGroup } from './log-group'; import { CfnLogStream } from './logs.generated'; diff --git a/packages/@aws-cdk/aws-logs/lib/metric-filter.ts b/packages/@aws-cdk/aws-logs/lib/metric-filter.ts index 3b8fe826d053e..8dda5f1728fd3 100644 --- a/packages/@aws-cdk/aws-logs/lib/metric-filter.ts +++ b/packages/@aws-cdk/aws-logs/lib/metric-filter.ts @@ -1,5 +1,6 @@ import { Metric, MetricOptions } from '@aws-cdk/aws-cloudwatch'; -import { Construct, Resource } from '@aws-cdk/core'; +import { Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ILogGroup, MetricFilterOptions } from './log-group'; import { CfnMetricFilter } from './logs.generated'; diff --git a/packages/@aws-cdk/aws-logs/lib/subscription-filter.ts b/packages/@aws-cdk/aws-logs/lib/subscription-filter.ts index 8dd397f0fa76f..099094032d3a1 100644 --- a/packages/@aws-cdk/aws-logs/lib/subscription-filter.ts +++ b/packages/@aws-cdk/aws-logs/lib/subscription-filter.ts @@ -1,5 +1,6 @@ import * as iam from '@aws-cdk/aws-iam'; -import { Construct, Resource } from '@aws-cdk/core'; +import { Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ILogGroup, SubscriptionFilterOptions } from './log-group'; import { CfnSubscriptionFilter } from './logs.generated'; diff --git a/packages/@aws-cdk/aws-logs/package.json b/packages/@aws-cdk/aws-logs/package.json index c7dc3e58d9753..46bd6b88097d9 100644 --- a/packages/@aws-cdk/aws-logs/package.json +++ b/packages/@aws-cdk/aws-logs/package.json @@ -74,14 +74,14 @@ "@aws-cdk/aws-cloudwatch": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-cloudwatch": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-logs/test/test.subscriptionfilter.ts b/packages/@aws-cdk/aws-logs/test/test.subscriptionfilter.ts index d769300d0869b..0aef93813a7b7 100644 --- a/packages/@aws-cdk/aws-logs/test/test.subscriptionfilter.ts +++ b/packages/@aws-cdk/aws-logs/test/test.subscriptionfilter.ts @@ -1,5 +1,6 @@ import { expect, haveResource } from '@aws-cdk/assert'; -import { Construct, Stack } from '@aws-cdk/core'; +import { Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Test } from 'nodeunit'; import { FilterPattern, ILogGroup, ILogSubscriptionDestination, LogGroup, SubscriptionFilter } from '../lib'; diff --git a/packages/@aws-cdk/aws-managedblockchain/package.json b/packages/@aws-cdk/aws-managedblockchain/package.json index 115fdeb107cdc..727af6f7ebf2f 100644 --- a/packages/@aws-cdk/aws-managedblockchain/package.json +++ b/packages/@aws-cdk/aws-managedblockchain/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-mediaconvert/package.json b/packages/@aws-cdk/aws-mediaconvert/package.json index a9715d82568fe..30e7ea0b0abe6 100644 --- a/packages/@aws-cdk/aws-mediaconvert/package.json +++ b/packages/@aws-cdk/aws-mediaconvert/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 6c3d6071601ee..e1e0f4f930968 100644 --- a/packages/@aws-cdk/aws-medialive/package.json +++ b/packages/@aws-cdk/aws-medialive/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 9dddf5241e70d..6d065601c48cf 100644 --- a/packages/@aws-cdk/aws-mediastore/package.json +++ b/packages/@aws-cdk/aws-mediastore/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 c2b6273e03135..3c8db2ff73461 100644 --- a/packages/@aws-cdk/aws-msk/package.json +++ b/packages/@aws-cdk/aws-msk/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-neptune/package.json b/packages/@aws-cdk/aws-neptune/package.json index 93a966b1e782c..3348403d8ace2 100644 --- a/packages/@aws-cdk/aws-neptune/package.json +++ b/packages/@aws-cdk/aws-neptune/package.json @@ -71,11 +71,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 020fe11906219..b9ca88ac05ecd 100644 --- a/packages/@aws-cdk/aws-opsworks/package.json +++ b/packages/@aws-cdk/aws-opsworks/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 659eb8a9745c2..ca81e3bcc7919 100644 --- a/packages/@aws-cdk/aws-opsworkscm/package.json +++ b/packages/@aws-cdk/aws-opsworkscm/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 1ada031b4b640..8a75d0e98b9a2 100644 --- a/packages/@aws-cdk/aws-pinpoint/package.json +++ b/packages/@aws-cdk/aws-pinpoint/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 fbe2e8417bee9..b0338e684c920 100644 --- a/packages/@aws-cdk/aws-pinpointemail/package.json +++ b/packages/@aws-cdk/aws-pinpointemail/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 5db773c1a026a..22152f3b71e80 100644 --- a/packages/@aws-cdk/aws-qldb/package.json +++ b/packages/@aws-cdk/aws-qldb/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-ram/package.json b/packages/@aws-cdk/aws-ram/package.json index 2799e1917e02e..632167f0a748d 100644 --- a/packages/@aws-cdk/aws-ram/package.json +++ b/packages/@aws-cdk/aws-ram/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-rds/lib/cluster.ts b/packages/@aws-cdk/aws-rds/lib/cluster.ts index 51392769e64dd..1c489edcfcf6d 100644 --- a/packages/@aws-cdk/aws-rds/lib/cluster.ts +++ b/packages/@aws-cdk/aws-rds/lib/cluster.ts @@ -3,7 +3,8 @@ import { IRole, ManagedPolicy, Role, ServicePrincipal } from '@aws-cdk/aws-iam'; 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 { CfnDeletionPolicy, Construct, Duration, RemovalPolicy, Resource, Token } from '@aws-cdk/core'; +import { CfnDeletionPolicy, Duration, RemovalPolicy, Resource, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { DatabaseClusterAttributes, IDatabaseCluster } from './cluster-ref'; import { DatabaseSecret } from './database-secret'; import { Endpoint } from './endpoint'; diff --git a/packages/@aws-cdk/aws-rds/lib/database-secret.ts b/packages/@aws-cdk/aws-rds/lib/database-secret.ts index e0d2d24f3e969..57176d56e706a 100644 --- a/packages/@aws-cdk/aws-rds/lib/database-secret.ts +++ b/packages/@aws-cdk/aws-rds/lib/database-secret.ts @@ -1,6 +1,7 @@ import * as kms from '@aws-cdk/aws-kms'; import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; -import { Aws, Construct } from '@aws-cdk/core'; +import { Aws } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Construction properties for a DatabaseSecret. diff --git a/packages/@aws-cdk/aws-rds/lib/instance.ts b/packages/@aws-cdk/aws-rds/lib/instance.ts index c2fc8d4b0e8b7..31e68fa2c05cf 100644 --- a/packages/@aws-cdk/aws-rds/lib/instance.ts +++ b/packages/@aws-cdk/aws-rds/lib/instance.ts @@ -5,7 +5,8 @@ import * as kms from '@aws-cdk/aws-kms'; import * as lambda from '@aws-cdk/aws-lambda'; import * as logs from '@aws-cdk/aws-logs'; import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; -import { CfnDeletionPolicy, Construct, Duration, IResource, Lazy, RemovalPolicy, Resource, SecretValue, Stack, Token } from '@aws-cdk/core'; +import { CfnDeletionPolicy, Duration, IResource, Lazy, RemovalPolicy, Resource, SecretValue, Stack, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { DatabaseSecret } from './database-secret'; import { Endpoint } from './endpoint'; import { IOptionGroup } from './option-group'; diff --git a/packages/@aws-cdk/aws-rds/lib/option-group.ts b/packages/@aws-cdk/aws-rds/lib/option-group.ts index 19ca1781bccda..aa12be9e98f64 100644 --- a/packages/@aws-cdk/aws-rds/lib/option-group.ts +++ b/packages/@aws-cdk/aws-rds/lib/option-group.ts @@ -1,5 +1,6 @@ import * as ec2 from '@aws-cdk/aws-ec2'; -import { Construct, IResource, Resource } from '@aws-cdk/core'; +import { IResource, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { DatabaseInstanceEngine } from './instance'; import { CfnOptionGroup } from './rds.generated'; diff --git a/packages/@aws-cdk/aws-rds/lib/parameter-group.ts b/packages/@aws-cdk/aws-rds/lib/parameter-group.ts index 40cddd310fa0c..536127d1c84ad 100644 --- a/packages/@aws-cdk/aws-rds/lib/parameter-group.ts +++ b/packages/@aws-cdk/aws-rds/lib/parameter-group.ts @@ -1,4 +1,5 @@ -import { Construct, IResource, Lazy, Resource } from '@aws-cdk/core'; +import { IResource, Lazy, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnDBClusterParameterGroup, CfnDBParameterGroup } from './rds.generated'; /** diff --git a/packages/@aws-cdk/aws-rds/lib/proxy.ts b/packages/@aws-cdk/aws-rds/lib/proxy.ts index 4e8112ed9ffbc..5013911b68fd6 100644 --- a/packages/@aws-cdk/aws-rds/lib/proxy.ts +++ b/packages/@aws-cdk/aws-rds/lib/proxy.ts @@ -2,6 +2,7 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { IDatabaseCluster } from './cluster-ref'; import { IDatabaseInstance } from './instance'; import { CfnDBCluster, CfnDBInstance, CfnDBProxy, CfnDBProxyTargetGroup } from './rds.generated'; @@ -332,7 +333,7 @@ export class DatabaseProxy extends cdk.Resource * Import an existing database proxy. */ public static fromDatabaseProxyAttributes( - scope: cdk.Construct, + scope: Construct, id: string, attrs: DatabaseProxyAttributes, ): IDatabaseProxy { @@ -372,7 +373,7 @@ export class DatabaseProxy extends cdk.Resource private readonly resource: CfnDBProxy; - constructor(scope: cdk.Construct, id: string, props: DatabaseProxyProps) { + constructor(scope: Construct, id: string, props: DatabaseProxyProps) { super(scope, id, { physicalName: props.dbProxyName || id }); const role = props.role || new iam.Role(this, 'IAMRole', { diff --git a/packages/@aws-cdk/aws-rds/package.json b/packages/@aws-cdk/aws-rds/package.json index 1568b3346b09b..d5b715fad2f45 100644 --- a/packages/@aws-cdk/aws-rds/package.json +++ b/packages/@aws-cdk/aws-rds/package.json @@ -82,7 +82,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -96,7 +96,7 @@ "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-redshift/lib/cluster.ts b/packages/@aws-cdk/aws-redshift/lib/cluster.ts index 48caa7aabf1db..e83ffdf047375 100644 --- a/packages/@aws-cdk/aws-redshift/lib/cluster.ts +++ b/packages/@aws-cdk/aws-redshift/lib/cluster.ts @@ -3,7 +3,8 @@ import * as iam from '@aws-cdk/aws-iam'; 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 { Construct, Duration, IResource, RemovalPolicy, Resource, SecretValue, Token } from '@aws-cdk/core'; +import { Duration, IResource, RemovalPolicy, Resource, SecretValue, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { DatabaseSecret } from './database-secret'; import { Endpoint } from './endpoint'; import { IClusterParameterGroup } from './parameter-group'; diff --git a/packages/@aws-cdk/aws-redshift/lib/database-secret.ts b/packages/@aws-cdk/aws-redshift/lib/database-secret.ts index 7e7617be2be83..2476bfef3f7e0 100644 --- a/packages/@aws-cdk/aws-redshift/lib/database-secret.ts +++ b/packages/@aws-cdk/aws-redshift/lib/database-secret.ts @@ -1,6 +1,6 @@ import * as kms from '@aws-cdk/aws-kms'; import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Construction properties for a DatabaseSecret. diff --git a/packages/@aws-cdk/aws-redshift/lib/parameter-group.ts b/packages/@aws-cdk/aws-redshift/lib/parameter-group.ts index ea5698b235628..1d3a27276f4a2 100644 --- a/packages/@aws-cdk/aws-redshift/lib/parameter-group.ts +++ b/packages/@aws-cdk/aws-redshift/lib/parameter-group.ts @@ -1,4 +1,5 @@ -import { Construct, IResource, Resource } from '@aws-cdk/core'; +import { IResource, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnClusterParameterGroup } from './redshift.generated'; /** diff --git a/packages/@aws-cdk/aws-redshift/package.json b/packages/@aws-cdk/aws-redshift/package.json index 3b645e15ba91e..f6c469f5f75c3 100644 --- a/packages/@aws-cdk/aws-redshift/package.json +++ b/packages/@aws-cdk/aws-redshift/package.json @@ -76,7 +76,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -86,7 +86,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 e74ee3bf2ebdf..ff151cba11c12 100644 --- a/packages/@aws-cdk/aws-robomaker/package.json +++ b/packages/@aws-cdk/aws-robomaker/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 7fd4b85f8d4f6..633d6c4e8eb9a 100644 --- a/packages/@aws-cdk/aws-route53-patterns/lib/website-redirect.ts +++ b/packages/@aws-cdk/aws-route53-patterns/lib/website-redirect.ts @@ -3,7 +3,8 @@ import { CloudFrontWebDistribution, OriginProtocolPolicy, PriceClass, ViewerProt import { ARecord, IHostedZone, RecordTarget } from '@aws-cdk/aws-route53'; import { CloudFrontTarget } from '@aws-cdk/aws-route53-targets'; import { Bucket, RedirectProtocol } from '@aws-cdk/aws-s3'; -import { Construct, RemovalPolicy } from '@aws-cdk/core'; +import { RemovalPolicy } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as crypto from 'crypto'; /** diff --git a/packages/@aws-cdk/aws-route53-patterns/package.json b/packages/@aws-cdk/aws-route53-patterns/package.json index 56855cc2c70b0..e4ff11b40cde7 100644 --- a/packages/@aws-cdk/aws-route53-patterns/package.json +++ b/packages/@aws-cdk/aws-route53-patterns/package.json @@ -74,7 +74,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -86,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.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-route53-targets/package.json b/packages/@aws-cdk/aws-route53-targets/package.json index f7ab4f96b29b9..80106c93a44f8 100644 --- a/packages/@aws-cdk/aws-route53-targets/package.json +++ b/packages/@aws-cdk/aws-route53-targets/package.json @@ -79,7 +79,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -94,7 +94,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-route53-targets/test/integ.api-gateway-domain-name.ts b/packages/@aws-cdk/aws-route53-targets/test/integ.api-gateway-domain-name.ts index 0379294a59e9e..ce8246d7955f7 100644 --- a/packages/@aws-cdk/aws-route53-targets/test/integ.api-gateway-domain-name.ts +++ b/packages/@aws-cdk/aws-route53-targets/test/integ.api-gateway-domain-name.ts @@ -3,7 +3,8 @@ import * as apig from '@aws-cdk/aws-apigateway'; import * as acm from '@aws-cdk/aws-certificatemanager'; import * as lambda from '@aws-cdk/aws-lambda'; import * as route53 from '@aws-cdk/aws-route53'; -import { App, Construct, Stack } from '@aws-cdk/core'; +import { App, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as targets from '../lib'; class TestStack extends Stack { diff --git a/packages/@aws-cdk/aws-route53/lib/hosted-zone.ts b/packages/@aws-cdk/aws-route53/lib/hosted-zone.ts index f7cb345f8cc73..1f4099db6317d 100644 --- a/packages/@aws-cdk/aws-route53/lib/hosted-zone.ts +++ b/packages/@aws-cdk/aws-route53/lib/hosted-zone.ts @@ -1,6 +1,7 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as cxschema from '@aws-cdk/cloud-assembly-schema'; -import { Construct, ContextProvider, Duration, Lazy, Resource, Stack } from '@aws-cdk/core'; +import { ContextProvider, Duration, Lazy, Resource, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { HostedZoneProviderProps } from './hosted-zone-provider'; import { HostedZoneAttributes, IHostedZone } from './hosted-zone-ref'; import { CaaAmazonRecord, ZoneDelegationRecord } from './record-set'; diff --git a/packages/@aws-cdk/aws-route53/lib/record-set.ts b/packages/@aws-cdk/aws-route53/lib/record-set.ts index 95e9b0b612c52..321b6e283d93d 100644 --- a/packages/@aws-cdk/aws-route53/lib/record-set.ts +++ b/packages/@aws-cdk/aws-route53/lib/record-set.ts @@ -1,4 +1,5 @@ -import { Construct, Duration, IResource, Resource, Token } from '@aws-cdk/core'; +import { Duration, IResource, Resource, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { IAliasRecordTarget } from './alias-record-target'; import { IHostedZone } from './hosted-zone-ref'; import { CfnRecordSet } from './route53.generated'; diff --git a/packages/@aws-cdk/aws-route53/lib/util.ts b/packages/@aws-cdk/aws-route53/lib/util.ts index 4df66added379..5aa8b7d6e49bf 100644 --- a/packages/@aws-cdk/aws-route53/lib/util.ts +++ b/packages/@aws-cdk/aws-route53/lib/util.ts @@ -1,4 +1,5 @@ -import { Construct, Stack } from '@aws-cdk/core'; +import { Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { IHostedZone } from './hosted-zone-ref'; /** diff --git a/packages/@aws-cdk/aws-route53/package.json b/packages/@aws-cdk/aws-route53/package.json index c7a580349cace..e5e407fcb6828 100644 --- a/packages/@aws-cdk/aws-route53/package.json +++ b/packages/@aws-cdk/aws-route53/package.json @@ -76,7 +76,7 @@ "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -84,7 +84,7 @@ "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 55a0373fa39bb..6d367e18836e3 100644 --- a/packages/@aws-cdk/aws-route53resolver/package.json +++ b/packages/@aws-cdk/aws-route53resolver/package.json @@ -71,11 +71,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 307575cf561ae..978ad7485c2f5 100644 --- a/packages/@aws-cdk/aws-s3-assets/lib/asset.ts +++ b/packages/@aws-cdk/aws-s3-assets/lib/asset.ts @@ -4,6 +4,7 @@ import * as kms from '@aws-cdk/aws-kms'; import * as s3 from '@aws-cdk/aws-s3'; import * as cdk from '@aws-cdk/core'; import * as cxapi from '@aws-cdk/cx-api'; +import { Construct } from 'constructs'; import * as fs from 'fs'; import * as path from 'path'; import { toSymlinkFollow } from './compat'; @@ -53,7 +54,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 cdk.Construct implements cdk.IAsset { +export class Asset extends Construct implements cdk.IAsset { /** * Attribute that represents the name of the bucket this asset exists in. */ @@ -110,7 +111,7 @@ export class Asset extends cdk.Construct implements cdk.IAsset { public readonly assetHash: string; - constructor(scope: cdk.Construct, id: string, props: AssetProps) { + constructor(scope: Construct, id: string, props: AssetProps) { super(scope, id); // stage the asset source (conditionally). diff --git a/packages/@aws-cdk/aws-s3-assets/package.json b/packages/@aws-cdk/aws-s3-assets/package.json index 21b237022c32e..49d85d52b7faa 100644 --- a/packages/@aws-cdk/aws-s3-assets/package.json +++ b/packages/@aws-cdk/aws-s3-assets/package.json @@ -75,7 +75,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -85,7 +85,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-s3-assets/test/integ.assets.bundling.lit.ts b/packages/@aws-cdk/aws-s3-assets/test/integ.assets.bundling.lit.ts index b1b144f2de275..925d264892221 100644 --- a/packages/@aws-cdk/aws-s3-assets/test/integ.assets.bundling.lit.ts +++ b/packages/@aws-cdk/aws-s3-assets/test/integ.assets.bundling.lit.ts @@ -1,5 +1,6 @@ import * as iam from '@aws-cdk/aws-iam'; -import { App, BundlingDockerImage, Construct, Stack, StackProps } from '@aws-cdk/core'; +import { App, BundlingDockerImage, Stack, StackProps } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as path from 'path'; import * as assets from '../lib'; 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 b46e239a75a83..ed532b20a5220 100644 --- a/packages/@aws-cdk/aws-s3-deployment/lib/bucket-deployment.ts +++ b/packages/@aws-cdk/aws-s3-deployment/lib/bucket-deployment.ts @@ -3,6 +3,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 cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as crypto from 'crypto'; import * as fs from 'fs'; import * as path from 'path'; @@ -153,8 +154,8 @@ export interface BucketDeploymentProps { readonly serverSideEncryptionCustomerAlgorithm?: string; } -export class BucketDeployment extends cdk.Construct { - constructor(scope: cdk.Construct, id: string, props: BucketDeploymentProps) { +export class BucketDeployment extends Construct { + constructor(scope: Construct, id: string, props: BucketDeploymentProps) { super(scope, id); if (props.distributionPaths && !props.distribution) { diff --git a/packages/@aws-cdk/aws-s3-deployment/lib/source.ts b/packages/@aws-cdk/aws-s3-deployment/lib/source.ts index 6f0f877662891..3add67057797a 100644 --- a/packages/@aws-cdk/aws-s3-deployment/lib/source.ts +++ b/packages/@aws-cdk/aws-s3-deployment/lib/source.ts @@ -1,7 +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'; -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; export interface SourceConfig { /** @@ -33,7 +33,7 @@ export interface ISource { * Binds the source to a bucket deployment. * @param scope The construct tree context. */ - bind(scope: cdk.Construct, context?: DeploymentSourceContext): SourceConfig; + bind(scope: Construct, context?: DeploymentSourceContext): SourceConfig; } /** @@ -54,7 +54,7 @@ export class Source { */ public static bucket(bucket: s3.IBucket, zipObjectKey: string): ISource { return { - bind: (_: cdk.Construct, context?: DeploymentSourceContext) => { + bind: (_: Construct, context?: DeploymentSourceContext) => { if (!context) { throw new Error('To use a Source.bucket(), context must be provided'); } @@ -71,7 +71,7 @@ export class Source { */ public static asset(path: string, options?: s3_assets.AssetOptions): ISource { return { - bind(scope: cdk.Construct, context?: DeploymentSourceContext): SourceConfig { + bind(scope: Construct, context?: DeploymentSourceContext): SourceConfig { if (!context) { throw new Error('To use a Source.asset(), context must be provided'); } diff --git a/packages/@aws-cdk/aws-s3-deployment/package.json b/packages/@aws-cdk/aws-s3-deployment/package.json index 9291eb8292125..40cc5cca206c5 100644 --- a/packages/@aws-cdk/aws-s3-deployment/package.json +++ b/packages/@aws-cdk/aws-s3-deployment/package.json @@ -90,7 +90,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-s3-assets": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -100,7 +100,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-s3-assets": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 a1ea5ac5ac42c..66a2ba059fb68 100644 --- a/packages/@aws-cdk/aws-s3-notifications/lib/lambda.ts +++ b/packages/@aws-cdk/aws-s3-notifications/lib/lambda.ts @@ -1,7 +1,8 @@ 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 { CfnResource, Construct, Stack } from '@aws-cdk/core'; +import { CfnResource, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Use a Lambda function as a bucket notification destination diff --git a/packages/@aws-cdk/aws-s3-notifications/lib/sns.ts b/packages/@aws-cdk/aws-s3-notifications/lib/sns.ts index 2ad732943ebca..456b837c183a6 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 10bdd023789d5..791504937288b 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 10fcc8be6b5cd..0b03db34897b4 100644 --- a/packages/@aws-cdk/aws-s3-notifications/package.json +++ b/packages/@aws-cdk/aws-s3-notifications/package.json @@ -71,7 +71,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -81,7 +81,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-s3-notifications/test/lambda/lambda.test.ts b/packages/@aws-cdk/aws-s3-notifications/test/lambda/lambda.test.ts index 76563c2b4cccc..67e2e2eae9071 100644 --- a/packages/@aws-cdk/aws-s3-notifications/test/lambda/lambda.test.ts +++ b/packages/@aws-cdk/aws-s3-notifications/test/lambda/lambda.test.ts @@ -89,8 +89,7 @@ test('permissions are added as a dependency to the notifications resource when u const notifications = stack.node.findAll().filter(c => c.node.id === 'Notifications')[0]; const dependencies = notifications!.node.dependencies; - expect(dependencies[0].target.node.id).toEqual('AllowBucketNotificationsFromMyBucket'); - + expect(dependencies[0].node.id).toEqual('AllowBucketNotificationsFromMyBucket'); }); test('add multiple event notifications using a singleton function', () => { diff --git a/packages/@aws-cdk/aws-s3-notifications/test/notifications.test.ts b/packages/@aws-cdk/aws-s3-notifications/test/notifications.test.ts index 2dff3ba044311..4da045e384df8 100644 --- a/packages/@aws-cdk/aws-s3-notifications/test/notifications.test.ts +++ b/packages/@aws-cdk/aws-s3-notifications/test/notifications.test.ts @@ -39,7 +39,7 @@ test('when notification are added, a custom resource is provisioned + a lambda h test('when notification are added, you can tag the lambda', () => { const stack = new cdk.Stack(); - stack.node.applyAspect(new cdk.Tag('Lambda', 'AreTagged')); + cdk.Tag.add(stack, 'Lambda', 'AreTagged'); const bucket = new s3.Bucket(stack, 'MyBucket'); @@ -290,8 +290,6 @@ test('a notification destination can specify a set of dependencies that must be bucket.addObjectCreatedNotification(dest); - cdk.ConstructNode.prepare(stack.node); - expect(SynthUtils.synthesize(stack).template.Resources.BucketNotifications8F2E257D).toEqual({ Type: 'Custom::S3BucketNotifications', Properties: { diff --git a/packages/@aws-cdk/aws-s3/lib/bucket-policy.ts b/packages/@aws-cdk/aws-s3/lib/bucket-policy.ts index 10f35b5c40e3d..395ff706b5fdc 100644 --- a/packages/@aws-cdk/aws-s3/lib/bucket-policy.ts +++ b/packages/@aws-cdk/aws-s3/lib/bucket-policy.ts @@ -1,5 +1,6 @@ import { PolicyDocument } from '@aws-cdk/aws-iam'; -import { Construct, RemovalPolicy, Resource } from '@aws-cdk/core'; +import { RemovalPolicy, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { IBucket } from './bucket'; import { CfnBucketPolicy } from './s3.generated'; diff --git a/packages/@aws-cdk/aws-s3/lib/bucket.ts b/packages/@aws-cdk/aws-s3/lib/bucket.ts index ddc2b8939913c..d7f701a812d54 100644 --- a/packages/@aws-cdk/aws-s3/lib/bucket.ts +++ b/packages/@aws-cdk/aws-s3/lib/bucket.ts @@ -1,7 +1,8 @@ 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 { Construct, Fn, IResource, Lazy, RemovalPolicy, Resource, Stack, Token } from '@aws-cdk/core'; +import { Fn, IResource, Lazy, RemovalPolicy, Resource, Stack, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { EOL } from 'os'; import { BucketPolicy } from './bucket-policy'; import { IBucketNotificationDestination } from './destination'; @@ -638,7 +639,7 @@ abstract class BucketBase extends Resource implements IBucket { } private isGranteeFromAnotherAccount(grantee: iam.IGrantable): boolean { - if (!(Construct.isConstruct(grantee))) { + if (!(grantee instanceof Construct)) { return false; } const bucketStack = Stack.of(this); diff --git a/packages/@aws-cdk/aws-s3/lib/destination.ts b/packages/@aws-cdk/aws-s3/lib/destination.ts index 31a7ac94ef9ac..78c8d14a4642a 100644 --- a/packages/@aws-cdk/aws-s3/lib/destination.ts +++ b/packages/@aws-cdk/aws-s3/lib/destination.ts @@ -1,4 +1,4 @@ -import * as cdk from '@aws-cdk/core'; +import { Construct, IConstruct } from 'constructs'; import { IBucket } from './bucket'; /** @@ -12,7 +12,7 @@ export interface IBucketNotificationDestination { * idempotency in each destination. * @param bucket The bucket object to bind to */ - bind(scope: cdk.Construct, bucket: IBucket): BucketNotificationDestinationConfig; + bind(scope: Construct, bucket: IBucket): BucketNotificationDestinationConfig; } /** @@ -33,7 +33,7 @@ export interface BucketNotificationDestinationConfig { * Any additional dependencies that should be resolved before the bucket notification * can be configured (for example, the SNS Topic Policy resource). */ - readonly dependencies?: cdk.IDependable[] + readonly dependencies?: IConstruct[] } /** 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 6d4c78682e699..5d8333d58d067 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,5 +1,6 @@ import * as iam from '@aws-cdk/aws-iam'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * A Lambda-based custom resource handler that provisions S3 bucket @@ -18,14 +19,14 @@ import * as cdk from '@aws-cdk/core'; * Sadly, we can't use @aws-cdk/aws-lambda as it will introduce a dependency * cycle, so this uses raw `cdk.Resource`s. */ -export class NotificationsResourceHandler extends cdk.Construct { +export class NotificationsResourceHandler extends Construct { /** * Defines a stack-singleton lambda function with the logic for a CloudFormation custom * resource that provisions bucket notification configuration for a bucket. * * @returns The ARN of the custom resource lambda function. */ - public static singleton(context: cdk.Construct) { + public static singleton(context: Construct) { const root = cdk.Stack.of(context); // well-known logical id to ensure stack singletonity @@ -44,7 +45,7 @@ export class NotificationsResourceHandler extends cdk.Construct { */ public readonly functionArn: string; - constructor(scope: cdk.Construct, id: string) { + constructor(scope: Construct, id: string) { super(scope, id); const role = new iam.Role(this, 'Role', { 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 fc5d83f8106d7..addd1f9a1fa28 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,4 +1,5 @@ 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'; @@ -28,14 +29,14 @@ interface NotificationsProps { * @see * https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig.html */ -export class BucketNotifications extends cdk.Construct { +export class BucketNotifications extends Construct { private readonly lambdaNotifications = new Array(); private readonly queueNotifications = new Array(); private readonly topicNotifications = new Array(); private resource?: cdk.CfnResource; private readonly bucket: Bucket; - constructor(scope: cdk.Construct, id: string, props: NotificationsProps) { + constructor(scope: Construct, id: string, props: NotificationsProps) { super(scope, id); this.bucket = props.bucket; } diff --git a/packages/@aws-cdk/aws-s3/lib/util.ts b/packages/@aws-cdk/aws-s3/lib/util.ts index 643fdc7472e1a..1c45ed899be4b 100644 --- a/packages/@aws-cdk/aws-s3/lib/util.ts +++ b/packages/@aws-cdk/aws-s3/lib/util.ts @@ -1,7 +1,8 @@ import * as cdk from '@aws-cdk/core'; +import { IConstruct } from 'constructs'; import { BucketAttributes } from './bucket'; -export function parseBucketArn(construct: cdk.IConstruct, props: BucketAttributes): string { +export function parseBucketArn(construct: IConstruct, props: BucketAttributes): string { // if we have an explicit bucket ARN, use it. if (props.bucketArn) { @@ -22,7 +23,7 @@ export function parseBucketArn(construct: cdk.IConstruct, props: BucketAttribute throw new Error('Cannot determine bucket ARN. At least `bucketArn` or `bucketName` is needed'); } -export function parseBucketName(construct: cdk.IConstruct, props: BucketAttributes): string | undefined { +export function parseBucketName(construct: IConstruct, props: BucketAttributes): string | undefined { // if we have an explicit bucket name, use it. if (props.bucketName) { diff --git a/packages/@aws-cdk/aws-s3/package.json b/packages/@aws-cdk/aws-s3/package.json index a28a0631c9621..f7f5fb3f4cc09 100644 --- a/packages/@aws-cdk/aws-s3/package.json +++ b/packages/@aws-cdk/aws-s3/package.json @@ -75,7 +75,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -83,7 +83,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-s3/test/test.aspect.ts b/packages/@aws-cdk/aws-s3/test/test.aspect.ts index ba2049b0f993e..7777ea43fe59c 100644 --- a/packages/@aws-cdk/aws-s3/test/test.aspect.ts +++ b/packages/@aws-cdk/aws-s3/test/test.aspect.ts @@ -1,6 +1,7 @@ // import { expect, haveResource, haveResourceLike, SynthUtils } from '@aws-cdk/assert'; import { SynthUtils } from '@aws-cdk/assert'; import * as cdk from '@aws-cdk/core'; +import { IConstruct } from 'constructs'; import { Test } from 'nodeunit'; import * as s3 from '../lib'; @@ -11,7 +12,7 @@ export = { new s3.Bucket(stack, 'MyBucket'); // WHEN - stack.node.applyAspect(new BucketVersioningChecker()); + cdk.Aspects.of(stack).apply(new BucketVersioningChecker()); // THEN const assembly = SynthUtils.synthesize(stack); @@ -29,7 +30,7 @@ export = { }); // WHEN - stack.node.applyAspect(new BucketVersioningChecker()); + cdk.Aspects.of(stack).apply(new BucketVersioningChecker()); // THEN const assembly = SynthUtils.synthesize(stack); @@ -40,7 +41,7 @@ export = { }; class BucketVersioningChecker implements cdk.IAspect { - public visit(node: cdk.IConstruct): void { + public visit(node: IConstruct): void { if (node instanceof s3.CfnBucket) { if (!node.versioningConfiguration || (!cdk.Tokenization.isResolvable(node.versioningConfiguration) && node.versioningConfiguration.status !== 'Enabled')) { diff --git a/packages/@aws-cdk/aws-sagemaker/package.json b/packages/@aws-cdk/aws-sagemaker/package.json index 712de070d4176..908fe630d39e6 100644 --- a/packages/@aws-cdk/aws-sagemaker/package.json +++ b/packages/@aws-cdk/aws-sagemaker/package.json @@ -71,11 +71,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 f49d0c41dc349..4195522f840ac 100644 --- a/packages/@aws-cdk/aws-sam/package.json +++ b/packages/@aws-cdk/aws-sam/package.json @@ -74,11 +74,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 298a065145bf1..6a9694c35afea 100644 --- a/packages/@aws-cdk/aws-sdb/package.json +++ b/packages/@aws-cdk/aws-sdb/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-secretsmanager/lib/policy.ts b/packages/@aws-cdk/aws-secretsmanager/lib/policy.ts index 54d6b2af5bb03..67769ed403399 100644 --- a/packages/@aws-cdk/aws-secretsmanager/lib/policy.ts +++ b/packages/@aws-cdk/aws-secretsmanager/lib/policy.ts @@ -1,5 +1,6 @@ import * as iam from '@aws-cdk/aws-iam'; -import { Construct, Resource } from '@aws-cdk/core'; +import { Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ISecret } from './secret'; import { CfnResourcePolicy } from './secretsmanager.generated'; diff --git a/packages/@aws-cdk/aws-secretsmanager/lib/rotation-schedule.ts b/packages/@aws-cdk/aws-secretsmanager/lib/rotation-schedule.ts index ada35925d8b3a..49d6170004e71 100644 --- a/packages/@aws-cdk/aws-secretsmanager/lib/rotation-schedule.ts +++ b/packages/@aws-cdk/aws-secretsmanager/lib/rotation-schedule.ts @@ -1,5 +1,6 @@ import * as lambda from '@aws-cdk/aws-lambda'; -import { Construct, Duration, Resource } from '@aws-cdk/core'; +import { Duration, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ISecret } from './secret'; import { CfnRotationSchedule } from './secretsmanager.generated'; diff --git a/packages/@aws-cdk/aws-secretsmanager/lib/secret-rotation.ts b/packages/@aws-cdk/aws-secretsmanager/lib/secret-rotation.ts index 16ff1056534bc..f05da84f6b815 100644 --- a/packages/@aws-cdk/aws-secretsmanager/lib/secret-rotation.ts +++ b/packages/@aws-cdk/aws-secretsmanager/lib/secret-rotation.ts @@ -1,7 +1,8 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as lambda from '@aws-cdk/aws-lambda'; import * as serverless from '@aws-cdk/aws-sam'; -import { Construct, Duration, Stack, Token } from '@aws-cdk/core'; +import { Duration, Stack, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ISecret } from './secret'; /** diff --git a/packages/@aws-cdk/aws-secretsmanager/lib/secret.ts b/packages/@aws-cdk/aws-secretsmanager/lib/secret.ts index 787d832764d54..c3b59570ddbd2 100644 --- a/packages/@aws-cdk/aws-secretsmanager/lib/secret.ts +++ b/packages/@aws-cdk/aws-secretsmanager/lib/secret.ts @@ -1,6 +1,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; -import { Construct, IResource, RemovalPolicy, Resource, SecretValue, Stack } from '@aws-cdk/core'; +import { IResource, RemovalPolicy, Resource, SecretValue, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ResourcePolicy } from './policy'; import { RotationSchedule, RotationScheduleOptions } from './rotation-schedule'; import * as secretsmanager from './secretsmanager.generated'; diff --git a/packages/@aws-cdk/aws-secretsmanager/package.json b/packages/@aws-cdk/aws-secretsmanager/package.json index ca00bf77825cb..9d8e553c6cb8e 100644 --- a/packages/@aws-cdk/aws-secretsmanager/package.json +++ b/packages/@aws-cdk/aws-secretsmanager/package.json @@ -78,7 +78,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-sam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/aws-ec2": "0.0.0", @@ -87,7 +87,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-sam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 f9fc70cdd1aa2..0a8bb60d3fa67 100644 --- a/packages/@aws-cdk/aws-securityhub/package.json +++ b/packages/@aws-cdk/aws-securityhub/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 83618ad430988..d2d5f050ace89 100644 --- a/packages/@aws-cdk/aws-servicecatalog/package.json +++ b/packages/@aws-cdk/aws-servicecatalog/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-servicediscovery/lib/alias-target-instance.ts b/packages/@aws-cdk/aws-servicediscovery/lib/alias-target-instance.ts index 2e9eb90f105d6..a8302b5e1dbc9 100644 --- a/packages/@aws-cdk/aws-servicediscovery/lib/alias-target-instance.ts +++ b/packages/@aws-cdk/aws-servicediscovery/lib/alias-target-instance.ts @@ -1,4 +1,4 @@ -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { BaseInstanceProps, InstanceBase } from './instance'; import { NamespaceType } from './namespace'; import { DnsRecordType, IService, RoutingPolicy } from './service'; @@ -41,7 +41,7 @@ export class AliasTargetInstance extends InstanceBase { */ public readonly dnsName: string; - constructor(scope: cdk.Construct, id: string, props: AliasTargetInstanceProps) { + constructor(scope: Construct, id: string, props: AliasTargetInstanceProps) { super(scope, id); if (props.service.namespace.type === NamespaceType.HTTP) { diff --git a/packages/@aws-cdk/aws-servicediscovery/lib/cname-instance.ts b/packages/@aws-cdk/aws-servicediscovery/lib/cname-instance.ts index 0810d4f6489c8..6d948119a4e73 100644 --- a/packages/@aws-cdk/aws-servicediscovery/lib/cname-instance.ts +++ b/packages/@aws-cdk/aws-servicediscovery/lib/cname-instance.ts @@ -1,4 +1,4 @@ -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { BaseInstanceProps, InstanceBase } from './instance'; import { NamespaceType } from './namespace'; import { DnsRecordType, IService } from './service'; @@ -46,7 +46,7 @@ export class CnameInstance extends InstanceBase { */ public readonly cname: string; - constructor(scope: cdk.Construct, id: string, props: CnameInstanceProps) { + constructor(scope: Construct, id: string, props: CnameInstanceProps) { super(scope, id); if (props.service.namespace.type === NamespaceType.HTTP) { diff --git a/packages/@aws-cdk/aws-servicediscovery/lib/http-namespace.ts b/packages/@aws-cdk/aws-servicediscovery/lib/http-namespace.ts index bcb50a3961892..6b614f3f0bfa7 100644 --- a/packages/@aws-cdk/aws-servicediscovery/lib/http-namespace.ts +++ b/packages/@aws-cdk/aws-servicediscovery/lib/http-namespace.ts @@ -1,4 +1,5 @@ -import { Construct, Resource } from '@aws-cdk/core'; +import { Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { BaseNamespaceProps, INamespace, NamespaceType } from './namespace'; import { BaseServiceProps, Service } from './service'; import { CfnHttpNamespace } from './servicediscovery.generated'; diff --git a/packages/@aws-cdk/aws-servicediscovery/lib/ip-instance.ts b/packages/@aws-cdk/aws-servicediscovery/lib/ip-instance.ts index 85bf49bc896f9..e635fca07cee4 100644 --- a/packages/@aws-cdk/aws-servicediscovery/lib/ip-instance.ts +++ b/packages/@aws-cdk/aws-servicediscovery/lib/ip-instance.ts @@ -1,4 +1,4 @@ -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { BaseInstanceProps, InstanceBase } from './instance'; import { DnsRecordType, IService } from './service'; import { CfnInstance } from './servicediscovery.generated'; @@ -74,7 +74,7 @@ export class IpInstance extends InstanceBase { */ public readonly port: number; - constructor(scope: cdk.Construct, id: string, props: IpInstanceProps) { + constructor(scope: Construct, id: string, props: IpInstanceProps) { super(scope, id); const dnsRecordType = props.service.dnsRecordType; diff --git a/packages/@aws-cdk/aws-servicediscovery/lib/non-ip-instance.ts b/packages/@aws-cdk/aws-servicediscovery/lib/non-ip-instance.ts index 99d6714dba64b..01fe0367e186e 100644 --- a/packages/@aws-cdk/aws-servicediscovery/lib/non-ip-instance.ts +++ b/packages/@aws-cdk/aws-servicediscovery/lib/non-ip-instance.ts @@ -1,4 +1,4 @@ -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { BaseInstanceProps, InstanceBase } from './instance'; import { NamespaceType } from './namespace'; import { IService } from './service'; @@ -35,7 +35,7 @@ export class NonIpInstance extends InstanceBase { */ public readonly service: IService; - constructor(scope: cdk.Construct, id: string, props: NonIpInstanceProps) { + constructor(scope: Construct, id: string, props: NonIpInstanceProps) { super(scope, id); if (props.service.namespace.type !== NamespaceType.HTTP) { diff --git a/packages/@aws-cdk/aws-servicediscovery/lib/private-dns-namespace.ts b/packages/@aws-cdk/aws-servicediscovery/lib/private-dns-namespace.ts index 1186bcda57e0e..c5b8332c3238c 100644 --- a/packages/@aws-cdk/aws-servicediscovery/lib/private-dns-namespace.ts +++ b/packages/@aws-cdk/aws-servicediscovery/lib/private-dns-namespace.ts @@ -1,5 +1,6 @@ import * as ec2 from '@aws-cdk/aws-ec2'; -import { Construct, Resource } from '@aws-cdk/core'; +import { Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { BaseNamespaceProps, INamespace, NamespaceType } from './namespace'; import { DnsServiceProps, Service } from './service'; import { CfnPrivateDnsNamespace } from './servicediscovery.generated'; diff --git a/packages/@aws-cdk/aws-servicediscovery/lib/public-dns-namespace.ts b/packages/@aws-cdk/aws-servicediscovery/lib/public-dns-namespace.ts index fdd9f1fdde570..431befda4c22d 100644 --- a/packages/@aws-cdk/aws-servicediscovery/lib/public-dns-namespace.ts +++ b/packages/@aws-cdk/aws-servicediscovery/lib/public-dns-namespace.ts @@ -1,4 +1,5 @@ -import { Construct, Resource } from '@aws-cdk/core'; +import { Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { BaseNamespaceProps, INamespace, NamespaceType } from './namespace'; import { DnsServiceProps, Service } from './service'; import { CfnPublicDnsNamespace } from './servicediscovery.generated'; diff --git a/packages/@aws-cdk/aws-servicediscovery/lib/service.ts b/packages/@aws-cdk/aws-servicediscovery/lib/service.ts index c41625bf68a7e..6c4225025588c 100644 --- a/packages/@aws-cdk/aws-servicediscovery/lib/service.ts +++ b/packages/@aws-cdk/aws-servicediscovery/lib/service.ts @@ -1,5 +1,6 @@ import * as elbv2 from '@aws-cdk/aws-elasticloadbalancingv2'; -import { Construct, Duration, IResource, Resource } from '@aws-cdk/core'; +import { Duration, IResource, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { AliasTargetInstance } from './alias-target-instance'; import { CnameInstance, CnameInstanceBaseProps } from './cname-instance'; import { IInstance } from './instance'; diff --git a/packages/@aws-cdk/aws-servicediscovery/package.json b/packages/@aws-cdk/aws-servicediscovery/package.json index 78c05ec3aeac1..1395974e5a8ba 100644 --- a/packages/@aws-cdk/aws-servicediscovery/package.json +++ b/packages/@aws-cdk/aws-servicediscovery/package.json @@ -78,7 +78,7 @@ "@aws-cdk/aws-elasticloadbalancingv2": "0.0.0", "@aws-cdk/aws-route53": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -86,7 +86,7 @@ "@aws-cdk/aws-elasticloadbalancingv2": "0.0.0", "@aws-cdk/aws-route53": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 98ceb9b2cd0b6..8939e3070fc43 100644 --- a/packages/@aws-cdk/aws-ses-actions/package.json +++ b/packages/@aws-cdk/aws-ses-actions/package.json @@ -74,7 +74,7 @@ "@aws-cdk/aws-ses": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -85,7 +85,7 @@ "@aws-cdk/aws-ses": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 a4ecde334eaab..5112ed881486b 100644 --- a/packages/@aws-cdk/aws-ses/lib/receipt-filter.ts +++ b/packages/@aws-cdk/aws-ses/lib/receipt-filter.ts @@ -1,4 +1,5 @@ -import { Construct, Resource } from '@aws-cdk/core'; +import { Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnReceiptFilter } from './ses.generated'; /** diff --git a/packages/@aws-cdk/aws-ses/lib/receipt-rule-set.ts b/packages/@aws-cdk/aws-ses/lib/receipt-rule-set.ts index e712eace12dd9..c94d4d4edd138 100644 --- a/packages/@aws-cdk/aws-ses/lib/receipt-rule-set.ts +++ b/packages/@aws-cdk/aws-ses/lib/receipt-rule-set.ts @@ -1,4 +1,5 @@ -import { Construct, IResource, Resource } from '@aws-cdk/core'; +import { IResource, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { DropSpamReceiptRule, ReceiptRule, ReceiptRuleOptions } from './receipt-rule'; import { CfnReceiptRuleSet } from './ses.generated'; diff --git a/packages/@aws-cdk/aws-ses/lib/receipt-rule.ts b/packages/@aws-cdk/aws-ses/lib/receipt-rule.ts index 55bf25bb3983a..a43c2fc8310a2 100644 --- a/packages/@aws-cdk/aws-ses/lib/receipt-rule.ts +++ b/packages/@aws-cdk/aws-ses/lib/receipt-rule.ts @@ -1,6 +1,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as lambda from '@aws-cdk/aws-lambda'; -import { Aws, Construct, IResource, Lazy, Resource } from '@aws-cdk/core'; +import { Aws, IResource, Lazy, Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { IReceiptRuleAction } from './receipt-rule-action'; import { IReceiptRuleSet } from './receipt-rule-set'; import { CfnReceiptRule } from './ses.generated'; diff --git a/packages/@aws-cdk/aws-ses/package.json b/packages/@aws-cdk/aws-ses/package.json index 69a866c63e23f..bd26613d0ec73 100644 --- a/packages/@aws-cdk/aws-ses/package.json +++ b/packages/@aws-cdk/aws-ses/package.json @@ -74,14 +74,14 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-sns-subscriptions/lib/lambda.ts b/packages/@aws-cdk/aws-sns-subscriptions/lib/lambda.ts index 943813184ed1f..d4b552674198f 100644 --- a/packages/@aws-cdk/aws-sns-subscriptions/lib/lambda.ts +++ b/packages/@aws-cdk/aws-sns-subscriptions/lib/lambda.ts @@ -1,7 +1,8 @@ import * as iam from '@aws-cdk/aws-iam'; import * as lambda from '@aws-cdk/aws-lambda'; import * as sns from '@aws-cdk/aws-sns'; -import { Construct, Stack } from '@aws-cdk/core'; +import { Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { SubscriptionProps } from './subscription'; /** @@ -23,7 +24,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 39c8362d60c4f..791fcefbd19c8 100644 --- a/packages/@aws-cdk/aws-sns-subscriptions/lib/sqs.ts +++ b/packages/@aws-cdk/aws-sns-subscriptions/lib/sqs.ts @@ -1,7 +1,8 @@ import * as iam from '@aws-cdk/aws-iam'; import * as sns from '@aws-cdk/aws-sns'; import * as sqs from '@aws-cdk/aws-sqs'; -import { Construct, Stack } from '@aws-cdk/core'; +import { Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { SubscriptionProps } from './subscription'; /** @@ -31,7 +32,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 13535b66faf0a..5332297286bfc 100644 --- a/packages/@aws-cdk/aws-sns-subscriptions/package.json +++ b/packages/@aws-cdk/aws-sns-subscriptions/package.json @@ -71,7 +71,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -80,7 +80,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-sns/lib/policy.ts b/packages/@aws-cdk/aws-sns/lib/policy.ts index 60aec85b13b8c..7d93d863a75f0 100644 --- a/packages/@aws-cdk/aws-sns/lib/policy.ts +++ b/packages/@aws-cdk/aws-sns/lib/policy.ts @@ -1,5 +1,6 @@ import { PolicyDocument } from '@aws-cdk/aws-iam'; -import { Construct, Resource } from '@aws-cdk/core'; +import { Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnTopicPolicy } from './sns.generated'; import { ITopic } from './topic-base'; diff --git a/packages/@aws-cdk/aws-sns/lib/subscriber.ts b/packages/@aws-cdk/aws-sns/lib/subscriber.ts index edfd3632d415a..a52ee834cab11 100644 --- a/packages/@aws-cdk/aws-sns/lib/subscriber.ts +++ b/packages/@aws-cdk/aws-sns/lib/subscriber.ts @@ -1,4 +1,4 @@ -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { SubscriptionOptions } from './subscription'; import { ITopic } from './topic-base'; diff --git a/packages/@aws-cdk/aws-sns/lib/subscription.ts b/packages/@aws-cdk/aws-sns/lib/subscription.ts index 9955260ef4797..88817b6db6fdd 100644 --- a/packages/@aws-cdk/aws-sns/lib/subscription.ts +++ b/packages/@aws-cdk/aws-sns/lib/subscription.ts @@ -1,6 +1,7 @@ import { PolicyStatement, ServicePrincipal } from '@aws-cdk/aws-iam'; import { IQueue } from '@aws-cdk/aws-sqs'; -import { Construct, Resource } from '@aws-cdk/core'; +import { Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnSubscription } from './sns.generated'; import { SubscriptionFilter } from './subscription-filter'; import { ITopic } from './topic-base'; diff --git a/packages/@aws-cdk/aws-sns/lib/topic-base.ts b/packages/@aws-cdk/aws-sns/lib/topic-base.ts index 263f4cf80aefa..e052403ecb90b 100644 --- a/packages/@aws-cdk/aws-sns/lib/topic-base.ts +++ b/packages/@aws-cdk/aws-sns/lib/topic-base.ts @@ -1,5 +1,6 @@ import * as iam from '@aws-cdk/aws-iam'; -import { Construct, IResource, Resource, Token } from '@aws-cdk/core'; +import { IResource, Resource, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { TopicPolicy } from './policy'; import { ITopicSubscription } from './subscriber'; import { Subscription } from './subscription'; diff --git a/packages/@aws-cdk/aws-sns/lib/topic.ts b/packages/@aws-cdk/aws-sns/lib/topic.ts index 33f0e36cc0cf0..e27c936291048 100644 --- a/packages/@aws-cdk/aws-sns/lib/topic.ts +++ b/packages/@aws-cdk/aws-sns/lib/topic.ts @@ -1,5 +1,6 @@ import { IKey } from '@aws-cdk/aws-kms'; -import { Construct, Stack } from '@aws-cdk/core'; +import { Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnTopic } from './sns.generated'; import { ITopic, TopicBase } from './topic-base'; diff --git a/packages/@aws-cdk/aws-sns/package.json b/packages/@aws-cdk/aws-sns/package.json index edb4014d52f52..3bae1d52ee263 100644 --- a/packages/@aws-cdk/aws-sns/package.json +++ b/packages/@aws-cdk/aws-sns/package.json @@ -81,7 +81,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -91,7 +91,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-sqs/lib/policy.ts b/packages/@aws-cdk/aws-sqs/lib/policy.ts index 41aa3e8de7f7f..c5d323bf60c63 100644 --- a/packages/@aws-cdk/aws-sqs/lib/policy.ts +++ b/packages/@aws-cdk/aws-sqs/lib/policy.ts @@ -1,5 +1,6 @@ import { PolicyDocument } from '@aws-cdk/aws-iam'; -import { Construct, Resource } from '@aws-cdk/core'; +import { Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { IQueue } from './queue-base'; import { CfnQueuePolicy } from './sqs.generated'; diff --git a/packages/@aws-cdk/aws-sqs/lib/queue.ts b/packages/@aws-cdk/aws-sqs/lib/queue.ts index d335da2c9120f..2d95f60f4748e 100644 --- a/packages/@aws-cdk/aws-sqs/lib/queue.ts +++ b/packages/@aws-cdk/aws-sqs/lib/queue.ts @@ -1,5 +1,6 @@ import * as kms from '@aws-cdk/aws-kms'; -import { Construct, Duration, Stack, Token } from '@aws-cdk/core'; +import { Duration, Stack, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { IQueue, QueueAttributes, QueueBase } from './queue-base'; import { CfnQueue } from './sqs.generated'; import { validateProps } from './validate-props'; diff --git a/packages/@aws-cdk/aws-sqs/package.json b/packages/@aws-cdk/aws-sqs/package.json index 0fbba9faa25f9..e450ff387a4f4 100644 --- a/packages/@aws-cdk/aws-sqs/package.json +++ b/packages/@aws-cdk/aws-sqs/package.json @@ -77,7 +77,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -85,7 +85,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 bc73278bfc267..8c409a9bcee5f 100644 --- a/packages/@aws-cdk/aws-ssm/lib/parameter.ts +++ b/packages/@aws-cdk/aws-ssm/lib/parameter.ts @@ -3,8 +3,9 @@ import * as kms from '@aws-cdk/aws-kms'; import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import { CfnDynamicReference, CfnDynamicReferenceService, CfnParameter, - Construct, 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'; import { arnForParameterName, AUTOGEN_MARKER } from './util'; diff --git a/packages/@aws-cdk/aws-ssm/lib/util.ts b/packages/@aws-cdk/aws-ssm/lib/util.ts index 05d42ada96690..d023ef902282d 100644 --- a/packages/@aws-cdk/aws-ssm/lib/util.ts +++ b/packages/@aws-cdk/aws-ssm/lib/util.ts @@ -1,4 +1,5 @@ -import { IConstruct, Stack, Token } from '@aws-cdk/core'; +import { Stack, Token } from '@aws-cdk/core'; +import { IConstruct } from 'constructs'; export const AUTOGEN_MARKER = '$$autogen$$'; diff --git a/packages/@aws-cdk/aws-ssm/package.json b/packages/@aws-cdk/aws-ssm/package.json index 2758e7b15bd10..29994e587a5d3 100644 --- a/packages/@aws-cdk/aws-ssm/package.json +++ b/packages/@aws-cdk/aws-ssm/package.json @@ -75,7 +75,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -83,7 +83,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/batch/submit-job.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/batch/submit-job.ts index c376a4ce91d26..d0b67efea9375 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/batch/submit-job.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/batch/submit-job.ts @@ -2,7 +2,8 @@ import * as batch from '@aws-cdk/aws-batch'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import * as sfn from '@aws-cdk/aws-stepfunctions'; -import { Construct, Size, Stack, withResolved } from '@aws-cdk/core'; +import { Size, Stack, withResolved } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { integrationResourceArn, validatePatternSupported } from '../private/task-utils'; /** diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/dynamodb/delete-item.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/dynamodb/delete-item.ts index f79c40d46f964..a90d6477c4456 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/dynamodb/delete-item.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/dynamodb/delete-item.ts @@ -1,7 +1,8 @@ import * as ddb from '@aws-cdk/aws-dynamodb'; import * as iam from '@aws-cdk/aws-iam'; import * as sfn from '@aws-cdk/aws-stepfunctions'; -import { Construct, Stack } from '@aws-cdk/core'; +import { Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { DynamoMethod, getDynamoResourceArn, transformAttributeValueMap } from './private/utils'; import { DynamoAttributeValue, DynamoConsumedCapacity, DynamoItemCollectionMetrics, DynamoReturnValues } from './shared-types'; diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/dynamodb/get-item.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/dynamodb/get-item.ts index ac361b8c9cb1b..a5d8c07e2e5cf 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/dynamodb/get-item.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/dynamodb/get-item.ts @@ -1,7 +1,8 @@ import * as ddb from '@aws-cdk/aws-dynamodb'; import * as iam from '@aws-cdk/aws-iam'; import * as sfn from '@aws-cdk/aws-stepfunctions'; -import { Construct, Stack } from '@aws-cdk/core'; +import { Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { DynamoMethod, getDynamoResourceArn, transformAttributeValueMap } from './private/utils'; import { DynamoAttributeValue, DynamoConsumedCapacity, DynamoProjectionExpression } from './shared-types'; diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/dynamodb/put-item.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/dynamodb/put-item.ts index 4d238765f2247..9399667194027 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/dynamodb/put-item.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/dynamodb/put-item.ts @@ -1,7 +1,8 @@ import * as ddb from '@aws-cdk/aws-dynamodb'; import * as iam from '@aws-cdk/aws-iam'; import * as sfn from '@aws-cdk/aws-stepfunctions'; -import { Construct, Stack } from '@aws-cdk/core'; +import { Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { DynamoMethod, getDynamoResourceArn, transformAttributeValueMap } from './private/utils'; import { DynamoAttributeValue, DynamoConsumedCapacity, DynamoItemCollectionMetrics, DynamoReturnValues } from './shared-types'; diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/dynamodb/update-item.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/dynamodb/update-item.ts index 5e5f871737221..2025f1b5e259b 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/dynamodb/update-item.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/dynamodb/update-item.ts @@ -1,7 +1,8 @@ import * as ddb from '@aws-cdk/aws-dynamodb'; import * as iam from '@aws-cdk/aws-iam'; import * as sfn from '@aws-cdk/aws-stepfunctions'; -import { Construct, Stack } from '@aws-cdk/core'; +import { Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { DynamoMethod, getDynamoResourceArn, transformAttributeValueMap } from './private/utils'; import { DynamoAttributeValue, DynamoConsumedCapacity, DynamoItemCollectionMetrics, DynamoReturnValues } from './shared-types'; diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/ecs/run-task.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/ecs/run-task.ts index d06d204641653..b3cffae4cbf8d 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/ecs/run-task.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/ecs/run-task.ts @@ -3,6 +3,7 @@ import * as ecs from '@aws-cdk/aws-ecs'; import * as iam from '@aws-cdk/aws-iam'; import * as sfn from '@aws-cdk/aws-stepfunctions'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ContainerOverride } from '..'; import { integrationResourceArn, validatePatternSupported } from '../private/task-utils'; @@ -235,7 +236,7 @@ export class EcsRunTask extends sfn.TaskStateBase implements ec2.IConnectable { private networkConfiguration?: any; private readonly integrationPattern: sfn.IntegrationPattern; - constructor(scope: cdk.Construct, id: string, private readonly props: EcsRunTaskProps) { + constructor(scope: Construct, id: string, private readonly props: EcsRunTaskProps) { super(scope, id, props); this.integrationPattern = props.integrationPattern ?? sfn.IntegrationPattern.REQUEST_RESPONSE; diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/emr/emr-add-step.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/emr/emr-add-step.ts index a745bfccd6205..2d1c027315ff7 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/emr/emr-add-step.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/emr/emr-add-step.ts @@ -1,6 +1,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as sfn from '@aws-cdk/aws-stepfunctions'; -import { Aws, Construct, Stack } from '@aws-cdk/core'; +import { Aws, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { integrationResourceArn, validatePatternSupported } from '../private/task-utils'; /** diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/emr/emr-cancel-step.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/emr/emr-cancel-step.ts index bf14e86085118..3a4215ab61bac 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/emr/emr-cancel-step.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/emr/emr-cancel-step.ts @@ -1,6 +1,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as sfn from '@aws-cdk/aws-stepfunctions'; -import { Aws, Construct } from '@aws-cdk/core'; +import { Aws } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { integrationResourceArn } from '../private/task-utils'; /** diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/emr/emr-create-cluster.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/emr/emr-create-cluster.ts index e291448e92019..4b3ecd5ca0013 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/emr/emr-create-cluster.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/emr/emr-create-cluster.ts @@ -1,6 +1,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as sfn from '@aws-cdk/aws-stepfunctions'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { integrationResourceArn, validatePatternSupported } from '../private/task-utils'; import { ApplicationConfigPropertyToJson, @@ -170,7 +171,7 @@ export class EmrCreateCluster extends sfn.TaskStateBase { private _clusterRole: iam.IRole; private _autoScalingRole?: iam.IRole; - constructor(scope: cdk.Construct, id: string, private readonly props: EmrCreateClusterProps) { + constructor(scope: Construct, id: string, private readonly props: EmrCreateClusterProps) { super(scope, id, props); this.visibleToAllUsers = this.props.visibleToAllUsers !== undefined ? this.props.visibleToAllUsers : true; this.integrationPattern = props.integrationPattern || sfn.IntegrationPattern.RUN_JOB; diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/emr/emr-modify-instance-fleet-by-name.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/emr/emr-modify-instance-fleet-by-name.ts index d4ed7436adba7..0e5e5c54c0b5f 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/emr/emr-modify-instance-fleet-by-name.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/emr/emr-modify-instance-fleet-by-name.ts @@ -1,6 +1,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as sfn from '@aws-cdk/aws-stepfunctions'; -import { Aws, Construct } from '@aws-cdk/core'; +import { Aws } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { integrationResourceArn } from '../private/task-utils'; /** diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/emr/emr-modify-instance-group-by-name.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/emr/emr-modify-instance-group-by-name.ts index 805f59dc52518..2b680f145c426 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/emr/emr-modify-instance-group-by-name.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/emr/emr-modify-instance-group-by-name.ts @@ -1,6 +1,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as sfn from '@aws-cdk/aws-stepfunctions'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { integrationResourceArn } from '../private/task-utils'; import { EmrCreateCluster } from './emr-create-cluster'; import { InstanceGroupModifyConfigPropertyToJson } from './private/cluster-utils'; @@ -40,7 +41,7 @@ export class EmrModifyInstanceGroupByName extends sfn.TaskStateBase { protected readonly taskPolicies?: iam.PolicyStatement[]; protected readonly taskMetrics?: sfn.TaskMetricsConfig; - constructor(scope: cdk.Construct, id: string, private readonly props: EmrModifyInstanceGroupByNameProps) { + constructor(scope: Construct, id: string, private readonly props: EmrModifyInstanceGroupByNameProps) { super(scope, id, props); this.taskPolicies = [ new iam.PolicyStatement({ diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/emr/emr-set-cluster-termination-protection.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/emr/emr-set-cluster-termination-protection.ts index ff983869b8b67..67d10bea4415d 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/emr/emr-set-cluster-termination-protection.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/emr/emr-set-cluster-termination-protection.ts @@ -1,6 +1,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as sfn from '@aws-cdk/aws-stepfunctions'; -import { Aws, Construct } from '@aws-cdk/core'; +import { Aws } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { integrationResourceArn } from '../private/task-utils'; /** diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/emr/emr-terminate-cluster.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/emr/emr-terminate-cluster.ts index 9e23ee1bdc8b1..3aadd8753a48a 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/emr/emr-terminate-cluster.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/emr/emr-terminate-cluster.ts @@ -1,6 +1,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as sfn from '@aws-cdk/aws-stepfunctions'; -import { Aws, Construct, Stack } from '@aws-cdk/core'; +import { Aws, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { integrationResourceArn, validatePatternSupported } from '../private/task-utils'; /** diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/evaluate-expression.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/evaluate-expression.ts index e07da1a16493b..fe7f9df263164 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/evaluate-expression.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/evaluate-expression.ts @@ -1,7 +1,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as lambda from '@aws-cdk/aws-lambda'; import * as sfn from '@aws-cdk/aws-stepfunctions'; -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as path from 'path'; /** @@ -55,7 +55,7 @@ export class EvaluateExpression extends sfn.TaskStateBase { private readonly evalFn: lambda.SingletonFunction; - constructor(scope: cdk.Construct, id: string, private readonly props: EvaluateExpressionProps) { + constructor(scope: Construct, id: string, private readonly props: EvaluateExpressionProps) { super(scope, id, props); this.evalFn = createEvalFn(this.props.runtime || lambda.Runtime.NODEJS_10_X, this); @@ -96,7 +96,7 @@ export class EvaluateExpression extends sfn.TaskStateBase { } } -function createEvalFn(runtime: lambda.Runtime, scope: cdk.Construct) { +function createEvalFn(runtime: lambda.Runtime, scope: Construct) { const code = lambda.Code.asset(path.join(__dirname, `eval-${runtime.name}-handler`)); const lambdaPurpose = 'Eval'; diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/glue/start-job-run.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/glue/start-job-run.ts index 0618e413ccb9e..90b79b5fc135e 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/glue/start-job-run.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/glue/start-job-run.ts @@ -1,6 +1,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as sfn from '@aws-cdk/aws-stepfunctions'; -import { Construct, Duration, Stack } from '@aws-cdk/core'; +import { Duration, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { integrationResourceArn, validatePatternSupported } from '../private/task-utils'; /** diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/lambda/invoke.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/lambda/invoke.ts index 90ac0c2f0ab33..90927150842ac 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/lambda/invoke.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/lambda/invoke.ts @@ -1,7 +1,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as lambda from '@aws-cdk/aws-lambda'; import * as sfn from '@aws-cdk/aws-stepfunctions'; -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { integrationResourceArn, validatePatternSupported } from '../private/task-utils'; /** @@ -65,7 +65,7 @@ export class LambdaInvoke extends sfn.TaskStateBase { private readonly integrationPattern: sfn.IntegrationPattern; - constructor(scope: cdk.Construct, id: string, private readonly props: LambdaInvokeProps) { + constructor(scope: Construct, id: string, private readonly props: LambdaInvokeProps) { super(scope, id, props); this.integrationPattern = props.integrationPattern ?? sfn.IntegrationPattern.REQUEST_RESPONSE; diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker/base-types.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker/base-types.ts index f701f9e20d6e9..e8b6e3a8d0c00 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker/base-types.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker/base-types.ts @@ -5,7 +5,8 @@ import * as iam from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; import * as s3 from '@aws-cdk/aws-s3'; import * as sfn from '@aws-cdk/aws-stepfunctions'; -import { Construct, Duration, Size } from '@aws-cdk/core'; +import { Duration, Size } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Task to train a machine learning model using Amazon SageMaker diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker/create-training-job.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker/create-training-job.ts index f8b4c73d00320..7384361fd0e61 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker/create-training-job.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker/create-training-job.ts @@ -1,7 +1,8 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import * as sfn from '@aws-cdk/aws-stepfunctions'; -import { Construct, Duration, Lazy, Size, Stack } from '@aws-cdk/core'; +import { Duration, Lazy, Size, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { integrationResourceArn, validatePatternSupported } from '../private/task-utils'; import { AlgorithmSpecification, Channel, InputMode, OutputDataConfig, ResourceConfig, S3DataType, StoppingCondition, VpcConfig } from './base-types'; diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker/create-transform-job.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker/create-transform-job.ts index b9bdcbf940d3d..5252b92e77000 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker/create-transform-job.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker/create-transform-job.ts @@ -1,7 +1,8 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import * as sfn from '@aws-cdk/aws-stepfunctions'; -import { Construct, Size, Stack } from '@aws-cdk/core'; +import { Size, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { integrationResourceArn, validatePatternSupported } from '../private/task-utils'; import { BatchStrategy, S3DataType, TransformInput, TransformOutput, TransformResources } from './base-types'; diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sns/publish.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sns/publish.ts index 051b217b6d042..16f10051f0531 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sns/publish.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sns/publish.ts @@ -1,7 +1,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as sns from '@aws-cdk/aws-sns'; import * as sfn from '@aws-cdk/aws-stepfunctions'; -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { integrationResourceArn, validatePatternSupported } from '../private/task-utils'; /** @@ -65,7 +65,7 @@ export class SnsPublish extends sfn.TaskStateBase { private readonly integrationPattern: sfn.IntegrationPattern; - constructor(scope: cdk.Construct, id: string, private readonly props: SnsPublishProps) { + constructor(scope: Construct, id: string, private readonly props: SnsPublishProps) { super(scope, id, props); this.integrationPattern = props.integrationPattern ?? sfn.IntegrationPattern.REQUEST_RESPONSE; diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sqs/send-message.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sqs/send-message.ts index e1a2ae6d5118e..3a2db5d9e7134 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sqs/send-message.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sqs/send-message.ts @@ -2,6 +2,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as sqs from '@aws-cdk/aws-sqs'; import * as sfn from '@aws-cdk/aws-stepfunctions'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { integrationResourceArn, validatePatternSupported } from '../private/task-utils'; /** @@ -65,7 +66,7 @@ export class SqsSendMessage extends sfn.TaskStateBase { private readonly integrationPattern: sfn.IntegrationPattern; - constructor(scope: cdk.Construct, id: string, private readonly props: SqsSendMessageProps) { + constructor(scope: Construct, id: string, private readonly props: SqsSendMessageProps) { super(scope, id, props); this.integrationPattern = props.integrationPattern ?? sfn.IntegrationPattern.REQUEST_RESPONSE; diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/stepfunctions/start-execution.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/stepfunctions/start-execution.ts index 405e3be6a74fc..16e64fcc9cd54 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/stepfunctions/start-execution.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/stepfunctions/start-execution.ts @@ -1,6 +1,7 @@ import * as iam from '@aws-cdk/aws-iam'; import * as sfn from '@aws-cdk/aws-stepfunctions'; -import { Construct, Stack } from '@aws-cdk/core'; +import { Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { integrationResourceArn, validatePatternSupported } from '../private/task-utils'; /** diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/package.json b/packages/@aws-cdk/aws-stepfunctions-tasks/package.json index f2dcbba5acc77..e1cd6afb30bf6 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/package.json +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/package.json @@ -85,7 +85,7 @@ "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/aws-stepfunctions": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -106,7 +106,7 @@ "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/aws-stepfunctions": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/integ.start-execution.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/test/integ.start-execution.ts index 865e42e9033c5..31f0f08f54e89 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/integ.start-execution.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/integ.start-execution.ts @@ -1,5 +1,6 @@ import * as sfn from '@aws-cdk/aws-stepfunctions'; -import { App, CfnOutput, Construct, Stack } from '@aws-cdk/core'; +import { App, CfnOutput, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as tasks from '../lib'; /* diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/stepfunctions/integ.start-execution.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/test/stepfunctions/integ.start-execution.ts index f103d41da4a7c..b0582cee76ce4 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/stepfunctions/integ.start-execution.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/stepfunctions/integ.start-execution.ts @@ -1,5 +1,6 @@ import * as sfn from '@aws-cdk/aws-stepfunctions'; -import { App, CfnOutput, Construct, Stack } from '@aws-cdk/core'; +import { App, CfnOutput, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { StepFunctionsStartExecution } from '../../lib/stepfunctions/start-execution'; /* diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/activity.ts b/packages/@aws-cdk/aws-stepfunctions/lib/activity.ts index ef97f45e6f8b3..e40673730b1cf 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/activity.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/activity.ts @@ -1,6 +1,7 @@ import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; import * as iam from '@aws-cdk/aws-iam'; -import { Construct, IResource, Lazy, Resource, Stack } from '@aws-cdk/core'; +import { IResource, Lazy, Resource, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnActivity } from './stepfunctions.generated'; /** 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 929aed5b22219..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,4 +1,4 @@ -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Chain } from './chain'; import { Parallel, ParallelProps } from './states/parallel'; import { State } from './states/state'; @@ -7,7 +7,7 @@ import { IChainable, INextable } from './types'; /** * Base class for reusable state machine fragments */ -export abstract class StateMachineFragment extends cdk.Construct implements IChainable { +export abstract class StateMachineFragment extends Construct implements IChainable { /** * The start state of this state machine fragment */ diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/state-machine.ts b/packages/@aws-cdk/aws-stepfunctions/lib/state-machine.ts index a6632a7e5d35d..9410adfd6fd84 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/state-machine.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/state-machine.ts @@ -1,7 +1,8 @@ import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; import * as iam from '@aws-cdk/aws-iam'; import * as logs from '@aws-cdk/aws-logs'; -import { Arn, Construct, Duration, IResource, Resource, Stack } from '@aws-cdk/core'; +import { Arn, Duration, IResource, Resource, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { StateGraph } from './state-graph'; import { CfnStateMachine } from './stepfunctions.generated'; import { IChainable } from './types'; diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/states/choice.ts b/packages/@aws-cdk/aws-stepfunctions/lib/states/choice.ts index df72fb16459ec..e2b3422d227be 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/states/choice.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/states/choice.ts @@ -1,4 +1,4 @@ -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Chain } from '../chain'; import { Condition } from '../condition'; import { IChainable, INextable } from '../types'; @@ -46,7 +46,7 @@ export interface ChoiceProps { export class Choice extends State { public readonly endStates: INextable[] = []; - constructor(scope: cdk.Construct, id: string, props: ChoiceProps = {}) { + constructor(scope: Construct, id: string, props: ChoiceProps = {}) { super(scope, id, props); } diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/states/custom-state.ts b/packages/@aws-cdk/aws-stepfunctions/lib/states/custom-state.ts index 005945a4ad20b..eccfad6e9bcc1 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/states/custom-state.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/states/custom-state.ts @@ -1,4 +1,4 @@ -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Chain } from '..'; import { IChainable, INextable } from '../types'; import { State } from './state'; @@ -28,7 +28,7 @@ export class CustomState extends State implements IChainable, INextable { */ private readonly stateJson: { [key: string]: any}; - constructor(scope: cdk.Construct, id: string, props: CustomStateProps) { + constructor(scope: Construct, id: string, props: CustomStateProps) { super(scope, id, {}); this.endStates = [this]; diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/states/fail.ts b/packages/@aws-cdk/aws-stepfunctions/lib/states/fail.ts index 2f900e935bb62..f7b8e6b10e609 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/states/fail.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/states/fail.ts @@ -1,4 +1,4 @@ -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { INextable } from '../types'; import { StateType } from './private/state-type'; import { State } from './state'; @@ -40,7 +40,7 @@ export class Fail extends State { private readonly error?: string; private readonly cause?: string; - constructor(scope: cdk.Construct, id: string, props: FailProps = {}) { + constructor(scope: Construct, id: string, props: FailProps = {}) { super(scope, id, props); this.error = props.error; diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/states/map.ts b/packages/@aws-cdk/aws-stepfunctions/lib/states/map.ts index 14d65ccdc541a..1f2763e3f99f7 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/states/map.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/states/map.ts @@ -1,4 +1,4 @@ -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Chain } from '../chain'; import { StateGraph } from '../state-graph'; import { CatchProps, IChainable, INextable, RetryProps } from '../types'; @@ -100,7 +100,7 @@ export class Map extends State implements INextable { private readonly maxConcurrency: number | undefined; private readonly itemsPath?: string; - constructor(scope: cdk.Construct, id: string, props: MapProps = {}) { + constructor(scope: Construct, id: string, props: MapProps = {}) { super(scope, id, props); this.endStates = [this]; this.maxConcurrency = props.maxConcurrency; diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/states/parallel.ts b/packages/@aws-cdk/aws-stepfunctions/lib/states/parallel.ts index 4bce7313377cf..70ac5819a6888 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/states/parallel.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/states/parallel.ts @@ -1,4 +1,4 @@ -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Chain } from '../chain'; import { StateGraph } from '../state-graph'; import { CatchProps, IChainable, INextable, RetryProps } from '../types'; @@ -58,7 +58,7 @@ export interface ParallelProps { export class Parallel extends State implements INextable { public readonly endStates: INextable[]; - constructor(scope: cdk.Construct, id: string, props: ParallelProps = {}) { + constructor(scope: Construct, id: string, props: ParallelProps = {}) { super(scope, id, props); this.endStates = [this]; diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/states/pass.ts b/packages/@aws-cdk/aws-stepfunctions/lib/states/pass.ts index 6d98608853b68..de9b4d16aab01 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/states/pass.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/states/pass.ts @@ -1,9 +1,9 @@ -import * as cdk from '@aws-cdk/core'; -import {Chain} from '../chain'; +import { Construct } from 'constructs'; +import { Chain } from '../chain'; import { FieldUtils } from '../fields'; -import {IChainable, INextable} from '../types'; +import { IChainable, INextable } from '../types'; import { StateType } from './private/state-type'; -import {renderJsonPath, State } from './state'; +import { renderJsonPath, State } from './state'; /** * The result of a Pass operation @@ -123,7 +123,7 @@ export class Pass extends State implements INextable { private readonly result?: Result; - constructor(scope: cdk.Construct, id: string, props: PassProps = {}) { + constructor(scope: Construct, id: string, props: PassProps = {}) { super(scope, id, props); this.result = props.result; diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/states/state.ts b/packages/@aws-cdk/aws-stepfunctions/lib/states/state.ts index 8d82eecd398d7..2ee256216c115 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/states/state.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/states/state.ts @@ -1,4 +1,4 @@ -import * as cdk from '@aws-cdk/core'; +import { Construct, IConstruct } from 'constructs'; import { Condition } from '../condition'; import { JsonPath } from '../fields'; import { StateGraph } from '../state-graph'; @@ -59,11 +59,11 @@ export interface StateProps { /** * Base class for all other state classes */ -export abstract class State extends cdk.Construct implements IChainable { +export abstract class State extends Construct implements IChainable { /** * Add a prefix to the stateId of all States found in a construct tree */ - public static prefixStates(root: cdk.IConstruct, prefix: string) { + public static prefixStates(root: IConstruct, prefix: string) { const queue = [root]; while (queue.length > 0) { const el = queue.splice(0, 1)[0]!; @@ -173,7 +173,7 @@ export abstract class State extends cdk.Construct implements IChainable { */ private readonly incomingStates: State[] = []; - constructor(scope: cdk.Construct, id: string, props: StateProps) { + constructor(scope: Construct, id: string, props: StateProps) { super(scope, id); this.startState = this; diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/states/succeed.ts b/packages/@aws-cdk/aws-stepfunctions/lib/states/succeed.ts index 75d51840e0234..0017c9111b3ce 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/states/succeed.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/states/succeed.ts @@ -1,4 +1,4 @@ -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { INextable } from '../types'; import { StateType } from './private/state-type'; import { State } from './state'; @@ -44,7 +44,7 @@ export interface SucceedProps { export class Succeed extends State { public readonly endStates: INextable[] = []; - constructor(scope: cdk.Construct, id: string, props: SucceedProps = {}) { + constructor(scope: Construct, id: string, props: SucceedProps = {}) { super(scope, id, props); } diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/states/task-base.ts b/packages/@aws-cdk/aws-stepfunctions/lib/states/task-base.ts index 23b0c4acbb1b3..5a59d7aff54b8 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/states/task-base.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/states/task-base.ts @@ -1,12 +1,12 @@ import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; import * as iam from '@aws-cdk/aws-iam'; +import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Chain } from '../chain'; import { StateGraph } from '../state-graph'; import { CatchProps, IChainable, INextable, RetryProps } from '../types'; import { renderJsonPath, State } from './state'; -import * as cdk from '@aws-cdk/core'; - /** * Props that are common to all tasks */ @@ -95,7 +95,7 @@ export abstract class TaskStateBase extends State implements INextable { private readonly timeout?: cdk.Duration; private readonly heartbeat?: cdk.Duration; - constructor(scope: cdk.Construct, id: string, props: TaskStateBaseProps) { + constructor(scope: Construct, id: string, props: TaskStateBaseProps) { super(scope, id, props); this.endStates = [this]; this.timeout = props.timeout; diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/states/task.ts b/packages/@aws-cdk/aws-stepfunctions/lib/states/task.ts index 1d275d3fb25f8..c342a4938fe74 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/states/task.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/states/task.ts @@ -1,5 +1,6 @@ import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Chain } from '../chain'; import { FieldUtils } from '../fields'; import { StateGraph } from '../state-graph'; @@ -104,7 +105,7 @@ export class Task extends State implements INextable { private readonly timeout?: cdk.Duration; private readonly taskProps: StepFunctionsTaskConfig; - constructor(scope: cdk.Construct, id: string, props: TaskProps) { + constructor(scope: Construct, id: string, props: TaskProps) { super(scope, id, props); this.timeout = props.timeout; diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/states/wait.ts b/packages/@aws-cdk/aws-stepfunctions/lib/states/wait.ts index 014879e7cabde..8386b3ce334b1 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/states/wait.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/states/wait.ts @@ -1,4 +1,5 @@ import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Chain } from '../chain'; import { IChainable, INextable } from '../types'; import { StateType } from './private/state-type'; @@ -72,7 +73,7 @@ export class Wait extends State implements INextable { private readonly time: WaitTime; - constructor(scope: cdk.Construct, id: string, props: WaitProps) { + constructor(scope: Construct, id: string, props: WaitProps) { super(scope, id, props); this.time = props.time; diff --git a/packages/@aws-cdk/aws-stepfunctions/package.json b/packages/@aws-cdk/aws-stepfunctions/package.json index bae715668bf4b..11e13d5451693 100644 --- a/packages/@aws-cdk/aws-stepfunctions/package.json +++ b/packages/@aws-cdk/aws-stepfunctions/package.json @@ -75,7 +75,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -84,7 +84,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 de232deffd531..cdd14d6c82ade 100644 --- a/packages/@aws-cdk/aws-stepfunctions/test/states-language.test.ts +++ b/packages/@aws-cdk/aws-stepfunctions/test/states-language.test.ts @@ -1,5 +1,6 @@ import '@aws-cdk/assert/jest'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as stepfunctions from '../lib'; describe('States Language', () => { @@ -578,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'); @@ -592,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'); @@ -692,7 +693,7 @@ describe('States Language', () => { class ReusableStateMachine extends stepfunctions.StateMachineFragment { public readonly startState: stepfunctions.State; public readonly endStates: stepfunctions.INextable[]; - constructor(scope: cdk.Construct, id: string) { + constructor(scope: Construct, id: string) { super(scope, id); const choice = new stepfunctions.Choice(this, 'Choice') @@ -709,7 +710,7 @@ class SimpleChain extends stepfunctions.StateMachineFragment { public readonly endStates: stepfunctions.INextable[]; private readonly task2: stepfunctions.Task; - constructor(scope: cdk.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-stepfunctions/test/task-base.test.ts b/packages/@aws-cdk/aws-stepfunctions/test/task-base.test.ts index 3778eb6716b30..711ea9b9a8899 100644 --- a/packages/@aws-cdk/aws-stepfunctions/test/task-base.test.ts +++ b/packages/@aws-cdk/aws-stepfunctions/test/task-base.test.ts @@ -2,6 +2,7 @@ import '@aws-cdk/assert/jest'; import { Metric } from '@aws-cdk/aws-cloudwatch'; import * as iam from '@aws-cdk/aws-iam'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as sfn from '../lib'; describe('Task base', () => { @@ -293,7 +294,7 @@ class FakeTask extends sfn.TaskStateBase { protected readonly taskMetrics?: sfn.TaskMetricsConfig; protected readonly taskPolicies?: iam.PolicyStatement[]; - constructor(scope: cdk.Construct, id: string, props: FakeTaskProps = {}) { + constructor(scope: Construct, id: string, props: FakeTaskProps = {}) { super(scope, id, props); this.taskMetrics = props.metrics; } diff --git a/packages/@aws-cdk/aws-transfer/package.json b/packages/@aws-cdk/aws-transfer/package.json index e791a0ebd8e77..01df765f20ea0 100644 --- a/packages/@aws-cdk/aws-transfer/package.json +++ b/packages/@aws-cdk/aws-transfer/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 2489e5da4104b..fa9e08ca3687f 100644 --- a/packages/@aws-cdk/aws-waf/package.json +++ b/packages/@aws-cdk/aws-waf/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 0487d24933b0e..fa6dfd854b0a8 100644 --- a/packages/@aws-cdk/aws-wafregional/package.json +++ b/packages/@aws-cdk/aws-wafregional/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 751545a948b45..0ef5264a299bf 100644 --- a/packages/@aws-cdk/aws-wafv2/package.json +++ b/packages/@aws-cdk/aws-wafv2/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "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 c031eddc57e37..0dc63f8f9d6ea 100644 --- a/packages/@aws-cdk/aws-workspaces/package.json +++ b/packages/@aws-cdk/aws-workspaces/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/cloudformation-include/lib/cfn-include.ts b/packages/@aws-cdk/cloudformation-include/lib/cfn-include.ts index 035631fd282d5..9eda2e44be329 100644 --- a/packages/@aws-cdk/cloudformation-include/lib/cfn-include.ts +++ b/packages/@aws-cdk/cloudformation-include/lib/cfn-include.ts @@ -1,5 +1,6 @@ import * as core from '@aws-cdk/core'; import * as cfn_parse from '@aws-cdk/core/lib/cfn-parse'; +import { Construct } from 'constructs'; import * as cfn_type_to_l1_mapping from './cfn-type-to-l1-mapping'; import * as futils from './file-utils'; @@ -28,7 +29,7 @@ export class CfnInclude extends core.CfnElement { private readonly template: any; private readonly preserveLogicalIds: boolean; - constructor(scope: core.Construct, id: string, props: CfnIncludeProps) { + constructor(scope: Construct, id: string, props: CfnIncludeProps) { super(scope, id); // read the template into a JS object @@ -52,7 +53,7 @@ export class CfnInclude extends core.CfnElement { this.getOrCreateResource(logicalId); } - const outputScope = new core.Construct(this, '$Ouputs'); + const outputScope = new Construct(this, '$Ouputs'); for (const logicalId of Object.keys(this.template.Outputs || {})) { this.createOutput(logicalId, outputScope); @@ -177,7 +178,7 @@ export class CfnInclude extends core.CfnElement { this.parameters[logicalId] = cfnParameter; } - private createOutput(logicalId: string, scope: core.Construct): void { + private createOutput(logicalId: string, scope: Construct): void { const self = this; const outputAttributes = new cfn_parse.CfnParser({ finder: { diff --git a/packages/@aws-cdk/cloudformation-include/package.json b/packages/@aws-cdk/cloudformation-include/package.json index de407f258d640..ee08615cf4078 100644 --- a/packages/@aws-cdk/cloudformation-include/package.json +++ b/packages/@aws-cdk/cloudformation-include/package.json @@ -176,6 +176,7 @@ "@aws-cdk/aws-wafv2": "0.0.0", "@aws-cdk/aws-workspaces": "0.0.0", "@aws-cdk/core": "0.0.0", + "constructs": "4.1.1-pre.0", "yaml": "1.10.0" }, "peerDependencies": { @@ -298,7 +299,7 @@ "@aws-cdk/aws-wafv2": "0.0.0", "@aws-cdk/aws-workspaces": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "devDependencies": { "@aws-cdk/assert": "0.0.0", diff --git a/packages/@aws-cdk/cloudformation-include/test/invalid-templates.test.ts b/packages/@aws-cdk/cloudformation-include/test/invalid-templates.test.ts index 0d1ba70795e5d..7ce1cd2fc9a04 100644 --- a/packages/@aws-cdk/cloudformation-include/test/invalid-templates.test.ts +++ b/packages/@aws-cdk/cloudformation-include/test/invalid-templates.test.ts @@ -1,6 +1,7 @@ import { SynthUtils } from '@aws-cdk/assert'; import '@aws-cdk/assert/jest'; import * as core from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as path from 'path'; import * as inc from '../lib'; @@ -84,7 +85,7 @@ describe('CDK Include', () => { }); }); -function includeTestTemplate(scope: core.Construct, testTemplate: string): inc.CfnInclude { +function includeTestTemplate(scope: Construct, testTemplate: string): inc.CfnInclude { return new inc.CfnInclude(scope, 'MyScope', { templateFile: _testTemplateFilePath(testTemplate), }); diff --git a/packages/@aws-cdk/cloudformation-include/test/valid-templates.test.ts b/packages/@aws-cdk/cloudformation-include/test/valid-templates.test.ts index 57e6d0470dcb9..a0f734968eed6 100644 --- a/packages/@aws-cdk/cloudformation-include/test/valid-templates.test.ts +++ b/packages/@aws-cdk/cloudformation-include/test/valid-templates.test.ts @@ -3,6 +3,7 @@ import '@aws-cdk/assert/jest'; import * as iam from '@aws-cdk/aws-iam'; import * as s3 from '@aws-cdk/aws-s3'; import * as core from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as path from 'path'; import * as inc from '../lib'; import * as futils from '../lib/file-utils'; @@ -488,7 +489,7 @@ interface IncludeTestTemplateProps { readonly preserveLogicalIds?: boolean; } -function includeTestTemplate(scope: core.Construct, testTemplate: string, _props: IncludeTestTemplateProps = {}): inc.CfnInclude { +function includeTestTemplate(scope: Construct, testTemplate: string, _props: IncludeTestTemplateProps = {}): inc.CfnInclude { return new inc.CfnInclude(scope, 'MyScope', { templateFile: _testTemplateFilePath(testTemplate), // preserveLogicalIds: props.preserveLogicalIds, diff --git a/packages/@aws-cdk/cloudformation-include/test/yaml-templates.test.ts b/packages/@aws-cdk/cloudformation-include/test/yaml-templates.test.ts index 19b7551c50876..c6a886ec605c3 100644 --- a/packages/@aws-cdk/cloudformation-include/test/yaml-templates.test.ts +++ b/packages/@aws-cdk/cloudformation-include/test/yaml-templates.test.ts @@ -1,5 +1,6 @@ import '@aws-cdk/assert/jest'; import * as core from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as path from 'path'; import * as inc from '../lib'; import * as futils from '../lib/file-utils'; @@ -325,7 +326,7 @@ describe('CDK Include', () => { }); }); -function includeTestTemplate(scope: core.Construct, testTemplate: string): inc.CfnInclude { +function includeTestTemplate(scope: Construct, testTemplate: string): inc.CfnInclude { return new inc.CfnInclude(scope, 'MyScope', { templateFile: _testTemplateFilePath(testTemplate), }); diff --git a/packages/@aws-cdk/core/README.md b/packages/@aws-cdk/core/README.md index 65f9067ff32d4..5f52511b84009 100644 --- a/packages/@aws-cdk/core/README.md +++ b/packages/@aws-cdk/core/README.md @@ -64,7 +64,8 @@ For example, assume that you have a load balancer configuration that you use for The following example will define a single top-level stack that contains two nested stacks: each one with a single Amazon S3 bucket: ```ts -import { Stack, Construct, StackProps } from '@aws-cdk/core'; +import { Stack,, StackProps } from '@aws-cdk/core' +import { Construct } from 'constructs'; import cfn = require('@aws-cdk/aws-cloudformation'); import s3 = require('@aws-cdk/aws-s3'); diff --git a/packages/@aws-cdk/core/lib/app.ts b/packages/@aws-cdk/core/lib/app.ts index 1546ab19ee53c..51b3a35fb4ba3 100644 --- a/packages/@aws-cdk/core/lib/app.ts +++ b/packages/@aws-cdk/core/lib/app.ts @@ -1,4 +1,6 @@ +import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import * as cxapi from '@aws-cdk/cx-api'; +import { ConstructScopeSettings } from 'constructs'; import { TreeMetadata } from './private/tree-metadata'; import { Stage } from './stage'; @@ -105,6 +107,18 @@ export class App extends Stage { this.node.setContext(cxapi.DISABLE_VERSION_REPORTING, true); } + const settings = ConstructScopeSettings.of(this); + + // configure settings for "constructs" + + if (this.node.tryGetContext(cxapi.DISABLE_METADATA_STACK_TRACE) || process.env.CDK_DISABLE_STACK_TRACE) { + settings.disableStackTraces(); + } + + settings.errorMetadataKey = cxschema.ArtifactMetadataEntryType.ERROR; + settings.warningMetadataKey = cxschema.ArtifactMetadataEntryType.WARN; + settings.infoMetadataKey = cxschema.ArtifactMetadataEntryType.INFO; + const autoSynth = props.autoSynth !== undefined ? props.autoSynth : cxapi.OUTDIR_ENV in process.env; if (autoSynth) { // synth() guarantuees it will only execute once, so a default of 'true' diff --git a/packages/@aws-cdk/core/lib/aspect.ts b/packages/@aws-cdk/core/lib/aspect.ts index 17534e2139f0f..0a570950edd51 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'; /** * Represents an Aspect @@ -9,3 +9,50 @@ export interface IAspect { */ visit(node: IConstruct): void; } + +const ASPECTS_SYMBOL = Symbol('cdk-aspects'); + +/** + * Aspects can be applied to CDK tree scopes and can operate on the tree before + * synthesis. + */ +export class Aspects { + + /** + * Returns the `Aspects` object associated with a construct scope. + * @param scope The scope for which these aspects will apply. + */ + public static of(scope: IConstruct): Aspects { + const aspects = (scope as any)[ASPECTS_SYMBOL]; + if (aspects) { + return aspects; + } + + Object.defineProperty(scope, ASPECTS_SYMBOL, { + value: new Aspects(scope), + configurable: false, + enumerable: false, + }); + + return this.of(scope); + } + + private readonly _aspects = new Array(); + + private constructor(_construct: IConstruct) { } + + /** + * Apply an aspect on this scope. + * @param aspect The aspect to apply. + */ + public apply(aspect: IAspect) { + this._aspects.push(aspect); + } + + /** + * The list of aspects which were directly applied on this scope. + */ + public get aspects(): 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 2a0702c20d76f..9bcbca7f36d03 100644 --- a/packages/@aws-cdk/core/lib/asset-staging.ts +++ b/packages/@aws-cdk/core/lib/asset-staging.ts @@ -1,12 +1,13 @@ import * as cxapi from '@aws-cdk/cx-api'; +import { Construct } from 'constructs'; import * as crypto from 'crypto'; import * as fs from 'fs-extra'; import * as os from 'os'; import * as path from 'path'; import { AssetHashType, AssetOptions } from './assets'; import { BundlingOptions } from './bundling'; -import { Construct, ISynthesisSession } from './construct-compat'; import { FileSystem, FingerprintOptions } from './fs'; +import { Stage } from './stage'; const STAGING_TMP = '.cdk.staging'; @@ -103,15 +104,22 @@ export class AssetStaging extends Construct { } this.sourceHash = this.assetHash; + + const outdir = Stage.of(this)?.outdir; + if (!outdir) { + throw new Error('unable to determine cloud assembly output directory. Assets must be defined indirectly within a "Stage" or an "App" scope'); + } + + this.stageAsset(outdir); } - protected synthesize(session: ISynthesisSession) { + private stageAsset(outdir: string) { // Staging is disabled if (!this.relativePath) { return; } - const targetPath = path.join(session.assembly.outdir, this.relativePath); + const targetPath = path.join(outdir, this.relativePath); // Already staged if (fs.existsSync(targetPath)) { diff --git a/packages/@aws-cdk/core/lib/cfn-condition.ts b/packages/@aws-cdk/core/lib/cfn-condition.ts index 354ad1f32d122..db3fe5915e512 100644 --- a/packages/@aws-cdk/core/lib/cfn-condition.ts +++ b/packages/@aws-cdk/core/lib/cfn-condition.ts @@ -1,5 +1,5 @@ +import { Construct } from 'constructs'; import { CfnElement } from './cfn-element'; -import { Construct } from './construct-compat'; import { IResolvable, IResolveContext } from './resolvable'; export interface CfnConditionProps { diff --git a/packages/@aws-cdk/core/lib/cfn-element.ts b/packages/@aws-cdk/core/lib/cfn-element.ts index 7aadf278f13cd..011cf281a7044 100644 --- a/packages/@aws-cdk/core/lib/cfn-element.ts +++ b/packages/@aws-cdk/core/lib/cfn-element.ts @@ -1,5 +1,6 @@ import * as cxschema from '@aws-cdk/cloud-assembly-schema'; -import { Construct } from './construct-compat'; +import * as cxapi from '@aws-cdk/cx-api'; +import { Construct } from 'constructs'; import { Lazy } from './lazy'; import { Token } from './token'; @@ -61,7 +62,12 @@ export abstract class CfnElement extends Construct { displayHint: `${notTooLong(this.node.path)}.LogicalID`, }); - this.node.addMetadata(cxschema.ArtifactMetadataEntryType.LOGICAL_ID, this.logicalId, this.constructor); + const stackTrace = this.node.tryGetContext(cxapi.DISABLE_METADATA_STACK_TRACE) ? false : true; + + this.node.addMetadata(cxschema.ArtifactMetadataEntryType.LOGICAL_ID, this.logicalId, { + stackTrace, + traceFromFunction: this.constructor, + }); } /** diff --git a/packages/@aws-cdk/core/lib/cfn-include.ts b/packages/@aws-cdk/core/lib/cfn-include.ts index 61f70072f47a6..4cfedc1c03c25 100644 --- a/packages/@aws-cdk/core/lib/cfn-include.ts +++ b/packages/@aws-cdk/core/lib/cfn-include.ts @@ -1,5 +1,5 @@ +import { Construct } from 'constructs'; import { CfnElement } from './cfn-element'; -import { Construct } from './construct-compat'; export interface CfnIncludeProps { /** diff --git a/packages/@aws-cdk/core/lib/cfn-json.ts b/packages/@aws-cdk/core/lib/cfn-json.ts index eee32038a0099..d3e6dadc3944d 100644 --- a/packages/@aws-cdk/core/lib/cfn-json.ts +++ b/packages/@aws-cdk/core/lib/cfn-json.ts @@ -1,4 +1,4 @@ -import { Construct } from './construct-compat'; +import { Construct } from 'constructs'; import { CustomResource } from './custom-resource'; import { CfnUtilsProvider } from './private/cfn-utils-provider'; import { CfnUtilsResourceType } from './private/cfn-utils-provider/consts'; diff --git a/packages/@aws-cdk/core/lib/cfn-mapping.ts b/packages/@aws-cdk/core/lib/cfn-mapping.ts index 7399d29f31e81..196baf3aadb96 100644 --- a/packages/@aws-cdk/core/lib/cfn-mapping.ts +++ b/packages/@aws-cdk/core/lib/cfn-mapping.ts @@ -1,6 +1,6 @@ +import { Construct } from 'constructs'; import { CfnRefElement } from './cfn-element'; import { Fn } from './cfn-fn'; -import { Construct } from './construct-compat'; import { Token } from './token'; export interface CfnMappingProps { diff --git a/packages/@aws-cdk/core/lib/cfn-output.ts b/packages/@aws-cdk/core/lib/cfn-output.ts index 387c5216ead91..1f96c0c87a08c 100644 --- a/packages/@aws-cdk/core/lib/cfn-output.ts +++ b/packages/@aws-cdk/core/lib/cfn-output.ts @@ -1,5 +1,5 @@ +import { Construct } from 'constructs'; import { CfnElement } from './cfn-element'; -import { Construct } from './construct-compat'; export interface CfnOutputProps { /** diff --git a/packages/@aws-cdk/core/lib/cfn-parameter.ts b/packages/@aws-cdk/core/lib/cfn-parameter.ts index 8d91f7c006777..1e0634c6ed742 100644 --- a/packages/@aws-cdk/core/lib/cfn-parameter.ts +++ b/packages/@aws-cdk/core/lib/cfn-parameter.ts @@ -1,5 +1,5 @@ +import { Construct } from 'constructs'; import { CfnElement } from './cfn-element'; -import { Construct } from './construct-compat'; import { CfnReference } from './private/cfn-reference'; import { IResolvable, IResolveContext } from './resolvable'; import { Token } from './token'; diff --git a/packages/@aws-cdk/core/lib/cfn-pseudo.ts b/packages/@aws-cdk/core/lib/cfn-pseudo.ts index dc1848aa49ca4..345c09a423f90 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/cfn-resource.ts b/packages/@aws-cdk/core/lib/cfn-resource.ts index deeb92e0e2456..620ac6e5f4541 100644 --- a/packages/@aws-cdk/core/lib/cfn-resource.ts +++ b/packages/@aws-cdk/core/lib/cfn-resource.ts @@ -1,10 +1,10 @@ import * as cxapi from '@aws-cdk/cx-api'; +import { Construct, IConstruct } from 'constructs'; import { CfnCondition } from './cfn-condition'; // import required to be here, otherwise causes a cycle when running the generated JavaScript // tslint:disable-next-line:ordered-imports import { CfnRefElement } from './cfn-element'; import { CfnCreationPolicy, CfnDeletionPolicy, CfnUpdatePolicy } from './cfn-resource-policy'; -import { Construct, IConstruct } from './construct-compat'; import { addDependency } from './deps'; import { CfnReference } from './private/cfn-reference'; import { Reference } from './reference'; diff --git a/packages/@aws-cdk/core/lib/cfn-rule.ts b/packages/@aws-cdk/core/lib/cfn-rule.ts index 847c67982192b..f3141ca636ce2 100644 --- a/packages/@aws-cdk/core/lib/cfn-rule.ts +++ b/packages/@aws-cdk/core/lib/cfn-rule.ts @@ -1,6 +1,6 @@ +import { Construct } from 'constructs'; import { ICfnConditionExpression } from './cfn-condition'; import { CfnRefElement } from './cfn-element'; -import { Construct } from './construct-compat'; import { capitalizePropertyNames } from './util'; /** diff --git a/packages/@aws-cdk/core/lib/construct-compat.ts b/packages/@aws-cdk/core/lib/construct-compat.ts index e689d3a837619..da60d93ada8c3 100644 --- a/packages/@aws-cdk/core/lib/construct-compat.ts +++ b/packages/@aws-cdk/core/lib/construct-compat.ts @@ -1,514 +1,32 @@ /** * 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. - */ + * This file contains typescript aliases for types in "constructs" as part of + * our migration to 2.x and in order to reduce the chance for merge conflicts as + * we transition from the code base of 1.x to 2.x + */ + +// /** +// * 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; +// } -import * as cxschema from '@aws-cdk/cloud-assembly-schema'; -import * as cxapi from '@aws-cdk/cx-api'; import * as constructs from 'constructs'; -import { IAspect } 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: 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; - - constructor(host: Construct, scope: IConstruct, id: string) { - 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. - */ - public get uniqueId(): string { return this._actualNode.uniqueId; } - - /** - * 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 thie 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); } - - /** - * Adds a { "info": } metadata entry to this construct. - * The toolkit will display the info message when apps are synthesized. - * @param message The info message. - */ - public addInfo(message: string): void { - this._actualNode.addMetadata(cxschema.ArtifactMetadataEntryType.INFO, message); - } - - /** - * 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. - */ - public addWarning(message: string): void { - this._actualNode.addMetadata(cxschema.ArtifactMetadataEntryType.WARN, message); - } - - /** - * Adds an { "error": } metadata entry to this construct. - * The toolkit will fail synthesis when errors are reported. - * @param message The error message. - */ - public addError(message: string) { - this._actualNode.addMetadata(cxschema.ArtifactMetadataEntryType.ERROR, message); - } - - /** - * Applies the aspect to this Constructs node - */ - public applyAspect(aspect: IAspect): void { this._actualNode.applyAspect(aspect); } - - /** - * 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; -} +export type Construct = constructs.Construct; +export type IConstruct = constructs.IConstruct; +export type ConstructOrder = constructs.ConstructOrder; -function ignore(_x: any) { - return; -} +export type DependableTrait = constructs.Dependable; +export type IDependable = constructs.IDependable; +export type ConstructNode = constructs.Node; +export type ConcreteDependable = constructs.DependencyGroup; diff --git a/packages/@aws-cdk/core/lib/context-provider.ts b/packages/@aws-cdk/core/lib/context-provider.ts index d5c7928649f37..d0d13197405ba 100644 --- a/packages/@aws-cdk/core/lib/context-provider.ts +++ b/packages/@aws-cdk/core/lib/context-provider.ts @@ -1,6 +1,6 @@ import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import * as cxapi from '@aws-cdk/cx-api'; -import { Construct } from './construct-compat'; +import { Construct } from 'constructs'; import { Stack } from './stack'; import { Token } from './token'; 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 8b24d068235f9..470ba19412080 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 @@ -1,9 +1,9 @@ +import { Construct } from 'constructs'; import * as fs from 'fs'; import * as path from 'path'; import { AssetStaging } from '../asset-staging'; import { FileAssetPackaging } from '../assets'; import { CfnResource } from '../cfn-resource'; -import { Construct } from '../construct-compat'; import { Duration } from '../duration'; import { Size } from '../size'; import { Stack } from '../stack'; diff --git a/packages/@aws-cdk/core/lib/custom-resource.ts b/packages/@aws-cdk/core/lib/custom-resource.ts index 6926d8fc31a56..7fbf9505cf971 100644 --- a/packages/@aws-cdk/core/lib/custom-resource.ts +++ b/packages/@aws-cdk/core/lib/custom-resource.ts @@ -1,5 +1,5 @@ +import { Construct } from 'constructs'; import { CfnResource } from './cfn-resource'; -import { Construct } from './construct-compat'; import { RemovalPolicy } from './removal-policy'; import { Resource } from './resource'; import { Token } from './token'; diff --git a/packages/@aws-cdk/core/lib/dependency.ts b/packages/@aws-cdk/core/lib/dependency.ts deleted file mode 100644 index 98e69a2d429e7..0000000000000 --- a/packages/@aws-cdk/core/lib/dependency.ts +++ /dev/null @@ -1,98 +0,0 @@ -import { IConstruct } from './construct-compat'; - -/** - * Trait marker for classes that can be depended upon - * - * The presence of this interface indicates that an object has - * an `IDependableTrait` implementation. - * - * This interface can be used to take an (ordering) dependency on a set of - * constructs. An ordering dependency implies that the resources represented by - * those constructs are deployed before the resources depending ON them are - * deployed. - */ -export interface IDependable { - // Empty, this interface is a trait marker -} - -/** - * A set of constructs to be used as a dependable - * - * This class can be used when a set of constructs which are disjoint in the - * construct tree needs to be combined to be used as a single dependable. - * - * @experimental - */ -export class ConcreteDependable implements IDependable { - private readonly _dependencyRoots = new Array(); - - constructor() { - const self = this; - DependableTrait.implement(this, { - get dependencyRoots() { return self._dependencyRoots; }, - }); - } - - /** - * Add a construct to the dependency roots - */ - public add(construct: IConstruct) { - this._dependencyRoots.push(construct); - } -} - -const DEPENDABLE_SYMBOL = Symbol.for('@aws-cdk/core.DependableTrait'); - -/** - * Trait for IDependable - * - * Traits are interfaces that are privately implemented by objects. Instead of - * showing up in the public interface of a class, they need to be queried - * explicitly. This is used to implement certain framework features that are - * not intended to be used by Construct consumers, and so should be hidden - * from accidental use. - * - * @example - * - * // Usage - * const roots = DependableTrait.get(construct).dependencyRoots; - * - * // Definition - * DependableTrait.implement(construct, { - * get dependencyRoots() { return []; } - * }); - * - * @experimental - */ -export abstract class DependableTrait { - /** - * Register `instance` to have the given DependableTrait - * - * Should be called in the class constructor. - */ - public static implement(instance: IDependable, trait: DependableTrait) { - // I would also like to reference classes (to cut down on the list of objects - // we need to manage), but we can't do that either since jsii doesn't have the - // concept of a class reference. - (instance as any)[DEPENDABLE_SYMBOL] = trait; - } - - /** - * Return the matching DependableTrait for the given class instance. - */ - public static get(instance: IDependable): DependableTrait { - const ret = (instance as any)[DEPENDABLE_SYMBOL]; - if (!ret) { - throw new Error(`${instance} does not implement DependableTrait`); - } - return ret; - } - - /** - * The set of constructs that form the root of this dependable - * - * All resources under all returned constructs are included in the ordering - * dependency. - */ - public abstract readonly dependencyRoots: IConstruct[]; -} diff --git a/packages/@aws-cdk/core/lib/index.ts b/packages/@aws-cdk/core/lib/index.ts index 6c54a222901d6..d8c4c04b52065 100644 --- a/packages/@aws-cdk/core/lib/index.ts +++ b/packages/@aws-cdk/core/lib/index.ts @@ -1,14 +1,14 @@ -export * from './aspect'; export * from './tag-aspect'; +export * from './aspect'; export * from './construct-compat'; export * from './token'; export * from './resolvable'; export * from './lazy'; export * from './tag-manager'; -export * from './dependency'; export * from './string-fragments'; export * from './stack-synthesizers'; +export * from './synthesis'; export * from './reference'; export * from './cfn-condition'; diff --git a/packages/@aws-cdk/core/lib/nested-stack.ts b/packages/@aws-cdk/core/lib/nested-stack.ts index 4d87c148958f0..46f7d0a1bd8f8 100644 --- a/packages/@aws-cdk/core/lib/nested-stack.ts +++ b/packages/@aws-cdk/core/lib/nested-stack.ts @@ -1,10 +1,10 @@ +import { Construct } from 'constructs'; import * as crypto from 'crypto'; import { FileAssetPackaging } from './assets'; import { Fn } from './cfn-fn'; import { Aws } from './cfn-pseudo'; import { CfnResource } from './cfn-resource'; import { CfnStack } from './cloudformation.generated'; -import { Construct } from './construct-compat'; import { Duration } from './duration'; import { Lazy } from './lazy'; import { IResolveContext } from './resolvable'; diff --git a/packages/@aws-cdk/core/lib/private/asset-parameters.ts b/packages/@aws-cdk/core/lib/private/asset-parameters.ts index fb63d28819122..232965b6a510f 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 5aaf870b3ec1a..3365a7060c8f5 100644 --- a/packages/@aws-cdk/core/lib/private/cfn-reference.ts +++ b/packages/@aws-cdk/core/lib/private/cfn-reference.ts @@ -136,8 +136,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 dae7253720041..bd672ac9b5fc9 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 { CustomResourceProvider, CustomResourceProviderRuntime } from '../custom-resource-provider'; /** diff --git a/packages/@aws-cdk/core/lib/private/prepare-app.ts b/packages/@aws-cdk/core/lib/private/prepare-app.ts index de5ef433fb1ad..5f4a996463471 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'; @@ -16,12 +15,8 @@ import { resolveReferences } from './refs'; * @param root The root of the construct tree. */ export function prepareApp(root: IConstruct) { - if (root.node.scope && !Stage.isStage(root)) { - throw new Error('prepareApp can only be called on a stage or a root construct'); - } - // 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); @@ -91,6 +86,35 @@ function findCfnResources(root: IConstruct): CfnResource[] { return root.node.findAll().filter(CfnResource.isCfnResource); } +/** + * 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).dependencies) { + 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; +} + interface INestedStackPrivateApi { _prepareTemplateAsset(): boolean; } diff --git a/packages/@aws-cdk/core/lib/private/refs.ts b/packages/@aws-cdk/core/lib/private/refs.ts index 62a568f8cd736..151f2b1bb6e78 100644 --- a/packages/@aws-cdk/core/lib/private/refs.ts +++ b/packages/@aws-cdk/core/lib/private/refs.ts @@ -1,10 +1,10 @@ // ---------------------------------------------------- // CROSS REFERENCES // ---------------------------------------------------- +import { Construct, IConstruct } from 'constructs'; import { CfnElement } from '../cfn-element'; import { CfnOutput } from '../cfn-output'; import { CfnParameter } from '../cfn-parameter'; -import { Construct, IConstruct } from '../construct-compat'; import { Reference } from '../reference'; import { IResolvable } from '../resolvable'; import { Stack } from '../stack'; diff --git a/packages/@aws-cdk/core/lib/private/resolve.ts b/packages/@aws-cdk/core/lib/private/resolve.ts index 11cd65cc332b3..e345159fb1c5c 100644 --- a/packages/@aws-cdk/core/lib/private/resolve.ts +++ b/packages/@aws-cdk/core/lib/private/resolve.ts @@ -1,4 +1,4 @@ -import { IConstruct } from '../construct-compat'; +import { IConstruct } from 'constructs'; import { DefaultTokenResolver, IPostProcessor, IResolvable, IResolveContext, ITokenResolver, StringConcat } from '../resolvable'; import { TokenizedStringFragments } from '../string-fragments'; import { containsListTokenElement, TokenString, unresolved } from './encoding'; diff --git a/packages/@aws-cdk/core/lib/private/synthesis.ts b/packages/@aws-cdk/core/lib/private/synthesis.ts index ea6fbf7b05ffa..4e844c44695f6 100644 --- a/packages/@aws-cdk/core/lib/private/synthesis.ts +++ b/packages/@aws-cdk/core/lib/private/synthesis.ts @@ -1,8 +1,11 @@ import * as cxapi from '@aws-cdk/cx-api'; -import * as constructs from 'constructs'; -import { Construct, IConstruct, SynthesisOptions, ValidationError } from '../construct-compat'; +import { IConstruct, ValidationError } from 'constructs'; +import { Aspects, IAspect } from '../aspect'; +import { Stack } from '../stack'; import { Stage, StageSynthesisOptions } from '../stage'; +import { SynthesisOptions } from '../synthesis'; import { prepareApp } from './prepare-app'; +import { TreeMetadata } from './tree-metadata'; 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) @@ -10,9 +13,6 @@ export function synthesize(root: IConstruct, options: SynthesisOptions = { }): c invokeAspects(root); - // This is mostly here for legacy purposes as the framework itself does not use prepare anymore. - prepareTree(root); - // resolve references prepareApp(root); @@ -58,18 +58,25 @@ function synthNestedAssemblies(root: IConstruct, options: StageSynthesisOptions) * twice for the same construct. */ function invokeAspects(root: IConstruct) { + const invokedByPath: { [nodePath: string]: IAspect[] } = { }; + recurse(root, []); - function recurse(construct: IConstruct, inheritedAspects: constructs.IAspect[]) { - // hackery to be able to access some private members with strong types (yack!) - const node: NodeWithAspectPrivatesHangingOut = construct.node._actualNode as any; + function recurse(construct: IConstruct, inheritedAspects: IAspect[]) { + const node = construct.node; - const allAspectsHere = [...inheritedAspects ?? [], ...node._aspects]; + const allAspectsHere = [...inheritedAspects ?? [], ...Aspects.of(construct).aspects]; for (const aspect of allAspectsHere) { - if (node.invokedAspects.includes(aspect)) { continue; } + + let invoked = invokedByPath[node.path]; + if (!invoked) { + invoked = invokedByPath[node.path] = []; + } + + if (invoked.includes(aspect)) { continue; } aspect.visit(construct); - node.invokedAspects.push(aspect); + invoked.push(aspect); } for (const child of construct.node.children) { @@ -80,38 +87,38 @@ 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()); -} - /** * Synthesize children in post-order into the given builder * * Stop at Assembly boundaries. */ function synthesizeTree(root: IConstruct, builder: cxapi.CloudAssemblyBuilder) { - visit(root, 'post', construct => construct.onSynthesize({ - outdir: builder.outdir, - assembly: builder, - })); + visit(root, 'post', construct => { + const session = { + outdir: builder.outdir, + assembly: builder, + }; + + if (construct instanceof Stack) { + construct._synthesizeTemplate(session); + } else if (construct instanceof TreeMetadata) { + construct._synthesizeTree(session); + } else { + if (typeof((construct as any).synthesize) === 'function') { + throw new Error(`"synthesize" is no longer supported: ${construct.node.path}`); + } + } + }); } /** * Validate all constructs in the given construct tree + * (Exported for unit tests) */ -function validateTree(root: IConstruct) { +export function validateTree(root: IConstruct) { const errors = new Array(); - visit(root, 'pre', construct => { - for (const message of construct.onValidate()) { - errors.push({ message, source: construct as unknown as Construct }); - } - }); + visit(root, 'pre', construct => errors.push(...construct.node.validate())); if (errors.length > 0) { const errorList = errors.map(e => `[${e.source.node.path}] ${e.message}`).join('\n '); @@ -122,9 +129,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) { @@ -133,38 +140,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; -} - -/** - * The constructs Node type, but with some aspects-related fields public. - * - * Hackery! - */ -type NodeWithAspectPrivatesHangingOut = Omit & { - readonly invokedAspects: constructs.IAspect[]; - readonly _aspects: constructs.IAspect[]; -}; \ No newline at end of file diff --git a/packages/@aws-cdk/core/lib/private/tree-metadata.ts b/packages/@aws-cdk/core/lib/private/tree-metadata.ts index a40481faa9b2d..4ced2e5a6ae88 100644 --- a/packages/@aws-cdk/core/lib/private/tree-metadata.ts +++ b/packages/@aws-cdk/core/lib/private/tree-metadata.ts @@ -2,8 +2,9 @@ import * as fs from 'fs'; import * as path from 'path'; import { ArtifactType } from '@aws-cdk/cloud-assembly-schema'; -import { Construct, IConstruct, ISynthesisSession } from '../construct-compat'; +import { Construct, IConstruct } from 'constructs'; import { Stack } from '../stack'; +import { ISynthesisSession } from '../stack-synthesizers'; import { IInspectable, TreeInspector } from '../tree'; const FILE_PATH = 'tree.json'; @@ -20,7 +21,11 @@ export class TreeMetadata extends Construct { super(scope, 'Tree'); } - protected synthesize(session: ISynthesisSession) { + /** + * Create tree.json + * @internal + */ + public _synthesizeTree(session: ISynthesisSession) { const lookup: { [path: string]: Node } = { }; const visit = (construct: IConstruct): Node => { diff --git a/packages/@aws-cdk/core/lib/reference.ts b/packages/@aws-cdk/core/lib/reference.ts index affb5588fd797..d2388473c28d7 100644 --- a/packages/@aws-cdk/core/lib/reference.ts +++ b/packages/@aws-cdk/core/lib/reference.ts @@ -26,4 +26,4 @@ export abstract class Reference extends Intrinsic { } } -import { IConstruct } from './construct-compat'; +import { IConstruct } from 'constructs'; diff --git a/packages/@aws-cdk/core/lib/resolvable.ts b/packages/@aws-cdk/core/lib/resolvable.ts index 3460772211659..908ba7ad283c6 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 6574dbe331da0..f5d0c1b860b14 100644 --- a/packages/@aws-cdk/core/lib/resource.ts +++ b/packages/@aws-cdk/core/lib/resource.ts @@ -1,5 +1,5 @@ +import { Construct, IConstruct } from 'constructs'; import { ArnComponents } from './arn'; -import { Construct, IConstruct } from './construct-compat'; import { Lazy } from './lazy'; import { generatePhysicalName, isGeneratedWhenNeededMarker } from './private/physical-name-generator'; import { IResolveContext } from './resolvable'; diff --git a/packages/@aws-cdk/core/lib/runtime.ts b/packages/@aws-cdk/core/lib/runtime.ts index b475679338129..0c9bff2885c8d 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 280a3f72d1079..d64d0c0ff7f86 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 cxschema from '@aws-cdk/cloud-assembly-schema'; +import { IConstruct, Node } from 'constructs'; import * as crypto from 'crypto'; -import { ConstructNode, IConstruct, ISynthesisSession } from '../construct-compat'; 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 a1149f91e4990..58e8261132f89 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 { addStackArtifactToAssembly, 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 98111a43e0e42..c505776c96027 100644 --- a/packages/@aws-cdk/core/lib/stack-synthesizers/default-synthesizer.ts +++ b/packages/@aws-cdk/core/lib/stack-synthesizers/default-synthesizer.ts @@ -4,11 +4,10 @@ import * as fs from 'fs'; import * as path from 'path'; import { DockerImageAssetLocation, DockerImageAssetSource, FileAssetLocation, FileAssetPackaging, FileAssetSource } from '../assets'; import { Fn } from '../cfn-fn'; -import { ISynthesisSession } from '../construct-compat'; import { Stack } from '../stack'; import { Token } from '../token'; import { addStackArtifactToAssembly, assertBound, contentHash } from './_shared'; -import { IStackSynthesizer } from './types'; +import { IStackSynthesizer, ISynthesisSession } from './types'; export const BOOTSTRAP_QUALIFIER_CONTEXT = '@aws-cdk/core:bootstrapQualifier'; diff --git a/packages/@aws-cdk/core/lib/stack-synthesizers/legacy.ts b/packages/@aws-cdk/core/lib/stack-synthesizers/legacy.ts index 06facd881626f..dc811329bdf9b 100644 --- a/packages/@aws-cdk/core/lib/stack-synthesizers/legacy.ts +++ b/packages/@aws-cdk/core/lib/stack-synthesizers/legacy.ts @@ -1,12 +1,12 @@ 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 { addStackArtifactToAssembly, assertBound } from './_shared'; -import { IStackSynthesizer } from './types'; +import { IStackSynthesizer, 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 8841618823aa9..afed8ae3a462c 100644 --- a/packages/@aws-cdk/core/lib/stack-synthesizers/nested.ts +++ b/packages/@aws-cdk/core/lib/stack-synthesizers/nested.ts @@ -1,7 +1,6 @@ import { DockerImageAssetLocation, DockerImageAssetSource, FileAssetLocation, FileAssetSource } from '../assets'; -import { ISynthesisSession } from '../construct-compat'; import { Stack } from '../stack'; -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/types.ts b/packages/@aws-cdk/core/lib/stack-synthesizers/types.ts index c7f5fce1a7cbf..c762580d750c7 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 * as cxapi from '@aws-cdk/cx-api'; import { DockerImageAssetLocation, DockerImageAssetSource, FileAssetLocation, FileAssetSource } from '../assets'; -import { ISynthesisSession } from '../construct-compat'; import { Stack } from '../stack'; /** @@ -34,3 +34,18 @@ export interface IStackSynthesizer { */ synthesizeStackArtifacts(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: cxapi.CloudAssemblyBuilder; +} diff --git a/packages/@aws-cdk/core/lib/stack.ts b/packages/@aws-cdk/core/lib/stack.ts index eeb65562837ec..5f0b8337e8ef3 100644 --- a/packages/@aws-cdk/core/lib/stack.ts +++ b/packages/@aws-cdk/core/lib/stack.ts @@ -1,15 +1,28 @@ import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import * as cxapi from '@aws-cdk/cx-api'; +import { Construct, IConstruct } from 'constructs'; import * as fs from 'fs'; import * as path from 'path'; +// These imports have to be at the end to prevent circular imports +import { Arn, ArnComponents } from './arn'; import { DockerImageAssetLocation, DockerImageAssetSource, FileAssetLocation, FileAssetSource } from './assets'; -import { Construct, IConstruct, ISynthesisSession } from './construct-compat'; +import { CfnElement } from './cfn-element'; +import { Fn } from './cfn-fn'; +import { Aws, ScopedAws } from './cfn-pseudo'; +import { CfnResource, TagType } from './cfn-resource'; import { ContextProvider } from './context-provider'; +import { addDependency } from './deps'; import { Environment } from './environment'; -import { CLOUDFORMATION_TOKEN_RESOLVER, CloudFormationLang } from './private/cloudformation-lang'; +import * as cfnlang from './private/cloudformation-lang'; import { LogicalIDs } from './private/logical-id'; import { resolve } from './private/resolve'; import { makeUniqueId } from './private/uniqueid'; +import { Reference } from './reference'; +import { IResolvable } from './resolvable'; +import { DefaultStackSynthesizer, IStackSynthesizer, ISynthesisSession, LegacyStackSynthesizer } from './stack-synthesizers'; +import { Stage } from './stage'; +import { ITaggable, TagManager } from './tag-manager'; +import { Token } from './token'; const STACK_SYMBOL = Symbol.for('@aws-cdk/core.Stack'); const MY_STACK_CACHE = Symbol.for('@aws-cdk/core.Stack.myStack'); @@ -358,7 +371,7 @@ export class Stack extends Construct implements ITaggable { return resolve(obj, { scope: this, prefix: [], - resolver: CLOUDFORMATION_TOKEN_RESOLVER, + resolver: cfnlang.CLOUDFORMATION_TOKEN_RESOLVER, preparing: false, }); } @@ -367,7 +380,7 @@ export class Stack extends Construct implements ITaggable { * Convert an object, potentially containing tokens, to a JSON string */ public toJsonString(obj: any, space?: number): string { - return CloudFormationLang.toJSON(obj, space).toString(); + return cfnlang.CloudFormationLang.toJSON(obj, space).toString(); } /** @@ -682,6 +695,32 @@ export class Stack extends Construct implements ITaggable { } } + /** + * Synthesizes the cloudformation template into a cloud assembly. + * @internal + */ + public _synthesizeTemplate(session: ISynthesisSession): void { + // In principle, stack synthesis is delegated to the + // StackSynthesis object. + // + // However, some parts of synthesis currently use some private + // methods on Stack, and I don't really see the value in refactoring + // this right now, so some parts still happen here. + const builder = session.assembly; + + // write the CloudFormation template as a JSON file + const outPath = path.join(builder.outdir, this.templateFile); + const text = JSON.stringify(this._toCloudFormation(), undefined, 2); + fs.writeFileSync(outPath, text); + + for (const ctx of this._missingContext) { + builder.addMissing(ctx); + } + + // Delegate adding artifacts to the Synthesizer + this.synthesizer.synthesizeStackArtifacts(session); + } + /** * Returns the naming scheme used to allocate logical IDs. By default, uses * the `HashedAddressingScheme` but this method can be overridden to customize @@ -743,28 +782,6 @@ export class Stack extends Construct implements ITaggable { } } - protected synthesize(session: ISynthesisSession): void { - // In principle, stack synthesis is delegated to the - // StackSynthesis object. - // - // However, some parts of synthesis currently use some private - // methods on Stack, and I don't really see the value in refactoring - // this right now, so some parts still happen here. - const builder = session.assembly; - - // write the CloudFormation template as a JSON file - const outPath = path.join(builder.outdir, this.templateFile); - const text = JSON.stringify(this._toCloudFormation(), undefined, 2); - fs.writeFileSync(outPath, text); - - for (const ctx of this._missingContext) { - builder.addMissing(ctx); - } - - // Delegate adding artifacts to the Synthesizer - this.synthesizer.synthesizeStackArtifacts(session); - } - /** * Returns the CloudFormation template for this stack by traversing * the tree and invoking _toCloudFormation() on all Entity objects. @@ -1057,20 +1074,6 @@ function makeStackName(components: string[]) { return makeUniqueId(components); } -// These imports have to be at the end to prevent circular imports -import { Arn, ArnComponents } from './arn'; -import { CfnElement } from './cfn-element'; -import { Fn } from './cfn-fn'; -import { Aws, ScopedAws } from './cfn-pseudo'; -import { CfnResource, TagType } from './cfn-resource'; -import { addDependency } from './deps'; -import { Reference } from './reference'; -import { IResolvable } from './resolvable'; -import { DefaultStackSynthesizer, IStackSynthesizer, LegacyStackSynthesizer } from './stack-synthesizers'; -import { Stage } from './stage'; -import { ITaggable, TagManager } from './tag-manager'; -import { Token } from './token'; - interface StackDependency { stack: Stack; reasons: string[]; diff --git a/packages/@aws-cdk/core/lib/stage.ts b/packages/@aws-cdk/core/lib/stage.ts index 59a466499bc9a..8678e7c1506b4 100644 --- a/packages/@aws-cdk/core/lib/stage.ts +++ b/packages/@aws-cdk/core/lib/stage.ts @@ -1,5 +1,5 @@ import * as cxapi from '@aws-cdk/cx-api'; -import { Construct, IConstruct } from './construct-compat'; +import { Construct, IConstruct } from 'constructs'; import { Environment } from './environment'; import { collectRuntimeInformation } from './private/runtime-info'; import { synthesize } from './private/synthesis'; @@ -143,6 +143,13 @@ export class Stage extends Construct { this.stageName = [ this.parentStage?.stageName, id ].filter(x => x).join('-'); } + /** + * The cloud assembly output directory. + */ + public get outdir() { + return this._assemblyBuilder.outdir; + } + /** * Artifact ID of the assembly if it is a nested stage. The root stage (app) * will return an empty string. diff --git a/packages/@aws-cdk/core/lib/synthesis.ts b/packages/@aws-cdk/core/lib/synthesis.ts new file mode 100644 index 0000000000000..c63de5620f781 --- /dev/null +++ b/packages/@aws-cdk/core/lib/synthesis.ts @@ -0,0 +1,39 @@ +import * as cxapi from '@aws-cdk/cx-api'; +import { IConstruct } from 'constructs'; +import { synthesize } from './private/synthesis'; + +/** + * 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; +} + +/** + * Allows synthesizing arbitrary CDK trees. + */ +export class Synthesis { + + /** + * Synthesizes the tree from `root` and returns the cloud assembly. + * @param root The root of the tree + * @param options Synthesis options. + */ + public static synthesize(root: IConstruct, options: SynthesisOptions) { + return synthesize(root, options); + } + + private constructor() { } +} \ No newline at end of file diff --git a/packages/@aws-cdk/core/lib/tag-aspect.ts b/packages/@aws-cdk/core/lib/tag-aspect.ts index a0c8445cd84a8..a98eb4aacd336 100644 --- a/packages/@aws-cdk/core/lib/tag-aspect.ts +++ b/packages/@aws-cdk/core/lib/tag-aspect.ts @@ -1,6 +1,6 @@ // import * as cxapi from '@aws-cdk/cx-api'; -import { IAspect } from './aspect'; -import { Construct, IConstruct } from './construct-compat'; +import { Construct, IConstruct } from 'constructs'; +import { Aspects, IAspect } from './aspect'; import { ITaggable, TagManager } from './tag-manager'; /** @@ -89,14 +89,14 @@ export class Tag extends TagBase { * add tags to the node of a construct and all its the taggable children */ public static add(scope: Construct, key: string, value: string, props: TagProps = {}) { - scope.node.applyAspect(new Tag(key, value, props)); + Aspects.of(scope).apply(new Tag(key, value, props)); } /** * remove tags to the node of a construct and all its the taggable children */ public static remove(scope: Construct, key: string, props: TagProps = {}) { - scope.node.applyAspect(new RemoveTag(key, props)); + Aspects.of(scope).apply(new RemoveTag(key, props)); } /** diff --git a/packages/@aws-cdk/core/lib/token.ts b/packages/@aws-cdk/core/lib/token.ts index c457e07e545d0..cb6bf669664de 100644 --- a/packages/@aws-cdk/core/lib/token.ts +++ b/packages/@aws-cdk/core/lib/token.ts @@ -1,4 +1,4 @@ -import { IConstruct } from './construct-compat'; +import { IConstruct } from 'constructs'; import { Lazy } from './lazy'; import { unresolved } from './private/encoding'; import { Intrinsic } from './private/intrinsic'; diff --git a/packages/@aws-cdk/core/lib/util.ts b/packages/@aws-cdk/core/lib/util.ts index 0855c5f16b7ac..aa3b812e217fa 100644 --- a/packages/@aws-cdk/core/lib/util.ts +++ b/packages/@aws-cdk/core/lib/util.ts @@ -1,4 +1,4 @@ -import { IConstruct } from './construct-compat'; +import { IConstruct } from 'constructs'; import { Intrinsic } from './private/intrinsic'; import { IPostProcessor, IResolveContext } from './resolvable'; import { Stack } from './stack'; diff --git a/packages/@aws-cdk/core/package.json b/packages/@aws-cdk/core/package.json index 4b660f4e83c42..9035a03160fda 100644 --- a/packages/@aws-cdk/core/package.json +++ b/packages/@aws-cdk/core/package.json @@ -170,7 +170,7 @@ "minimatch": "^3.0.4", "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "bundledDependencies": [ "fs-extra", @@ -180,7 +180,7 @@ "peerDependencies": { "@aws-cdk/cloud-assembly-schema": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/core/test/custom-resource-provider/test.custom-resource-provider.ts b/packages/@aws-cdk/core/test/custom-resource-provider/test.custom-resource-provider.ts index 47bdbce65e852..c135531757de2 100644 --- a/packages/@aws-cdk/core/test/custom-resource-provider/test.custom-resource-provider.ts +++ b/packages/@aws-cdk/core/test/custom-resource-provider/test.custom-resource-provider.ts @@ -1,7 +1,7 @@ import * as fs from 'fs'; import { Test } from 'nodeunit'; import * as path from 'path'; -import { CustomResourceProvider, CustomResourceProviderRuntime, Duration, Size, Stack } from '../../lib'; +import { App, CustomResourceProvider, CustomResourceProviderRuntime, Duration, Size, Stack } from '../../lib'; import { toCloudFormation } from '../util'; const TEST_HANDLER = `${__dirname}/mock-provider`; @@ -9,7 +9,8 @@ const TEST_HANDLER = `${__dirname}/mock-provider`; export = { 'minimal configuration'(test: Test) { // GIVEN - const stack = new Stack(); + const app = new App(); + const stack = new Stack(app, 'test'); // WHEN CustomResourceProvider.getOrCreate(stack, 'Custom:MyResourceType', { @@ -121,7 +122,8 @@ export = { 'policyStatements can be used to add statements to the inline policy'(test: Test) { // GIVEN - const stack = new Stack(); + const app = new App(); + const stack = new Stack(app, 'test'); // WHEN CustomResourceProvider.getOrCreate(stack, 'Custom:MyResourceType', { @@ -148,7 +150,8 @@ export = { 'memorySize and timeout'(test: Test) { // GIVEN - const stack = new Stack(); + const app = new App(); + const stack = new Stack(app, 'test'); // WHEN CustomResourceProvider.getOrCreate(stack, 'Custom:MyResourceType', { diff --git a/packages/@aws-cdk/core/test/private/test.tree-metadata.ts b/packages/@aws-cdk/core/test/private/test.tree-metadata.ts index a99090cc0b892..d462261ef80c8 100644 --- a/packages/@aws-cdk/core/test/private/test.tree-metadata.ts +++ b/packages/@aws-cdk/core/test/private/test.tree-metadata.ts @@ -1,8 +1,9 @@ import * as cxschema from '@aws-cdk/cloud-assembly-schema'; +import { Construct } from 'constructs'; import * as fs from 'fs'; import { Test } from 'nodeunit'; import * as path from 'path'; -import { App, CfnParameter, CfnResource, Construct, Lazy, Stack, TreeInspector } from '../../lib/index'; +import { App, CfnParameter, CfnResource, Lazy, Stack, TreeInspector } from '../../lib/index'; abstract class AbstractCfnResource extends CfnResource { constructor(scope: Construct, id: string) { diff --git a/packages/@aws-cdk/core/test/test.app.ts b/packages/@aws-cdk/core/test/test.app.ts index e127671529712..5a7aa6152a00b 100644 --- a/packages/@aws-cdk/core/test/test.app.ts +++ b/packages/@aws-cdk/core/test/test.app.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 { Test } from 'nodeunit'; -import { CfnResource, Construct, Stack, StackProps } from '../lib'; +import { CfnResource, Stack, StackProps } from '../lib'; import { App, AppProps } from '../lib/app'; function withApp(props: AppProps, block: (app: App) => void): cxapi.CloudAssembly { diff --git a/packages/@aws-cdk/core/test/test.aspect.ts b/packages/@aws-cdk/core/test/test.aspect.ts index 5c9a3ae9b57fe..b61ea6ef4850b 100644 --- a/packages/@aws-cdk/core/test/test.aspect.ts +++ b/packages/@aws-cdk/core/test/test.aspect.ts @@ -1,7 +1,6 @@ +import { Construct, IConstruct } from 'constructs'; import { Test } from 'nodeunit'; -import { App } from '../lib'; -import { IAspect } from '../lib/aspect'; -import { Construct, ConstructNode, IConstruct } from '../lib/construct-compat'; +import { App, Aspects, IAspect } from '../lib'; class MyConstruct extends Construct { public static IsMyConstruct(x: any): x is MyConstruct { @@ -18,13 +17,48 @@ class VisitOnce implements IAspect { } } export = { + 'Aspects.of(c) return an Aspects object'(test: Test) { + // GIVEN + const app = new App(); + const c = new Construct(app, 'foo'); + const visit1 = new VisitOnce(); + const visit2 = new VisitOnce(); + + // WHEN + const asp1 = Aspects.of(c); + asp1.apply(visit1); + asp1.apply(visit2); + + // THEN + test.equal(asp1.aspects.length, 2); + test.equal(asp1.aspects[0], visit1); + test.equal(asp1.aspects[1], visit2); + + test.done(); + }, + + 'Aspects.of(c) returns the same object every time'(test: Test) { + // GIVEN + const app = new App(); + const c = new Construct(app, 'foo'); + const a1 = Aspects.of(c); + + // WHEN + const a2 = Aspects.of(c); + + // THEN + test.equal(a1, a2); + test.done(); + }, + 'Aspects are invoked only once'(test: Test) { const app = new App(); const root = new MyConstruct(app, 'MyConstruct'); - root.node.applyAspect(new VisitOnce()); - ConstructNode.prepare(root.node); + Aspects.of(root).apply(new VisitOnce()); + + app.synth(); test.deepEqual(root.visitCounter, 1); - ConstructNode.prepare(root.node); + app.synth(); test.deepEqual(root.visitCounter, 1); test.done(); }, diff --git a/packages/@aws-cdk/core/test/test.cfn-json.ts b/packages/@aws-cdk/core/test/test.cfn-json.ts index 02d3187482490..0017618edeab0 100644 --- a/packages/@aws-cdk/core/test/test.cfn-json.ts +++ b/packages/@aws-cdk/core/test/test.cfn-json.ts @@ -58,7 +58,8 @@ export = { 'JSON.stringify() will return the CFN-stringified value to avoid circular references'(test: Test) { // GIVEN - const stack = new Stack(); + const app = new App(); + const stack = new Stack(app, 'test'); const res = new CfnResource(stack, 'MyResource', { type: 'Foo' }); const cfnjson = new CfnJson(stack, 'MyCfnJson', { value: { diff --git a/packages/@aws-cdk/core/test/test.construct.ts b/packages/@aws-cdk/core/test/test.construct.ts index 56ef04e1d1d5e..418b2e844bf25 100644 --- a/packages/@aws-cdk/core/test/test.construct.ts +++ b/packages/@aws-cdk/core/test/test.construct.ts @@ -1,6 +1,8 @@ import * as cxschema from '@aws-cdk/cloud-assembly-schema'; +import { Construct, ConstructOrder, IConstruct, IValidation } from 'constructs'; import { Test } from 'nodeunit'; -import { App as Root, Aws, Construct, ConstructNode, ConstructOrder, IConstruct, Lazy, ValidationError } from '../lib'; +import { App as Root } from '../lib'; +import { validateTree } from '../lib/private/synthesis'; import { reEnableStackTraceCollection, restoreStackTraceColection } from './util'; // tslint:disable:variable-name @@ -63,16 +65,6 @@ export = { test.done(); }, - 'dont allow unresolved tokens to be used in construct IDs'(test: Test) { - // GIVEN - const root = new Root(); - const token = Lazy.stringValue({ 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(); @@ -201,13 +193,6 @@ export = { 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, ''); @@ -252,7 +237,7 @@ export = { 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); @@ -261,7 +246,8 @@ export = { 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?.[0].indexOf('FIND_ME') !== -1, 'First stack line should include this function\s name'); test.done(); }, @@ -336,31 +322,31 @@ export = { // tslint:disable-next-line:max-line-length '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() { + class MyConstruct extends Construct implements IValidation { + public validate() { return [ 'my-error1', 'my-error2' ]; } } - class YourConstruct extends Construct { - protected validate() { + class YourConstruct extends Construct implements IValidation { + public validate() { return [ 'your-error1' ]; } } - class TheirConstruct extends Construct { + class TheirConstruct extends Construct implements IValidation { constructor(scope: Construct, id: string) { super(scope, id); new YourConstruct(this, 'YourConstruct'); } - protected validate() { + public validate() { return [ 'their-error' ]; } } - class TestStack extends Root { + class TestStack extends Root implements IValidation { constructor() { super(); @@ -368,22 +354,28 @@ export = { new TheirConstruct(this, 'TheirConstruct'); } - protected validate() { + public validate() { return [ 'stack-error' ]; } } const stack = new TestStack(); - const errors = ConstructNode.validate(stack.node).map((v: ValidationError) => ({ path: v.source.node.path, message: v.message })); + let actual; + try { + validateTree(stack); + } catch (e) { + // tslint:disable-next-line: no-console + actual = e.message.split('\n').map((s: string) => s.trim()); + } - // validate DFS - test.deepEqual(errors, [ - { 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' }, + test.deepEqual(actual, [ + 'Validation failed with the following errors:', + '[] stack-error', + '[MyConstruct] my-error1', + '[MyConstruct] my-error2', + '[TheirConstruct] their-error', + '[TheirConstruct/YourConstruct] your-error1', ]); test.done(); @@ -393,11 +385,11 @@ export = { class LockableConstruct extends Construct { public lockMe() { - (this.node._actualNode as any)._lock(); + this.node.lock(); } public unlockMe() { - (this.node._actualNode as any)._unlock(); + this.node.unlock(); } } diff --git a/packages/@aws-cdk/core/test/test.context.ts b/packages/@aws-cdk/core/test/test.context.ts index d83f41ba9feaf..2a33bb77e3408 100644 --- a/packages/@aws-cdk/core/test/test.context.ts +++ b/packages/@aws-cdk/core/test/test.context.ts @@ -1,6 +1,8 @@ +import { Construct } from 'constructs'; import { Test } from 'nodeunit'; -import { Construct, ConstructNode, Stack } from '../lib'; +import { App, Stack } from '../lib'; import { ContextProvider } from '../lib/context-provider'; +import { synthesize } from '../lib/private/synthesis'; export = { 'AvailabilityZoneProvider returns a list with dummy values if the context is not available'(test: Test) { @@ -144,7 +146,8 @@ export = { const contextKey = 'availability-zones:account=12345:region=us-east-1'; // Depends on the mangling algo // GIVEN - const stack = new Stack(undefined, 'TestStack', { env: { account: '12345', region: 'us-east-1' } }); + const app = new App(); + const stack = new Stack(app, 'TestStack', { env: { account: '12345', region: 'us-east-1' } }); // NOTE: error key is inlined here because it's part of the CX-API // compatibility surface. @@ -172,7 +175,7 @@ export = { * Get the expected context key from a stack with missing parameters */ function expectedContextKey(stack: Stack): string { - const missing = ConstructNode.synth(stack.node).manifest.missing; + const missing = synthesize(stack).manifest.missing; if (!missing || missing.length !== 1) { throw new Error('Expecting assembly to include a single missing context report'); } diff --git a/packages/@aws-cdk/core/test/test.cross-environment-token.ts b/packages/@aws-cdk/core/test/test.cross-environment-token.ts index 8ff06c04e8d81..64786be499274 100644 --- a/packages/@aws-cdk/core/test/test.cross-environment-token.ts +++ b/packages/@aws-cdk/core/test/test.cross-environment-token.ts @@ -1,5 +1,6 @@ +import { Construct } from 'constructs'; import { Test } from 'nodeunit'; -import { App, CfnOutput, CfnResource, Construct, PhysicalName, Resource, Stack } from '../lib'; +import { App, CfnOutput, CfnResource, PhysicalName, Resource, Stack } from '../lib'; import { toCloudFormation } from './util'; // tslint:disable:object-literal-key-quotes diff --git a/packages/@aws-cdk/core/test/test.logical-id.ts b/packages/@aws-cdk/core/test/test.logical-id.ts index 332dad2f14eba..c4abd05ec7374 100644 --- a/packages/@aws-cdk/core/test/test.logical-id.ts +++ b/packages/@aws-cdk/core/test/test.logical-id.ts @@ -1,5 +1,6 @@ +import { Construct } from 'constructs'; import { Test } from 'nodeunit'; -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/test.parameter.ts b/packages/@aws-cdk/core/test/test.parameter.ts index 3c136bd72f7a8..1b58891438f34 100644 --- a/packages/@aws-cdk/core/test/test.parameter.ts +++ b/packages/@aws-cdk/core/test/test.parameter.ts @@ -1,5 +1,6 @@ +import { Construct } from 'constructs'; import { Test } from 'nodeunit'; -import { CfnParameter, CfnResource, Construct, Stack } from '../lib'; +import { CfnParameter, CfnResource, Stack } from '../lib'; import { toCloudFormation } from './util'; export = { diff --git a/packages/@aws-cdk/core/test/test.resource.ts b/packages/@aws-cdk/core/test/test.resource.ts index 38c88d26deabb..b659b87c85277 100644 --- a/packages/@aws-cdk/core/test/test.resource.ts +++ b/packages/@aws-cdk/core/test/test.resource.ts @@ -1,8 +1,10 @@ import * as cxapi from '@aws-cdk/cx-api'; +import { Construct } from 'constructs'; import { Test } from 'nodeunit'; import { App, App as Root, CfnCondition, - CfnDeletionPolicy, CfnResource, Construct, ConstructNode, + CfnDeletionPolicy, CfnResource, Fn, RemovalPolicy, Stack } from '../lib'; +import { synthesize } from '../lib/private/synthesis'; import { toCloudFormation } from './util'; export = { @@ -131,7 +133,8 @@ export = { r2.node.addDependency(r1); r2.node.addDependency(r3); - ConstructNode.prepare(stack.node); + synthesize(stack); + test.deepEqual(toCloudFormation(stack), { Resources: { Counter1: { @@ -358,7 +361,8 @@ export = { dependingResource.node.addDependency(c1, c2); dependingResource.node.addDependency(c3); - ConstructNode.prepare(stack.node); + synthesize(stack); + test.deepEqual(toCloudFormation(stack), { Resources: { MyC1R1FB2A562F: { Type: 'T1' }, MyC1R2AE2B5066: { Type: 'T2' }, diff --git a/packages/@aws-cdk/core/test/test.stack.ts b/packages/@aws-cdk/core/test/test.stack.ts index 7f8e625ee4428..24d5e983af168 100644 --- a/packages/@aws-cdk/core/test/test.stack.ts +++ b/packages/@aws-cdk/core/test/test.stack.ts @@ -1,9 +1,11 @@ import * as cxapi from '@aws-cdk/cx-api'; +import { Construct } from 'constructs'; import { Test } from 'nodeunit'; import { App, CfnCondition, CfnInclude, CfnOutput, CfnParameter, - CfnResource, Construct, ConstructNode, Lazy, ScopedAws, Stack, Tag, validateString } from '../lib'; + CfnResource, Lazy, ScopedAws, Stack, Tag, validateString } from '../lib'; import { Intrinsic } from '../lib/private/intrinsic'; +import { resolveReferences } from '../lib/private/refs'; import { PostResolveToken } from '../lib/util'; import { toCloudFormation } from './util'; @@ -410,7 +412,8 @@ export = { new CfnTest(stack, 'MyThing', { type: 'AWS::Type' }); // THEN - ConstructNode.prepare(stack.node); + resolveReferences(app); + test.done(); }, @@ -524,7 +527,7 @@ export = { new CfnParameter(stack1, 'SomeParameter', { type: 'String', default: account2 }); test.throws(() => { - ConstructNode.prepare(app.node); + app.synth(); // tslint:disable-next-line:max-line-length }, "'Stack2' depends on 'Stack1' (Stack2/SomeParameter -> Stack1.AWS::AccountId). Adding this dependency (Stack1/SomeParameter -> Stack2.AWS::AccountId) would create a cyclic reference."); @@ -541,7 +544,7 @@ export = { // WHEN new CfnParameter(stack2, 'SomeParameter', { type: 'String', default: account1 }); - ConstructNode.prepare(app.node); + app.synth(); // THEN test.deepEqual(stack2.dependencies.map(s => s.node.id), ['Stack1']); @@ -560,7 +563,7 @@ export = { new CfnParameter(stack2, 'SomeParameter', { type: 'String', default: account1 }); test.throws(() => { - ConstructNode.prepare(app.node); + app.synth(); }, /Stack "Stack2" cannot consume a cross reference from stack "Stack1"/); test.done(); diff --git a/packages/@aws-cdk/core/test/test.stage.ts b/packages/@aws-cdk/core/test/test.stage.ts index 4f5e5f02d0542..5ec17f5d8a927 100644 --- a/packages/@aws-cdk/core/test/test.stage.ts +++ b/packages/@aws-cdk/core/test/test.stage.ts @@ -1,6 +1,7 @@ import * as cxapi from '@aws-cdk/cx-api'; +import { Construct, IConstruct } from 'constructs'; import { Test } from 'nodeunit'; -import { App, CfnResource, Construct, IAspect, IConstruct, Stack, Stage } from '../lib'; +import { App, Aspects, CfnResource, IAspect, Stack, Stage } from '../lib'; export = { 'Stack inherits unspecified part of the env from Stage'(test: Test) { @@ -118,28 +119,6 @@ export = { 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(); @@ -148,7 +127,7 @@ export = { // WHEN const aspect = new TouchingAspect(); - stack.node.applyAspect(aspect); + Aspects.of(stack).apply(aspect); // THEN app.synth(); @@ -168,7 +147,7 @@ export = { // WHEN const aspect = new TouchingAspect(); - app.node.applyAspect(aspect); + Aspects.of(app).apply(aspect); // THEN app.synth(); diff --git a/packages/@aws-cdk/core/test/test.staging.ts b/packages/@aws-cdk/core/test/test.staging.ts index 98e8f665de9b7..7f7c467dd937f 100644 --- a/packages/@aws-cdk/core/test/test.staging.ts +++ b/packages/@aws-cdk/core/test/test.staging.ts @@ -32,7 +32,8 @@ export = { 'base case'(test: Test) { // GIVEN - const stack = new Stack(); + const app = new App(); + const stack = new Stack(app, 'test'); const sourcePath = path.join(__dirname, 'fs', 'fixtures', 'test1'); // WHEN @@ -46,7 +47,8 @@ export = { 'staging can be disabled through context'(test: Test) { // GIVEN - const stack = new Stack(); + const app = new App(); + const stack = new Stack(app, 'test'); stack.node.setContext(cxapi.DISABLE_ASSET_STAGING_CONTEXT, true); const sourcePath = path.join(__dirname, 'fs', 'fixtures', 'test1'); diff --git a/packages/@aws-cdk/core/test/test.synthesis.ts b/packages/@aws-cdk/core/test/test.synthesis.ts index c0d598c0ee9b9..9ca4bcd81e09b 100644 --- a/packages/@aws-cdk/core/test/test.synthesis.ts +++ b/packages/@aws-cdk/core/test/test.synthesis.ts @@ -1,8 +1,6 @@ -import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import * as cxapi from '@aws-cdk/cx-api'; import * as fs from 'fs'; import { Test } from 'nodeunit'; -import * as os from 'os'; import * as path from 'path'; import * as cdk from '../lib'; @@ -66,103 +64,6 @@ export = { 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 { - constructor() { - super(undefined as any, 'id'); - } - - protected synthesize(session: cdk.ISynthesisSession) { - calls.push('synthesize'); - - session.assembly.addArtifact('art', { - type: cxschema.ArtifactType.AWS_CLOUDFORMATION_STACK, - properties: { - templateFile: 'hey.json', - parameters: { - paramId: 'paramValue', - paramId2: 'paramValue2', - }, - }, - environment: 'aws://unknown-account/us-east-1', - }); - - 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')) }); - - test.deepEqual(calls, [ 'prepare', 'validate', 'synthesize' ]); - const stack = assembly.getStackByName('art'); - test.deepEqual(stack.template, { hello: 123 }); - test.deepEqual(stack.templateFile, 'hey.json'); - test.deepEqual(stack.parameters, { paramId: 'paramValue', paramId2: 'paramValue2' }); - test.deepEqual(stack.environment, { region: 'us-east-1', account: 'unknown-account', name: 'aws://unknown-account/us-east-1' }); - test.done(); - }, }; function list(outdir: string) { @@ -172,7 +73,3 @@ function list(outdir: string) { function readJson(outdir: string, file: string) { return JSON.parse(fs.readFileSync(path.join(outdir, file), 'utf-8')); } - -function writeJson(outdir: string, file: string, data: any) { - fs.writeFileSync(path.join(outdir, file), JSON.stringify(data, undefined, 2)); -} diff --git a/packages/@aws-cdk/core/test/test.tag-aspect.ts b/packages/@aws-cdk/core/test/test.tag-aspect.ts index fd1b5e96f280d..02d34db170dbd 100644 --- a/packages/@aws-cdk/core/test/test.tag-aspect.ts +++ b/packages/@aws-cdk/core/test/test.tag-aspect.ts @@ -1,5 +1,7 @@ +import { Construct } from 'constructs'; import { Test } from 'nodeunit'; -import { CfnResource, CfnResourceProps, Construct, ConstructNode, RemoveTag, Stack, Tag, TagManager, TagType } from '../lib'; +import { App, Aspects, CfnResource, CfnResourceProps, RemoveTag, Stack, Tag, TagManager, TagType } from '../lib'; +import { synthesize } from '../lib/private/synthesis'; class TaggableResource extends CfnResource { public readonly tags: TagManager; @@ -39,7 +41,8 @@ class MapTaggableResource extends CfnResource { export = { 'Tag visit all children of the applied node'(test: Test) { - const root = new Stack(); + const app = new App(); + const root = new Stack(app, 'test'); const res = new TaggableResource(root, 'FakeResource', { type: 'AWS::Fake::Thing', }); @@ -53,9 +56,9 @@ export = { const map = new MapTaggableResource(res, 'MapFakeResource', { type: 'AWS::Fake::Thing', }); - res.node.applyAspect(new Tag('foo', 'bar')); + Aspects.of(res).apply(new Tag('foo', 'bar')); - ConstructNode.synth(root.node); + app.synth(); test.deepEqual(res.tags.renderTags(), [{key: 'foo', value: 'bar'}]); test.deepEqual(res2.tags.renderTags(), [{key: 'foo', value: 'bar'}]); @@ -71,11 +74,11 @@ export = { const res2 = new TaggableResource(res, 'FakeResource', { type: 'AWS::Fake::Thing', }); - res.node.applyAspect(new Tag('foo', 'bar')); - res.node.applyAspect(new Tag('foo', 'foobar')); - res.node.applyAspect(new Tag('foo', 'baz')); - res2.node.applyAspect(new Tag('foo', 'good')); - ConstructNode.prepare(root.node); + Aspects.of(res).apply(new Tag('foo', 'bar')); + Aspects.of(res).apply(new Tag('foo', 'foobar')); + Aspects.of(res).apply(new Tag('foo', 'baz')); + Aspects.of(res2).apply(new Tag('foo', 'good')); + synthesize(root); test.deepEqual(res.tags.renderTags(), [{key: 'foo', value: 'baz'}]); test.deepEqual(res2.tags.renderTags(), [{key: 'foo', value: 'good'}]); test.done(); @@ -95,11 +98,12 @@ export = { const map = new MapTaggableResource(res, 'MapFakeResource', { type: 'AWS::Fake::Thing', }); - root.node.applyAspect(new Tag('root', 'was here')); - res.node.applyAspect(new Tag('first', 'there is only 1')); - res.node.applyAspect(new RemoveTag('root')); - res.node.applyAspect(new RemoveTag('doesnotexist')); - ConstructNode.prepare(root.node); + Aspects.of(root).apply(new Tag('root', 'was here')); + Aspects.of(res).apply(new Tag('first', 'there is only 1')); + Aspects.of(res).apply(new RemoveTag('root')); + Aspects.of(res).apply(new RemoveTag('doesnotexist')); + + synthesize(root); test.deepEqual(res.tags.renderTags(), [{key: 'first', value: 'there is only 1'}]); test.deepEqual(map.tags.renderTags(), {first: 'there is only 1'}); @@ -126,7 +130,8 @@ export = { Tag.add(res, 'first', 'there is only 1'); Tag.remove(res, 'root'); Tag.remove(res, 'doesnotexist'); - ConstructNode.prepare(root.node); + + synthesize(root); test.deepEqual(res.tags.renderTags(), [{key: 'first', value: 'there is only 1'}]); test.deepEqual(map.tags.renderTags(), {first: 'there is only 1'}); @@ -140,12 +145,12 @@ export = { type: 'AWS::Fake::Thing', }); - res.node.applyAspect(new Tag('foo', 'bar')); - ConstructNode.prepare(root.node); + Aspects.of(res).apply(new Tag('foo', 'bar')); + synthesize(root); test.deepEqual(res.tags.renderTags(), [{key: 'foo', value: 'bar'}]); - ConstructNode.prepare(root.node); + synthesize(root); test.deepEqual(res.tags.renderTags(), [{key: 'foo', value: 'bar'}]); - ConstructNode.prepare(root.node); + synthesize(root); test.deepEqual(res.tags.renderTags(), [{key: 'foo', value: 'bar'}]); test.done(); }, @@ -157,9 +162,9 @@ export = { const res2 = new TaggableResource(res, 'FakeResource', { type: 'AWS::Fake::Thing', }); - res.node.applyAspect(new RemoveTag('key')); - res2.node.applyAspect(new Tag('key', 'value')); - ConstructNode.prepare(root.node); + Aspects.of(res).apply(new RemoveTag('key')); + Aspects.of(res2).apply(new Tag('key', 'value')); + synthesize(root); test.deepEqual(res.tags.renderTags(), undefined); test.deepEqual(res2.tags.renderTags(), undefined); test.done(); @@ -172,9 +177,9 @@ export = { const res2 = new TaggableResource(res, 'FakeResource', { type: 'AWS::Fake::Thing', }); - res.node.applyAspect(new RemoveTag('key', {priority: 0})); - res2.node.applyAspect(new Tag('key', 'value')); - ConstructNode.prepare(root.node); + Aspects.of(res).apply(new RemoveTag('key', {priority: 0})); + Aspects.of(res2).apply(new Tag('key', 'value')); + synthesize(root); test.deepEqual(res.tags.renderTags(), undefined); test.deepEqual(res2.tags.renderTags(), [{key: 'key', value: 'value'}]); test.done(); @@ -216,8 +221,8 @@ export = { ], }, }); - aspectBranch.node.applyAspect(new Tag('aspects', 'rule')); - ConstructNode.prepare(root.node); + Aspects.of(aspectBranch).apply(new Tag('aspects', 'rule')); + synthesize(root); test.deepEqual(aspectBranch.testProperties().tags, [{key: 'aspects', value: 'rule'}, {key: 'cfn', value: 'is cool'}]); test.deepEqual(asgResource.testProperties().tags, [ {key: 'aspects', value: 'rule', propagateAtLaunch: true}, diff --git a/packages/@aws-cdk/core/test/test.util.ts b/packages/@aws-cdk/core/test/test.util.ts index b9821868df432..98df1fb82d697 100644 --- a/packages/@aws-cdk/core/test/test.util.ts +++ b/packages/@aws-cdk/core/test/test.util.ts @@ -1,5 +1,6 @@ +import { Construct } from 'constructs'; import { Test, testCase } from 'nodeunit'; -import { CfnResource, Construct, Stack } from '../lib'; +import { CfnResource, Stack } from '../lib'; import { capitalizePropertyNames, filterUndefined, findLastCommonElement, ignoreEmpty, pathToTopLevelStack } from '../lib/util'; export = testCase({ diff --git a/packages/@aws-cdk/core/test/util.ts b/packages/@aws-cdk/core/test/util.ts index b10c547de6f65..8378d5ad26a3e 100644 --- a/packages/@aws-cdk/core/test/util.ts +++ b/packages/@aws-cdk/core/test/util.ts @@ -1,7 +1,8 @@ -import { ConstructNode, Stack } from '../lib'; +import { Stack } from '../lib'; +import { synthesize } from '../lib/private/synthesis'; export function toCloudFormation(stack: Stack): any { - return ConstructNode.synth(stack.node, { skipValidation: true }).getStackByName(stack.stackName).template; + return synthesize(stack, { skipValidation: true }).getStackByName(stack.stackName).template; } export function reEnableStackTraceCollection(): any { 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 8c56de166305e..03b248a35df77 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 @@ -2,6 +2,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 * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as fs from 'fs'; import * as path from 'path'; @@ -253,7 +254,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 cdk.Construct implements iam.IGrantable { +export class AwsCustomResource extends Construct implements iam.IGrantable { private static breakIgnoreErrorsCircuit(sdkCalls: Array, caller: string) { @@ -272,7 +273,7 @@ export class AwsCustomResource extends cdk.Construct implements iam.IGrantable { // 'props' cannot be optional, even though all its properties are optional. // this is because at least one sdk call must be provided. - constructor(scope: cdk.Construct, id: string, props: AwsCustomResourceProps) { + constructor(scope: Construct, id: string, props: AwsCustomResourceProps) { super(scope, id); if (!props.onCreate && !props.onUpdate && !props.onDelete) { 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 e420c5c6e8c38..ed6179d134165 100644 --- a/packages/@aws-cdk/custom-resources/lib/provider-framework/provider.ts +++ b/packages/@aws-cdk/custom-resources/lib/provider-framework/provider.ts @@ -1,6 +1,7 @@ import * as cfn from '@aws-cdk/aws-cloudformation'; import * as lambda from '@aws-cdk/aws-lambda'; -import { Construct, Duration } from '@aws-cdk/core'; +import { Duration } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as path from 'path'; import * as consts from './runtime/consts'; import { calculateRetryPolicy } from './util'; 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 f35bce528d366..6dff1ef43268a 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 @@ -1,6 +1,7 @@ import { Grant, IGrantable, PolicyStatement, Role, ServicePrincipal } from '@aws-cdk/aws-iam'; import { IFunction } from '@aws-cdk/aws-lambda'; -import { CfnResource, Construct, Duration, Stack } from '@aws-cdk/core'; +import { CfnResource, Duration, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; export interface WaiterStateMachineProps { /** diff --git a/packages/@aws-cdk/custom-resources/package.json b/packages/@aws-cdk/custom-resources/package.json index b02ea6ad17d04..18a0656d170fa 100644 --- a/packages/@aws-cdk/custom-resources/package.json +++ b/packages/@aws-cdk/custom-resources/package.json @@ -90,7 +90,7 @@ "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -100,7 +100,7 @@ "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/custom-resources/test/provider-framework/integ.provider.ts b/packages/@aws-cdk/custom-resources/test/provider-framework/integ.provider.ts index e628938673c2c..fd2eb9356b74a 100644 --- a/packages/@aws-cdk/custom-resources/test/provider-framework/integ.provider.ts +++ b/packages/@aws-cdk/custom-resources/test/provider-framework/integ.provider.ts @@ -1,7 +1,8 @@ /// !cdk-integ * import * as s3 from '@aws-cdk/aws-s3'; -import { App, CfnOutput, Construct, Stack } from '@aws-cdk/core'; +import { App, CfnOutput, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { S3Assert } from './integration-test-fixtures/s3-assert'; import { S3File } from './integration-test-fixtures/s3-file'; 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 06a5181053007..427a0139f0107 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 @@ -1,7 +1,8 @@ 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 { Construct, CustomResource, Duration, Stack } from '@aws-cdk/core'; +import { CustomResource, Duration, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as path from 'path'; import * as cr from '../../../lib'; 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 a2764f97541ef..f62eb500b03e8 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 @@ -1,7 +1,8 @@ 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 { Construct, CustomResource, Stack } from '@aws-cdk/core'; +import { CustomResource, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as path from 'path'; import * as cr from '../../../lib'; import * as api from './s3-file-handler/api'; diff --git a/packages/@aws-cdk/example-construct-library/lib/example-resource.ts b/packages/@aws-cdk/example-construct-library/lib/example-resource.ts index f2ad8ea9e2807..9e347a869ac91 100644 --- a/packages/@aws-cdk/example-construct-library/lib/example-resource.ts +++ b/packages/@aws-cdk/example-construct-library/lib/example-resource.ts @@ -12,6 +12,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 core from '@aws-cdk/core'; +import { Construct } from 'constructs'; // for files that are part of this package, we do import individual classes or functions import { exampleResourceArnComponents } from './private/example-resource-common'; @@ -347,7 +348,7 @@ export class ExampleResource extends ExampleResourceBase { * or fromExampleResourceAttributes * (the last one if you want the importing behavior to be more customizable). */ - public static fromExampleResourceName(scope: core.Construct, id: string, exampleResourceName: string): IExampleResource { + public static fromExampleResourceName(scope: Construct, id: string, exampleResourceName: string): IExampleResource { // Imports are almost always implemented as a module-private // inline class in the method itself. // We extend ExampleResourceBase to reuse all of the logic inside it. @@ -388,7 +389,7 @@ export class ExampleResource extends ExampleResourceBase { * If the props only have optional properties, like in our case, * make sure to add a default value of an empty object to the props argument. */ - constructor(scope: core.Construct, id: string, props: ExampleResourceProps = {}) { + constructor(scope: Construct, id: string, props: ExampleResourceProps = {}) { // Call the constructor from Resource superclass, // which attaches this construct to the construct tree. super(scope, id, { diff --git a/packages/@aws-cdk/example-construct-library/package.json b/packages/@aws-cdk/example-construct-library/package.json index 49046856a2fbe..ac1b68f7bf2b9 100644 --- a/packages/@aws-cdk/example-construct-library/package.json +++ b/packages/@aws-cdk/example-construct-library/package.json @@ -73,7 +73,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -83,7 +83,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@monocdk-experiment/assert/package.json b/packages/@monocdk-experiment/assert/package.json index 6a923bd5971a3..fdf560e3046a1 100644 --- a/packages/@monocdk-experiment/assert/package.json +++ b/packages/@monocdk-experiment/assert/package.json @@ -44,7 +44,7 @@ "ts-jest": "^26.1.1", "@monocdk-experiment/rewrite-imports": "0.0.0", "monocdk-experiment": "0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "dependencies": { "@aws-cdk/cloudformation-diff": "0.0.0" @@ -52,7 +52,7 @@ "peerDependencies": { "jest": "^25.5.4", "monocdk-experiment": "^0.0.0", - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "repository": { "url": "https://github.com/aws/aws-cdk.git", diff --git a/packages/aws-cdk/lib/init-templates/app/typescript/lib/%name%-stack.template.ts b/packages/aws-cdk/lib/init-templates/app/typescript/lib/%name%-stack.template.ts index 80fa43a59ea24..0a5b7739b420c 100644 --- a/packages/aws-cdk/lib/init-templates/app/typescript/lib/%name%-stack.template.ts +++ b/packages/aws-cdk/lib/init-templates/app/typescript/lib/%name%-stack.template.ts @@ -1,7 +1,8 @@ import * as cdk from '@aws-cdk/core'; +import { Construct } from 'construct'; export class %name.PascalCased%Stack extends cdk.Stack { - constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) { + constructor(scope: Construct, id: string, props?: cdk.StackProps) { super(scope, id, props); // The code that defines your stack goes here diff --git a/packages/aws-cdk/lib/init-templates/lib/typescript/lib/index.template.ts b/packages/aws-cdk/lib/init-templates/lib/typescript/lib/index.template.ts index 00b081cfb75df..b34595fcc8ab1 100644 --- a/packages/aws-cdk/lib/init-templates/lib/typescript/lib/index.template.ts +++ b/packages/aws-cdk/lib/init-templates/lib/typescript/lib/index.template.ts @@ -2,6 +2,7 @@ import * as sns from '@aws-cdk/aws-sns'; import * as subs from '@aws-cdk/aws-sns-subscriptions'; import * as sqs from '@aws-cdk/aws-sqs'; import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; export interface %name.PascalCased%Props { /** @@ -12,11 +13,11 @@ export interface %name.PascalCased%Props { visibilityTimeout?: cdk.Duration; } -export class %name.PascalCased% extends cdk.Construct { +export class %name.PascalCased% extends Construct { /** @returns the ARN of the SQS queue */ public readonly queueArn: string; - constructor(scope: cdk.Construct, id: string, props: %name.PascalCased%Props = {}) { + constructor(scope: Construct, id: string, props: %name.PascalCased%Props = {}) { super(scope, id); const queue = new sqs.Queue(this, '%name.PascalCased%Queue', { diff --git a/packages/awslint/lib/rules/construct.ts b/packages/awslint/lib/rules/construct.ts index 9ec81754cfd0a..950b97dfc0775 100644 --- a/packages/awslint/lib/rules/construct.ts +++ b/packages/awslint/lib/rules/construct.ts @@ -24,7 +24,7 @@ export class ConstructReflection { return typeRef.fqn; } - public readonly ROOT_CLASS: reflect.ClassType; // cdk.Construct + public readonly ROOT_CLASS: reflect.ClassType; // constructs.Construct public readonly fqn: string; public readonly interfaceFqn: string; diff --git a/packages/awslint/lib/rules/core-types.ts b/packages/awslint/lib/rules/core-types.ts index 545d8165574b4..4437d9b1ac816 100644 --- a/packages/awslint/lib/rules/core-types.ts +++ b/packages/awslint/lib/rules/core-types.ts @@ -1,12 +1,11 @@ import * as reflect from 'jsii-reflect'; -import { TypeSystem } from "jsii-reflect"; import { getDocTag } from "./util"; const CORE_MODULE = "@aws-cdk/core"; enum CoreTypesFqn { CfnResource = "@aws-cdk/core.CfnResource", - Construct = "@aws-cdk/core.Construct", - ConstructInterface = "@aws-cdk/core.IConstruct", + Construct = "constructs.Construct", + ConstructInterface = "constructs.IConstruct", Resource = "@aws-cdk/core.Resource", ResourceInterface = "@aws-cdk/core.IResource", ResolvableInterface = "@aws-cdk/core.IResolvable", @@ -124,7 +123,7 @@ export class CoreTypes { return this.sys.findClass(CoreTypesFqn.PhysicalName); } - private readonly sys: TypeSystem; + private readonly sys: reflect.TypeSystem; constructor(sys: reflect.TypeSystem) { this.sys = sys; diff --git a/packages/cdk-dasm/README.md b/packages/cdk-dasm/README.md index 83f2f774100ee..4c3ce8f43384d 100644 --- a/packages/cdk-dasm/README.md +++ b/packages/cdk-dasm/README.md @@ -112,7 +112,8 @@ The output will be: ```ts // generated by cdk-dasm at 2019-08-07T02:52:01.561Z -import { Stack, StackProps, Construct, Fn } from '@aws-cdk/core'; +import { Stack, StackProps, Fn } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as sns from '@aws-cdk/aws-sns'; export class MyStack extends Stack { diff --git a/packages/cdk-dasm/lib/dasm.ts b/packages/cdk-dasm/lib/dasm.ts index 6a9296cb3381d..8610085182aba 100644 --- a/packages/cdk-dasm/lib/dasm.ts +++ b/packages/cdk-dasm/lib/dasm.ts @@ -53,7 +53,8 @@ export async function dasmTypeScript(template: Template, options: DisassemblerOp // imports // - code.line(`import { Stack, StackProps, Construct, Fn } from '@aws-cdk/core';`); + code.line(`import { Stack, StackProps, Fn } from '@aws-cdk/core';`); + code.line(`import { Construct } from 'constructs';`); for (const ns of getUniqueNamespaces(definitions)) { const importName = `@aws-cdk/aws-${ns}`; @@ -143,7 +144,7 @@ function toCfnClassName(resourceType: string) { return { namespace: namespace.toLocaleLowerCase(), className }; } -function getUniqueNamespaces(definitions: Array): String[] { +function getUniqueNamespaces(definitions: ConstructDefinition[]): String[] { return [... new Set(definitions.map(definition => definition.namespace))]; } diff --git a/packages/cdk-dasm/test/__snapshots__/dasm.test.js.snap b/packages/cdk-dasm/test/__snapshots__/dasm.test.js.snap index f60789d33eb01..46e4e6a312ce2 100644 --- a/packages/cdk-dasm/test/__snapshots__/dasm.test.js.snap +++ b/packages/cdk-dasm/test/__snapshots__/dasm.test.js.snap @@ -3,7 +3,8 @@ exports[`basic test 1`] = ` "// generated by cdk-dasm -import { Stack, StackProps, Construct, Fn } from '@aws-cdk/core'; +import { Stack, StackProps, Fn } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import sns = require('@aws-cdk/aws-sns'); export class MyStack extends Stack { @@ -20,7 +21,8 @@ export class MyStack extends Stack { exports[`bucket-and-key 1`] = ` "// generated by cdk-dasm -import { Stack, StackProps, Construct, Fn } from '@aws-cdk/core'; +import { Stack, StackProps, Fn } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import kms = require('@aws-cdk/aws-kms'); import s3 = require('@aws-cdk/aws-s3'); import cdk = require('@aws-cdk/aws-cdk'); @@ -100,7 +102,8 @@ export class MyStack extends Stack { exports[`multiple of same type 1`] = ` "// generated by cdk-dasm -import { Stack, StackProps, Construct, Fn } from '@aws-cdk/core'; +import { Stack, StackProps, Fn } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import sns = require('@aws-cdk/aws-sns'); export class MyStack extends Stack { @@ -120,7 +123,8 @@ export class MyStack extends Stack { exports[`no props 1`] = ` "// generated by cdk-dasm -import { Stack, StackProps, Construct, Fn } from '@aws-cdk/core'; +import { Stack, StackProps, Fn } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import s3 = require('@aws-cdk/aws-s3'); export class MyStack extends Stack { diff --git a/packages/decdk/lib/cdk-schema.ts b/packages/decdk/lib/cdk-schema.ts index 329fcbead9e33..2ae4d86803603 100644 --- a/packages/decdk/lib/cdk-schema.ts +++ b/packages/decdk/lib/cdk-schema.ts @@ -22,7 +22,7 @@ export function renderFullSchema(typeSystem: jsiiReflect.TypeSystem, options: Re // Find all constructs for which the props interface // (transitively) only consists of JSON primitives or interfaces // that consist of JSON primitives - const constructType = typeSystem.findClass('@aws-cdk/core.Construct'); + const constructType = typeSystem.findClass('constructs.Construct'); const constructs = typeSystem.classes.filter(c => c.extends(constructType)); const deconstructs = constructs diff --git a/packages/decdk/lib/jsii2schema.ts b/packages/decdk/lib/jsii2schema.ts index a20cb30ade966..c3542934877b9 100644 --- a/packages/decdk/lib/jsii2schema.ts +++ b/packages/decdk/lib/jsii2schema.ts @@ -557,15 +557,15 @@ export function isConstruct(typeOrTypeRef: jsiiReflect.TypeReference | jsiiRefle } } - // if it is an interface, it should extend cdk.IConstruct + // if it is an interface, it should extend constructs.IConstruct if (type instanceof jsiiReflect.InterfaceType) { - const constructIface = type.system.findFqn('@aws-cdk/core.IConstruct'); + const constructIface = type.system.findFqn('constructs.IConstruct'); return type.extends(constructIface); } - // if it is a class, it should extend cdk.Construct + // if it is a class, it should extend constructs.Construct if (type instanceof jsiiReflect.ClassType) { - const constructClass = type.system.findFqn('@aws-cdk/core.Construct'); + const constructClass = type.system.findFqn('constructs.Construct'); return type.extends(constructClass); } diff --git a/packages/decdk/package.json b/packages/decdk/package.json index 59b0ad777f07e..b6d2b3ca7c751 100644 --- a/packages/decdk/package.json +++ b/packages/decdk/package.json @@ -176,7 +176,7 @@ "@aws-cdk/custom-resources": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "^3.0.2", + "constructs": "4.1.1-pre.0", "fs-extra": "^9.0.1", "jsii-reflect": "^1.7.0", "jsonschema": "^1.2.6", diff --git a/packages/monocdk-experiment/package.json b/packages/monocdk-experiment/package.json index 71a5dd88067b3..2f3ab6e0c7b6b 100644 --- a/packages/monocdk-experiment/package.json +++ b/packages/monocdk-experiment/package.json @@ -91,7 +91,7 @@ ], "dependencies": { "case": "1.6.3", - "constructs": "^3.0.2", + "constructs": "4.1.1-pre.0", "fs-extra": "^9.0.1", "jsonschema": "^1.2.5", "minimatch": "^3.0.4", @@ -257,7 +257,7 @@ "typescript": "~3.8.3" }, "peerDependencies": { - "constructs": "^3.0.2" + "constructs": "4.1.1-pre.0" }, "homepage": "https://github.com/aws/aws-cdk", "engines": { diff --git a/scripts/build-typescript.sh b/scripts/build-typescript.sh index eb2972c2e5a64..0c7c38c886f9f 100755 --- a/scripts/build-typescript.sh +++ b/scripts/build-typescript.sh @@ -1,2 +1,6 @@ #!/bin/bash +set -euo pipefail +scriptdir="$(cd $(dirname $0) && pwd)" +${scriptdir}/generate-aggregate-tsconfig.sh > ${scriptdir}/../tsconfig.json +cd ${scriptdir}/.. node_modules/.bin/tsc -b "$@" diff --git a/tools/cfn2ts/lib/codegen.ts b/tools/cfn2ts/lib/codegen.ts index ff87f6a178222..2022efef7157f 100644 --- a/tools/cfn2ts/lib/codegen.ts +++ b/tools/cfn2ts/lib/codegen.ts @@ -4,10 +4,11 @@ import * as genspec from './genspec'; import { itemTypeNames, PropertyAttributeName, scalarTypeNames, SpecName } from './spec-utils'; import { upcaseFirst } from './util'; +const CONSTRUCTS = genspec.CONSTRUCTS_NAMESPACE; const CORE = genspec.CORE_NAMESPACE; const CFN_PARSE = genspec.CFN_PARSE_NAMESPACE; const RESOURCE_BASE_CLASS = `${CORE}.CfnResource`; // base class for all resources -const CONSTRUCT_CLASS = `${CORE}.Construct`; +const CONSTRUCT_CLASS = `${CONSTRUCTS}.Construct`; const TAG_TYPE = `${CORE}.TagType`; const TAG_MANAGER = `${CORE}.TagManager`; @@ -56,8 +57,11 @@ export default class CodeGenerator { this.code.line(`// @cfn2ts:meta@ ${JSON.stringify(meta)}`); this.code.line(); this.code.line('// tslint:disable:max-line-length | This is generated code - line lengths are difficult to control'); + this.code.line('// tslint:disable:ordered-imports'); this.code.line(); this.code.line(`import * as ${CORE} from '${coreImport}';`); + this.code.line(`import * as ${CONSTRUCTS} from 'constructs';`); + // explicitly import the cfn-parse.ts file from @core, which is not part of the public API of the module this.code.line(`import * as ${CFN_PARSE} from '${coreImport}/${coreImport === '.' ? '' : 'lib/'}cfn-parse';`); } diff --git a/tools/cfn2ts/lib/genspec.ts b/tools/cfn2ts/lib/genspec.ts index 63df05ef82115..33a945c6c860e 100644 --- a/tools/cfn2ts/lib/genspec.ts +++ b/tools/cfn2ts/lib/genspec.ts @@ -9,6 +9,7 @@ import * as util from './util'; const RESOURCE_CLASS_PREFIX = 'Cfn'; +export const CONSTRUCTS_NAMESPACE = 'constructs'; export const CORE_NAMESPACE = 'cdk'; export const CFN_PARSE_NAMESPACE = 'cfn_parse'; diff --git a/tools/pkglint/lib/rules.ts b/tools/pkglint/lib/rules.ts index f47154f7c1181..4694d6cf43ad9 100644 --- a/tools/pkglint/lib/rules.ts +++ b/tools/pkglint/lib/rules.ts @@ -1219,7 +1219,7 @@ export class ConstructsDependency extends ValidationRule { public readonly name = 'constructs/dependency'; public validate(pkg: PackageJson) { - const REQUIRED_VERSION = '^3.0.2'; + const REQUIRED_VERSION = '4.1.1-pre.0'; if (pkg.devDependencies?.constructs && pkg.devDependencies?.constructs !== REQUIRED_VERSION) { pkg.report({ diff --git a/yarn.lock b/yarn.lock index 982df84b248d3..1d8ba8497d5c6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1901,6 +1901,11 @@ anymatch@^3.0.3: normalize-path "^3.0.0" picomatch "^2.0.4" +app-root-path@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-2.2.1.tgz#d0df4a682ee408273583d43f6f79e9892624bc9a" + integrity sha512-91IFKeKk7FjfmezPKkwtaRvSpnUc4gDwPAjA1YZ9Gn0q0PPeW+vbeUsZuyDwjI7+QTHhcLen2v25fi/AmhvbJA== + append-transform@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-1.0.0.tgz#046a52ae582a228bd72f58acfbe2967c678759ab" @@ -2129,7 +2134,7 @@ available-typed-arrays@^1.0.0, available-typed-arrays@^1.0.2: dependencies: array-filter "^1.0.0" -aws-sdk-mock@^5.1.0: +aws-sdk-mock@^5.0.0, aws-sdk-mock@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/aws-sdk-mock/-/aws-sdk-mock-5.1.0.tgz#6f2c0bd670d7f378c906a8dd806f812124db71aa" integrity sha512-Wa5eCSo8HX0Snqb7FdBylaXMmfrAWoWZ+d7MFhiYsgHPvNvMEGjV945FF2qqE1U0Tolr1ALzik1fcwgaOhqUWQ== @@ -2138,7 +2143,7 @@ aws-sdk-mock@^5.1.0: sinon "^9.0.1" traverse "^0.6.6" -aws-sdk@^2.637.0, aws-sdk@^2.709.0: +aws-sdk@^2.596.0, aws-sdk@^2.637.0, aws-sdk@^2.709.0: version "2.709.0" resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.709.0.tgz#33b0c0fe8b9420c65610545394be047ac2d93c8f" integrity sha512-F3sKXsCiutj9RglVXdqb/XJ3Ko3G+pX081Nf1YjVJpLydwE2v16FGxrLqE5pqyWMDeUf5nZHnBoMuOYD8ip+Kw== @@ -2845,10 +2850,10 @@ console-control-strings@^1.0.0, console-control-strings@~1.1.0: resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= -constructs@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/constructs/-/constructs-3.0.2.tgz#49432ba2ef765445bddd5fcc5b3948903ec5210b" - integrity sha512-Q4SkOFaRH2D65kvcGrDZ/FgJwk59HwUohbdCbeIueas+8RJhd9N4j6QgvHnMfTOmQWDPXCn1IGwteTLC0OK1NA== +constructs@4.1.1-pre.0: + version "4.1.1-pre.0" + resolved "https://registry.yarnpkg.com/constructs/-/constructs-4.1.1-pre.0.tgz#915db03813f499047ca78bb72fd64d0f6cc640e6" + integrity sha512-Mfzy7e7CdPHNrpVFklsdBqS80IVqEcG9JCI3DE0+hMMFfmHQn8WOXlZccrtE+XOv7HTj2jXUBdVAMKKyefBeVg== contains-path@^0.1.0: version "0.1.0" @@ -3660,6 +3665,16 @@ dot-prop@^4.2.0: dependencies: is-obj "^1.0.0" +dotenv-json@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/dotenv-json/-/dotenv-json-1.0.0.tgz#fc7f672aafea04bed33818733b9f94662332815c" + integrity sha512-jAssr+6r4nKhKRudQ0HOzMskOFFi9+ubXWwmrSGJFgTvpjyPXCXsCsYbjif6mXp7uxA7xY3/LGaiTQukZzSbOQ== + +dotenv@^8.0.0: + version "8.2.0" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.2.0.tgz#97e619259ada750eea3e4ea3e26bceea5424b16a" + integrity sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw== + dotgitignore@2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/dotgitignore/-/dotgitignore-2.1.0.tgz#a4b15a4e4ef3cf383598aaf1dfa4a04bcc089b7b" @@ -3842,6 +3857,11 @@ escodegen@1.x.x, escodegen@^1.11.1: optionalDependencies: source-map "~0.6.1" +eslint-config-standard@^14.1.0: + version "14.1.1" + resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-14.1.1.tgz#830a8e44e7aef7de67464979ad06b406026c56ea" + integrity sha512-Z9B+VR+JIXRxz21udPTL9HpFMyoMUEeX1G251EQ6e05WD9aPVtVBn09XUmZ259wCMlCDmYDSZG62Hhm+ZTJcUg== + eslint-import-resolver-node@^0.3.3, eslint-import-resolver-node@^0.3.4: version "0.3.4" resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz#85ffa81942c25012d8231096ddf679c03042c717" @@ -3869,7 +3889,15 @@ eslint-module-utils@^2.6.0: debug "^2.6.9" pkg-dir "^2.0.0" -eslint-plugin-import@^2.22.0: +eslint-plugin-es@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-es/-/eslint-plugin-es-2.0.0.tgz#0f5f5da5f18aa21989feebe8a73eadefb3432976" + integrity sha512-f6fceVtg27BR02EYnBhgWLFQfK6bN4Ll0nQFrBHOlCsAyxeZkn0NHns5O0YZOPrV1B3ramd6cgFwaoFLcSkwEQ== + dependencies: + eslint-utils "^1.4.2" + regexpp "^3.0.0" + +eslint-plugin-import@^2.19.1, eslint-plugin-import@^2.22.0: version "2.22.0" resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.22.0.tgz#92f7736fe1fde3e2de77623c838dd992ff5ffb7e" integrity sha512-66Fpf1Ln6aIS5Gr/55ts19eUuoDhAbZgnr6UxK5hbDx6l/QgQgx61AePq+BV4PP2uXQFClgMVzep5zZ94qqsxg== @@ -3888,6 +3916,28 @@ eslint-plugin-import@^2.22.0: resolve "^1.17.0" tsconfig-paths "^3.9.0" +eslint-plugin-node@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-10.0.0.tgz#fd1adbc7a300cf7eb6ac55cf4b0b6fc6e577f5a6" + integrity sha512-1CSyM/QCjs6PXaT18+zuAXsjXGIGo5Rw630rSKwokSs2jrYURQc4R5JZpoanNCqwNmepg+0eZ9L7YiRUJb8jiQ== + dependencies: + eslint-plugin-es "^2.0.0" + eslint-utils "^1.4.2" + ignore "^5.1.1" + minimatch "^3.0.4" + resolve "^1.10.1" + semver "^6.1.0" + +eslint-plugin-promise@^4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-4.2.1.tgz#845fd8b2260ad8f82564c1222fce44ad71d9418a" + integrity sha512-VoM09vT7bfA7D+upt+FjeBO5eHIJQBUWki1aPvB+vbNiHS3+oGIJGIeyBtKQTME6UPXXy3vV07OL1tHd3ANuDw== + +eslint-plugin-standard@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-standard/-/eslint-plugin-standard-4.0.1.tgz#ff0519f7ffaff114f76d1bd7c3996eef0f6e20b4" + integrity sha512-v/KBnfyaOMPmZc/dmc6ozOdWqekGp7bBGq4jLAecEfPGmfKiWS4sA8sC0LqiV9w5qmXAtXVn4M3p1jSyhY85SQ== + eslint-scope@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.0.0.tgz#e87c8887c73e8d1ec84f1ca591645c358bfc8fb9" @@ -3896,7 +3946,7 @@ eslint-scope@^5.0.0: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-utils@^1.4.3: +eslint-utils@^1.4.2, eslint-utils@^1.4.3: version "1.4.3" resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.3.tgz#74fec7c54d0776b6f67e0251040b5806564e981f" integrity sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q== @@ -4954,6 +5004,11 @@ ignore@^4.0.3, ignore@^4.0.6: resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== +ignore@^5.1.1: + version "5.1.8" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" + integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== + immediate@~3.0.5: version "3.0.6" resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" @@ -5916,7 +5971,7 @@ jest-worker@^25.5.0: merge-stream "^2.0.0" supports-color "^7.0.0" -jest@^25.4.0, jest@^25.5.2, jest@^25.5.3, jest@^25.5.4: +jest@^25.4.0, jest@^25.5.0, jest@^25.5.2, jest@^25.5.3, jest@^25.5.4: version "25.5.4" resolved "https://registry.yarnpkg.com/jest/-/jest-25.5.4.tgz#f21107b6489cfe32b076ce2adcadee3587acb9db" integrity sha512-hHFJROBTqZahnO+X+PMtT6G2/ztqAZJveGqz//FnWWHurizkD05PQGzRZOhF3XP6z7SJmL+5tCfW8qV06JypwQ== @@ -6201,6 +6256,24 @@ kleur@^3.0.3: resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== +lambda-leak@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lambda-leak/-/lambda-leak-2.0.0.tgz#771985d3628487f6e885afae2b54510dcfb2cd7e" + integrity sha1-dxmF02KEh/boha+uK1RRDc+yzX4= + +lambda-tester@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/lambda-tester/-/lambda-tester-3.6.0.tgz#ceb7d4f4f0da768487a05cff37dcd088508b5247" + integrity sha512-F2ZTGWCLyIR95o/jWK46V/WnOCFAEUG/m/V7/CLhPJ7PCM+pror1rZ6ujP3TkItSGxUfpJi0kqwidw+M/nEqWw== + dependencies: + app-root-path "^2.2.1" + dotenv "^8.0.0" + dotenv-json "^1.0.0" + lambda-leak "^2.0.0" + semver "^6.1.1" + uuid "^3.3.2" + vandium-utils "^1.1.1" + lazystream@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lazystream/-/lazystream-1.0.0.tgz#f6995fe0f820392f61396be89462407bb77168e4" @@ -6806,7 +6879,7 @@ mkdirp@*, mkdirp@1.x: resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== -mkdirp@^0.5.0, mkdirp@^0.5.1: +mkdirp@0.x, mkdirp@^0.5.0, mkdirp@^0.5.1: version "0.5.5" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== @@ -6937,6 +7010,17 @@ nise@^4.0.1: just-extend "^4.0.2" path-to-regexp "^1.7.0" +nock@^11.7.0: + version "11.9.1" + resolved "https://registry.yarnpkg.com/nock/-/nock-11.9.1.tgz#2b026c5beb6d0dbcb41e7e4cefa671bc36db9c61" + integrity sha512-U5wPctaY4/ar2JJ5Jg4wJxlbBfayxgKbiAeGh+a1kk6Pwnc2ZEuKviLyDSG6t0uXl56q7AALIxoM6FJrBSsVXA== + dependencies: + debug "^4.1.0" + json-stringify-safe "^5.0.1" + lodash "^4.17.13" + mkdirp "^0.5.0" + propagate "^2.0.0" + nock@^13.0.2: version "13.0.2" resolved "https://registry.yarnpkg.com/nock/-/nock-13.0.2.tgz#3e50f88348edbb90cce1bbbf0a3ea6a068993983" @@ -8307,7 +8391,7 @@ resolve@1.1.7: resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= -resolve@^1.1.6, resolve@^1.10.0, resolve@^1.11.1, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.17.0, resolve@^1.3.2: +resolve@^1.1.6, resolve@^1.10.0, resolve@^1.10.1, resolve@^1.11.1, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.17.0, resolve@^1.3.2: version "1.17.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== @@ -8458,6 +8542,11 @@ semver-intersect@^1.4.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== +semver@6.x, semver@^6.0.0, semver@^6.1.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + semver@7.1.1: version "7.1.1" resolved "https://registry.yarnpkg.com/semver/-/semver-7.1.1.tgz#29104598a197d6cbe4733eeecbe968f7b43a9667" @@ -8468,11 +8557,6 @@ semver@7.x, semver@^7.2.2, semver@^7.3.2: resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.2.tgz#604962b052b81ed0786aae84389ffba70ffd3938" integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ== -semver@^6.0.0, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== - set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" @@ -9446,6 +9530,22 @@ trivial-deferred@^1.0.1: resolved "https://registry.yarnpkg.com/trivial-deferred/-/trivial-deferred-1.0.1.tgz#376d4d29d951d6368a6f7a0ae85c2f4d5e0658f3" integrity sha1-N21NKdlR1jaKb3oK6FwvTV4GWPM= +ts-jest@^25.3.1: + version "25.5.1" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-25.5.1.tgz#2913afd08f28385d54f2f4e828be4d261f4337c7" + integrity sha512-kHEUlZMK8fn8vkxDjwbHlxXRB9dHYpyzqKIGDNxbzs+Rz+ssNDSDNusEK8Fk/sDd4xE6iKoQLfFkFVaskmTJyw== + dependencies: + bs-logger "0.x" + buffer-from "1.x" + fast-json-stable-stringify "2.x" + json5 "2.x" + lodash.memoize "4.x" + make-error "1.x" + micromatch "4.x" + mkdirp "0.x" + semver "6.x" + yargs-parser "18.x" + ts-jest@^26.1.1: version "26.1.1" resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.1.1.tgz#b98569b8a4d4025d966b3d40c81986dd1c510f8d" @@ -9795,6 +9895,11 @@ validate-npm-package-name@^3.0.0: dependencies: builtins "^1.0.3" +vandium-utils@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/vandium-utils/-/vandium-utils-1.2.0.tgz#44735de4b7641a05de59ebe945f174e582db4f59" + integrity sha1-RHNd5LdkGgXeWevpRfF05YLbT1k= + verror@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" From fb13655b87e5ea59b60aa0712be358c52d0c1dd1 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Wed, 8 Jul 2020 16:08:18 +0000 Subject: [PATCH 02/39] Dependable.dependencyRoots --- packages/@aws-cdk/core/lib/construct-compat.ts | 11 ----------- packages/@aws-cdk/core/lib/index.ts | 1 - packages/@aws-cdk/core/lib/private/prepare-app.ts | 2 +- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/packages/@aws-cdk/core/lib/construct-compat.ts b/packages/@aws-cdk/core/lib/construct-compat.ts index da60d93ada8c3..e39874570c82a 100644 --- a/packages/@aws-cdk/core/lib/construct-compat.ts +++ b/packages/@aws-cdk/core/lib/construct-compat.ts @@ -19,14 +19,3 @@ // public static isConstruct(x: any): x is Construct { // return typeof x === 'object' && x !== null && CONSTRUCT_SYMBOL in x; // } - -import * as constructs from 'constructs'; - -export type Construct = constructs.Construct; -export type IConstruct = constructs.IConstruct; -export type ConstructOrder = constructs.ConstructOrder; - -export type DependableTrait = constructs.Dependable; -export type IDependable = constructs.IDependable; -export type ConstructNode = constructs.Node; -export type ConcreteDependable = constructs.DependencyGroup; diff --git a/packages/@aws-cdk/core/lib/index.ts b/packages/@aws-cdk/core/lib/index.ts index d8c4c04b52065..ad378be2acb3f 100644 --- a/packages/@aws-cdk/core/lib/index.ts +++ b/packages/@aws-cdk/core/lib/index.ts @@ -1,7 +1,6 @@ export * from './tag-aspect'; export * from './aspect'; -export * from './construct-compat'; export * from './token'; export * from './resolvable'; export * from './lazy'; diff --git a/packages/@aws-cdk/core/lib/private/prepare-app.ts b/packages/@aws-cdk/core/lib/private/prepare-app.ts index 5f4a996463471..a0700d915d6ce 100644 --- a/packages/@aws-cdk/core/lib/private/prepare-app.ts +++ b/packages/@aws-cdk/core/lib/private/prepare-app.ts @@ -95,7 +95,7 @@ function findTransitiveDeps(root: IConstruct): Dependency[] { for (const source of root.node.findAll()) { for (const dependable of source.node.dependencies) { - for (const target of Dependable.of(dependable).dependencies) { + for (const target of Dependable.of(dependable).dependencyRoots) { let foundTargets = found.get(source); if (!foundTargets) { found.set(source, foundTargets = new Set()); } From a507b4ee12bff6800a77dd8b0dd8a8d7e591d744 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Wed, 8 Jul 2020 16:08:57 +0000 Subject: [PATCH 03/39] Allow subclasses of CfnResource to customize toCloudFormation() --- packages/@aws-cdk/core/lib/cfn-resource.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/@aws-cdk/core/lib/cfn-resource.ts b/packages/@aws-cdk/core/lib/cfn-resource.ts index 620ac6e5f4541..1c605dcff3cc7 100644 --- a/packages/@aws-cdk/core/lib/cfn-resource.ts +++ b/packages/@aws-cdk/core/lib/cfn-resource.ts @@ -264,6 +264,14 @@ export class CfnResource extends CfnRefElement { * @internal */ public _toCloudFormation(): object { + return this.toCloudFormation(); + } + + /** + * Renders the cloudformation chunk for this resource. Derived classes may + * override to implement custom behavior. + */ + protected toCloudFormation(): object { try { const ret = { Resources: { From b4ec41b51a5ab10eaf15f985792ea412b68b4114 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Wed, 8 Jul 2020 16:09:21 +0000 Subject: [PATCH 04/39] iam --- packages/@aws-cdk/aws-iam/lib/grant.ts | 28 ++++++++-------- packages/@aws-cdk/aws-iam/lib/group.ts | 3 +- packages/@aws-cdk/aws-iam/lib/lazy-role.ts | 3 +- .../@aws-cdk/aws-iam/lib/managed-policy.ts | 3 +- .../@aws-cdk/aws-iam/lib/oidc-provider.ts | 3 +- packages/@aws-cdk/aws-iam/lib/policy.ts | 32 +++++++++++++------ packages/@aws-cdk/aws-iam/lib/principals.ts | 3 +- .../aws-iam/lib/private/immutable-role.ts | 6 ++-- packages/@aws-cdk/aws-iam/lib/role.ts | 3 +- .../@aws-cdk/aws-iam/lib/unknown-principal.ts | 5 +-- packages/@aws-cdk/aws-iam/lib/user.ts | 3 +- packages/@aws-cdk/aws-iam/lib/util.ts | 3 +- .../aws-iam/test/example.attaching.lit.ts | 5 +-- .../aws-iam/test/example.external-id.lit.ts | 6 ++-- .../aws-iam/test/example.managedpolicy.lit.ts | 6 ++-- .../@aws-cdk/aws-iam/test/example.role.lit.ts | 6 ++-- packages/@aws-cdk/aws-iam/test/grant.test.ts | 3 +- .../aws-iam/test/immutable-role.test.ts | 3 +- .../aws-iam/test/integ.condition-with-ref.ts | 3 +- .../aws-iam/test/oidc-provider.test.ts | 15 ++++++--- .../@aws-cdk/aws-iam/test/principals.test.ts | 6 ++-- 21 files changed, 90 insertions(+), 58 deletions(-) diff --git a/packages/@aws-cdk/aws-iam/lib/grant.ts b/packages/@aws-cdk/aws-iam/lib/grant.ts index 0f882c4a73d00..b9f5cbdd53584 100644 --- a/packages/@aws-cdk/aws-iam/lib/grant.ts +++ b/packages/@aws-cdk/aws-iam/lib/grant.ts @@ -1,4 +1,4 @@ -import * as cdk from '@aws-cdk/core'; +import { Dependable, IConstruct, IDependable } from 'constructs'; import { PolicyStatement } from './policy-statement'; import { IGrantable, IPrincipal } from './principals'; @@ -61,7 +61,7 @@ export interface GrantOnPrincipalOptions extends CommonGrantOptions { * * @default - the construct in which this construct is defined */ - readonly scope?: cdk.IConstruct; + readonly scope?: IConstruct; } /** @@ -100,7 +100,7 @@ export interface GrantOnPrincipalAndResourceOptions extends CommonGrantOptions { * This class is not instantiable by consumers on purpose, so that they will be * required to call the Grant factory functions. */ -export class Grant implements cdk.IDependable { +export class Grant implements IDependable { /** * Grant the given permissions to the principal * @@ -236,9 +236,9 @@ export class Grant implements cdk.IDependable { this.principalStatement = props.principalStatement; this.resourceStatement = props.resourceStatement; - cdk.DependableTrait.implement(this, { + Dependable.implement(this, { get dependencyRoots() { - return props.policyDependable ? cdk.DependableTrait.get(props.policyDependable).dependencyRoots : []; + return props.policyDependable ? Dependable.of(props.policyDependable).dependencyRoots : []; }, }); } @@ -265,7 +265,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); } @@ -286,13 +286,13 @@ interface GrantProps { * * Used to add dependencies on grants */ - readonly policyDependable?: cdk.IDependable; + readonly policyDependable?: IDependable; } /** * A resource with a resource policy that can be added to */ -export interface IResourceWithPolicy extends cdk.IConstruct { +export interface IResourceWithPolicy extends IConstruct { /** * Add a statement to the resource's resource policy */ @@ -314,7 +314,7 @@ export interface AddToResourcePolicyResult { * @default - If `statementAdded` is true, the resource object itself. * Otherwise, no dependable. */ - readonly policyDependable?: cdk.IDependable; + readonly policyDependable?: IDependable; } /** @@ -324,11 +324,11 @@ export interface AddToResourcePolicyResult { * inner dependables, as they may be mutable so we need to defer * the query. */ -export class CompositeDependable implements cdk.IDependable { - constructor(...dependables: cdk.IDependable[]) { - cdk.DependableTrait.implement(this, { - get dependencyRoots(): cdk.IConstruct[] { - return Array.prototype.concat.apply([], dependables.map(d => cdk.DependableTrait.get(d).dependencyRoots)); +export class CompositeDependable implements IDependable { + constructor(...dependables: IDependable[]) { + Dependable.implement(this, { + get dependencyRoots(): IConstruct[] { + return Array.prototype.concat.apply([], dependables.map(d => Dependable.of(d).dependencyRoots)); }, }); } diff --git a/packages/@aws-cdk/aws-iam/lib/group.ts b/packages/@aws-cdk/aws-iam/lib/group.ts index 08ef30cba9203..ed2c6f6203b19 100644 --- a/packages/@aws-cdk/aws-iam/lib/group.ts +++ b/packages/@aws-cdk/aws-iam/lib/group.ts @@ -1,4 +1,5 @@ -import { Construct, Lazy, Resource, Stack } from '@aws-cdk/core'; +import { Lazy, Resource, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnGroup } from './iam.generated'; import { IIdentity } from './identity-base'; import { IManagedPolicy } from './managed-policy'; diff --git a/packages/@aws-cdk/aws-iam/lib/lazy-role.ts b/packages/@aws-cdk/aws-iam/lib/lazy-role.ts index bfc83817ad0f8..f450d87456437 100644 --- a/packages/@aws-cdk/aws-iam/lib/lazy-role.ts +++ b/packages/@aws-cdk/aws-iam/lib/lazy-role.ts @@ -1,4 +1,5 @@ import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Grant } from './grant'; import { IManagedPolicy } from './managed-policy'; import { Policy } from './policy'; @@ -34,7 +35,7 @@ export class LazyRole extends cdk.Resource implements IRole { private readonly policies = new Array(); private readonly managedPolicies = new Array(); - constructor(scope: cdk.Construct, id: string, private readonly props: LazyRoleProps) { + constructor(scope: Construct, id: string, private readonly props: LazyRoleProps) { super(scope, id); } diff --git a/packages/@aws-cdk/aws-iam/lib/managed-policy.ts b/packages/@aws-cdk/aws-iam/lib/managed-policy.ts index c297e03b0f9f1..5a48177ff3401 100644 --- a/packages/@aws-cdk/aws-iam/lib/managed-policy.ts +++ b/packages/@aws-cdk/aws-iam/lib/managed-policy.ts @@ -1,4 +1,5 @@ -import { Construct, IResolveContext, Lazy, Resource, Stack} from '@aws-cdk/core'; +import { IResolveContext, Lazy, Resource, Stack} from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { IGroup } from './group'; import { CfnManagedPolicy } from './iam.generated'; import { PolicyDocument } from './policy-document'; diff --git a/packages/@aws-cdk/aws-iam/lib/oidc-provider.ts b/packages/@aws-cdk/aws-iam/lib/oidc-provider.ts index 06fe2395f687f..83307b6bd8a45 100644 --- a/packages/@aws-cdk/aws-iam/lib/oidc-provider.ts +++ b/packages/@aws-cdk/aws-iam/lib/oidc-provider.ts @@ -1,4 +1,5 @@ -import { Construct, CustomResource, CustomResourceProvider, CustomResourceProviderRuntime, IResource, Resource, Stack, Token } from '@aws-cdk/core'; +import { CustomResource, CustomResourceProvider, CustomResourceProviderRuntime, IResource, Resource, Stack, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as path from 'path'; const RESOURCE_TYPE = 'Custom::AWSCDKOpenIdConnectProvider'; diff --git a/packages/@aws-cdk/aws-iam/lib/policy.ts b/packages/@aws-cdk/aws-iam/lib/policy.ts index 6f852caec1a23..4fcdf2b062934 100644 --- a/packages/@aws-cdk/aws-iam/lib/policy.ts +++ b/packages/@aws-cdk/aws-iam/lib/policy.ts @@ -1,4 +1,5 @@ -import { Construct, IResource, Lazy, Resource } from '@aws-cdk/core'; +import { IResource, Lazy, Resource } from '@aws-cdk/core'; +import { Construct, Dependable, IDependable } from 'constructs'; import { IGroup } from './group'; import { CfnPolicy } from './iam.generated'; import { PolicyDocument } from './policy-document'; @@ -124,7 +125,18 @@ export class Policy extends Resource implements IPolicy { Lazy.stringValue({ produce: () => generatePolicyName(scope, resource.logicalId) }), }); - const resource = new CfnPolicy(this, 'Resource', { + // this function returns `true` if the CFN resource should be included in + // the cloudformation template unless `force` is `true`, if the policy + // document is empty, the resource will not be included. + const shouldExist = () => this.force || this.referenceTaken || (!this.document.isEmpty && this.isAttached); + + class CfnPolicyConditional extends CfnPolicy implements IDependable { + protected toCloudFormation(): object { + return shouldExist() ? super.toCloudFormation() : {}; + } + } + + const resource = new CfnPolicyConditional(this, 'Resource', { policyDocument: this.document, policyName: this.physicalName, roles: undefinedIfEmpty(() => this.roles.map(r => r.roleName)), @@ -132,6 +144,14 @@ export class Policy extends Resource implements IPolicy { groups: undefinedIfEmpty(() => this.groups.map(g => g.groupName)), }); + // implement custom Dependable logic which returns an empty array if the + // policy document is empty (and force is `false`). + Dependable.implement(this, { + get dependencyRoots() { + return shouldExist() ? [resource] : []; + }, + }); + this._policyName = this.physicalName!; this.force = props.force !== undefined ? props.force : false; @@ -222,14 +242,6 @@ export class Policy extends Resource implements IPolicy { return result; } - protected prepare() { - // Remove the resource if it shouldn't exist. This will prevent it from being rendered to the template. - const shouldExist = this.force || this.referenceTaken || (!this.document.isEmpty && this.isAttached); - if (!shouldExist) { - this.node.tryRemoveChild('Resource'); - } - } - /** * Whether the policy resource has been attached to any identity */ diff --git a/packages/@aws-cdk/aws-iam/lib/principals.ts b/packages/@aws-cdk/aws-iam/lib/principals.ts index 53e7aca1968d7..4de33d93c1b20 100644 --- a/packages/@aws-cdk/aws-iam/lib/principals.ts +++ b/packages/@aws-cdk/aws-iam/lib/principals.ts @@ -1,5 +1,6 @@ import * as cdk from '@aws-cdk/core'; import { Default, RegionInfo } from '@aws-cdk/region-info'; +import { IDependable } from 'constructs'; import { IOpenIdConnectProvider } from './oidc-provider'; import { Condition, Conditions, PolicyStatement } from './policy-statement'; import { mergePrincipal } from './util'; @@ -75,7 +76,7 @@ export interface AddToPrincipalPolicyResult { * @default - Required if `statementAdded` is true. * @experimental */ - readonly policyDependable?: cdk.IDependable; + readonly policyDependable?: IDependable; } /** diff --git a/packages/@aws-cdk/aws-iam/lib/private/immutable-role.ts b/packages/@aws-cdk/aws-iam/lib/private/immutable-role.ts index 92aed748514d5..413ad1c86ea47 100644 --- a/packages/@aws-cdk/aws-iam/lib/private/immutable-role.ts +++ b/packages/@aws-cdk/aws-iam/lib/private/immutable-role.ts @@ -1,4 +1,4 @@ -import { ConcreteDependable, Construct, DependableTrait } from '@aws-cdk/core'; +import { Construct, Dependable, DependencyGroup } from 'constructs'; import { Grant } from '../grant'; import { IManagedPolicy } from '../managed-policy'; import { Policy } from '../policy'; @@ -31,7 +31,7 @@ export class ImmutableRole extends Construct implements IRole { super(scope, id); // implement IDependable privately - DependableTrait.implement(this, { + Dependable.implement(this, { dependencyRoots: [ role ], }); } @@ -50,7 +50,7 @@ export class ImmutableRole extends Construct implements IRole { public addToPrincipalPolicy(_statement: PolicyStatement): AddToPrincipalPolicyResult { // Not really added, but for the purposes of consumer code pretend that it was. - return { statementAdded: true, policyDependable: new ConcreteDependable() }; + return { statementAdded: true, policyDependable: new DependencyGroup() }; } public grant(grantee: IPrincipal, ...actions: string[]): Grant { diff --git a/packages/@aws-cdk/aws-iam/lib/role.ts b/packages/@aws-cdk/aws-iam/lib/role.ts index e62dcd45af0be..8529168e08941 100644 --- a/packages/@aws-cdk/aws-iam/lib/role.ts +++ b/packages/@aws-cdk/aws-iam/lib/role.ts @@ -1,4 +1,5 @@ -import { Construct, Duration, Lazy, Resource, Stack, Token } from '@aws-cdk/core'; +import { Duration, Lazy, Resource, Stack, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Grant } from './grant'; import { CfnRole } from './iam.generated'; import { IIdentity } from './identity-base'; diff --git a/packages/@aws-cdk/aws-iam/lib/unknown-principal.ts b/packages/@aws-cdk/aws-iam/lib/unknown-principal.ts index da30dbf08227e..31da95243aa01 100644 --- a/packages/@aws-cdk/aws-iam/lib/unknown-principal.ts +++ b/packages/@aws-cdk/aws-iam/lib/unknown-principal.ts @@ -1,4 +1,5 @@ -import { ConcreteDependable, IConstruct, Stack } from '@aws-cdk/core'; +import { Stack } from '@aws-cdk/core'; +import { DependencyGroup, IConstruct } from 'constructs'; import { PolicyStatement } from './policy-statement'; import { AddToPrincipalPolicyResult, IPrincipal, PrincipalPolicyFragment } from './principals'; @@ -42,7 +43,7 @@ export class UnknownPrincipal implements IPrincipal { const repr = JSON.stringify(stack.resolve(statement)); this.resource.node.addWarning(`Add statement to this resource's role: ${repr}`); // Pretend we did the work. The human will do it for us, eventually. - return { statementAdded: true, policyDependable: new ConcreteDependable() }; + return { statementAdded: true, policyDependable: new DependencyGroup() }; } public addToPolicy(statement: PolicyStatement): boolean { diff --git a/packages/@aws-cdk/aws-iam/lib/user.ts b/packages/@aws-cdk/aws-iam/lib/user.ts index 886937fcf3cb8..59b1ebe30dc3e 100644 --- a/packages/@aws-cdk/aws-iam/lib/user.ts +++ b/packages/@aws-cdk/aws-iam/lib/user.ts @@ -1,4 +1,5 @@ -import { Construct, Lazy, Resource, SecretValue, Stack } from '@aws-cdk/core'; +import { Lazy, Resource, SecretValue, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { IGroup } from './group'; import { CfnUser } from './iam.generated'; import { IIdentity } from './identity-base'; diff --git a/packages/@aws-cdk/aws-iam/lib/util.ts b/packages/@aws-cdk/aws-iam/lib/util.ts index 14aa2fa58c7de..4a784fe25067d 100644 --- a/packages/@aws-cdk/aws-iam/lib/util.ts +++ b/packages/@aws-cdk/aws-iam/lib/util.ts @@ -1,4 +1,5 @@ -import { DefaultTokenResolver, IConstruct, Lazy, StringConcat, Tokenization } from '@aws-cdk/core'; +import { DefaultTokenResolver, Lazy, StringConcat, Tokenization } from '@aws-cdk/core'; +import { IConstruct } from 'constructs'; import { IPolicy } from './policy'; const MAX_POLICY_NAME_LEN = 128; 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 ac229c84f9fa1..29467bb8140d3 100644 --- a/packages/@aws-cdk/aws-iam/test/example.attaching.lit.ts +++ b/packages/@aws-cdk/aws-iam/test/example.attaching.lit.ts @@ -1,8 +1,9 @@ import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Group, Policy, User } from '../lib'; -export class ExampleConstruct extends cdk.Construct { - constructor(scope: cdk.Construct, id: string) { +export class ExampleConstruct extends Construct { + constructor(scope: Construct, id: string) { super(scope, id); /// !show 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 05ef3d44dad35..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,8 +1,8 @@ -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as iam from '../lib'; -export class ExampleConstruct extends cdk.Construct { - constructor(scope: cdk.Construct, id: string) { +export class ExampleConstruct extends Construct { + 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 ec2b4bd2d2943..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,8 +1,8 @@ -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { Group, ManagedPolicy } from '../lib'; -export class ExampleConstruct extends cdk.Construct { - constructor(scope: cdk.Construct, id: string) { +export class ExampleConstruct extends Construct { + 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 d15053e718421..96708763aa769 100644 --- a/packages/@aws-cdk/aws-iam/test/example.role.lit.ts +++ b/packages/@aws-cdk/aws-iam/test/example.role.lit.ts @@ -1,8 +1,8 @@ -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { PolicyStatement, Role, ServicePrincipal } from '../lib'; -export class ExampleConstruct extends cdk.Construct { - constructor(scope: cdk.Construct, id: string) { +export class ExampleConstruct extends Construct { + constructor(scope: Construct, id: string) { super(scope, id); /// !show diff --git a/packages/@aws-cdk/aws-iam/test/grant.test.ts b/packages/@aws-cdk/aws-iam/test/grant.test.ts index 93143f07c8125..11a0d7c5c1e44 100644 --- a/packages/@aws-cdk/aws-iam/test/grant.test.ts +++ b/packages/@aws-cdk/aws-iam/test/grant.test.ts @@ -1,6 +1,7 @@ import { ResourcePart } from '@aws-cdk/assert'; import '@aws-cdk/assert/jest'; -import { CfnResource, Construct, Stack } from '@aws-cdk/core'; +import { CfnResource, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as iam from '../lib'; let stack: Stack; 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 51bb0d2496c0f..2ac274bdd0a99 100644 --- a/packages/@aws-cdk/aws-iam/test/immutable-role.test.ts +++ b/packages/@aws-cdk/aws-iam/test/immutable-role.test.ts @@ -1,5 +1,6 @@ import '@aws-cdk/assert/jest'; -import { Construct, Stack } from '@aws-cdk/core'; +import { Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as iam from '../lib'; // tslint:disable:object-literal-key-quotes diff --git a/packages/@aws-cdk/aws-iam/test/integ.condition-with-ref.ts b/packages/@aws-cdk/aws-iam/test/integ.condition-with-ref.ts index 576f6bd835083..b9a7c77c397a0 100644 --- a/packages/@aws-cdk/aws-iam/test/integ.condition-with-ref.ts +++ b/packages/@aws-cdk/aws-iam/test/integ.condition-with-ref.ts @@ -1,4 +1,5 @@ -import { App, CfnJson, CfnParameter, Construct, Stack } from '@aws-cdk/core'; +import { App, CfnJson, CfnParameter, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { AccountRootPrincipal, Role } from '../lib'; class MyStack extends Stack { diff --git a/packages/@aws-cdk/aws-iam/test/oidc-provider.test.ts b/packages/@aws-cdk/aws-iam/test/oidc-provider.test.ts index 590744949b58d..b071c96804520 100644 --- a/packages/@aws-cdk/aws-iam/test/oidc-provider.test.ts +++ b/packages/@aws-cdk/aws-iam/test/oidc-provider.test.ts @@ -10,7 +10,8 @@ describe('OpenIdConnectProvider resource', () => { test('minimal configuration (no clients and no thumbprint)', () => { // GIVEN - const stack = new Stack(); + const app = new App(); + const stack = new Stack(app, 'test'); // WHEN new iam.OpenIdConnectProvider(stack, 'MyProvider', { @@ -25,7 +26,8 @@ describe('OpenIdConnectProvider resource', () => { test('"openIdConnectProviderArn" resolves to the ref', () => { // GIVEN - const stack = new Stack(); + const app = new App(); + const stack = new Stack(app, 'test'); // WHEN const provider = new iam.OpenIdConnectProvider(stack, 'MyProvider', { @@ -38,7 +40,8 @@ describe('OpenIdConnectProvider resource', () => { test('static fromOpenIdConnectProviderArn can be used to import a provider', () => { // GIVEN - const stack = new Stack(); + const app = new App(); + const stack = new Stack(app, 'test'); // WHEN const provider = iam.OpenIdConnectProvider.fromOpenIdConnectProviderArn(stack, 'MyProvider', 'arn:of:provider'); @@ -49,7 +52,8 @@ describe('OpenIdConnectProvider resource', () => { test('thumbprint list and client ids can be specified', () => { // GIVEN - const stack = new Stack(); + const app = new App(); + const stack = new Stack(app, 'test'); // WHEN new iam.OpenIdConnectProvider(stack, 'MyProvider', { @@ -95,7 +99,8 @@ describe('custom resource provider infrastructure', () => { test('iam policy', () => { // GIVEN - const stack = new Stack(); + const app = new App(); + const stack = new Stack(app, 'test'); // WHEN new iam.OpenIdConnectProvider(stack, 'Provider1', { url: 'provider1' }); diff --git a/packages/@aws-cdk/aws-iam/test/principals.test.ts b/packages/@aws-cdk/aws-iam/test/principals.test.ts index b1d7bc0d169f1..11ed3c67798e4 100644 --- a/packages/@aws-cdk/aws-iam/test/principals.test.ts +++ b/packages/@aws-cdk/aws-iam/test/principals.test.ts @@ -105,7 +105,8 @@ test('can have multiple principals the same conditions in the same statement', ( test('use Web Identity principal', () => { // GIVEN - const stack = new Stack(); + const app = new App(); + const stack = new Stack(app, 'test'); // WHEN const principal = new iam.WebIdentityPrincipal('cognito-identity.amazonaws.com'); @@ -117,7 +118,8 @@ test('use Web Identity principal', () => { test('use OpenID Connect principal from provider', () => { // GIVEN - const stack = new Stack(); + const app = new App(); + const stack = new Stack(app, 'test'); const provider = new iam.OpenIdConnectProvider(stack, 'MyProvider', { url: 'https://openid-endpoint', }); From 9cbb189cb23e611c7ccf647c68b09dd28e3e611d Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Wed, 8 Jul 2020 16:57:26 +0000 Subject: [PATCH 05/39] legacy construct settings if stack is root --- packages/@aws-cdk/core/lib/app.ts | 15 ++------------- .../core/lib/private/construct-settings.ts | 18 ++++++++++++++++++ packages/@aws-cdk/core/lib/stack.ts | 7 +++++++ 3 files changed, 27 insertions(+), 13 deletions(-) create mode 100644 packages/@aws-cdk/core/lib/private/construct-settings.ts diff --git a/packages/@aws-cdk/core/lib/app.ts b/packages/@aws-cdk/core/lib/app.ts index 51b3a35fb4ba3..bf20591b2f3dc 100644 --- a/packages/@aws-cdk/core/lib/app.ts +++ b/packages/@aws-cdk/core/lib/app.ts @@ -1,6 +1,5 @@ -import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import * as cxapi from '@aws-cdk/cx-api'; -import { ConstructScopeSettings } from 'constructs'; +import { applyLegacyConstructSettings } from './private/construct-settings'; import { TreeMetadata } from './private/tree-metadata'; import { Stage } from './stage'; @@ -107,17 +106,7 @@ export class App extends Stage { this.node.setContext(cxapi.DISABLE_VERSION_REPORTING, true); } - const settings = ConstructScopeSettings.of(this); - - // configure settings for "constructs" - - if (this.node.tryGetContext(cxapi.DISABLE_METADATA_STACK_TRACE) || process.env.CDK_DISABLE_STACK_TRACE) { - settings.disableStackTraces(); - } - - settings.errorMetadataKey = cxschema.ArtifactMetadataEntryType.ERROR; - settings.warningMetadataKey = cxschema.ArtifactMetadataEntryType.WARN; - settings.infoMetadataKey = cxschema.ArtifactMetadataEntryType.INFO; + applyLegacyConstructSettings(this); const autoSynth = props.autoSynth !== undefined ? props.autoSynth : cxapi.OUTDIR_ENV in process.env; if (autoSynth) { diff --git a/packages/@aws-cdk/core/lib/private/construct-settings.ts b/packages/@aws-cdk/core/lib/private/construct-settings.ts new file mode 100644 index 0000000000000..6bbd272edd556 --- /dev/null +++ b/packages/@aws-cdk/core/lib/private/construct-settings.ts @@ -0,0 +1,18 @@ +import * as cxschema from '@aws-cdk/cloud-assembly-schema'; +import * as cxapi from '@aws-cdk/cx-api'; +import { Construct, ConstructScopeSettings } from "constructs"; + +/** + * Configures the construct scope to use legacy values for error/warning/info metadata keys + * as well as disable stack traces if needed. + */ +export function applyLegacyConstructSettings(scope: Construct) { + const settings = ConstructScopeSettings.of(scope); + if (scope.node.tryGetContext(cxapi.DISABLE_METADATA_STACK_TRACE) || process.env.CDK_DISABLE_STACK_TRACE) { + settings.disableStackTraces(); + } + + settings.errorMetadataKey = cxschema.ArtifactMetadataEntryType.ERROR; + settings.warningMetadataKey = cxschema.ArtifactMetadataEntryType.WARN; + settings.infoMetadataKey = cxschema.ArtifactMetadataEntryType.INFO; +} \ No newline at end of file diff --git a/packages/@aws-cdk/core/lib/stack.ts b/packages/@aws-cdk/core/lib/stack.ts index 5f0b8337e8ef3..af8e4957e638b 100644 --- a/packages/@aws-cdk/core/lib/stack.ts +++ b/packages/@aws-cdk/core/lib/stack.ts @@ -14,6 +14,7 @@ import { ContextProvider } from './context-provider'; import { addDependency } from './deps'; import { Environment } from './environment'; import * as cfnlang from './private/cloudformation-lang'; +import { applyLegacyConstructSettings } from './private/construct-settings'; import { LogicalIDs } from './private/logical-id'; import { resolve } from './private/resolve'; import { makeUniqueId } from './private/uniqueid'; @@ -318,6 +319,12 @@ export class Stack extends Construct implements ITaggable { Object.defineProperty(this, STACK_SYMBOL, { value: true }); + // if this is a root, apply legacy settings for "constructs" so metadata + // keys and stack traces will work properly. + if (!scope) { + applyLegacyConstructSettings(this); + } + this._logicalIds = new LogicalIDs(); const { account, region, environment } = this.parseEnvironment(props.env); From cf49643c67d8f0bc0695b5f26e7e5091a01d52dd Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Wed, 8 Jul 2020 16:57:33 +0000 Subject: [PATCH 06/39] fix codepipeline tests --- .../@aws-cdk/aws-codepipeline/test/test.artifacts.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/@aws-cdk/aws-codepipeline/test/test.artifacts.ts b/packages/@aws-cdk/aws-codepipeline/test/test.artifacts.ts index 25efecb557eb1..31d1dbe2f7f66 100644 --- a/packages/@aws-cdk/aws-codepipeline/test/test.artifacts.ts +++ b/packages/@aws-cdk/aws-codepipeline/test/test.artifacts.ts @@ -42,7 +42,7 @@ export = { ], }); - const errors = validate(stack); + const errors = validate(pipeline); test.equal(errors.length, 1); const error = errors[0]; @@ -78,7 +78,7 @@ export = { ], }); - const errors = validate(stack); + const errors = validate(pipeline); test.equal(errors.length, 1); const error = errors[0]; @@ -90,7 +90,7 @@ export = { 'without a name, when used as an output multiple times - should fail validation'(test: Test) { const stack = new cdk.Stack(); - const sourceOutput = new codepipeline.Artifact(); + const sourceOutput = new codepipeline.Artifact('Artifact_Source_Source'); const pipeline = new codepipeline.Pipeline(stack, 'Pipeline', { stages: [ { @@ -115,7 +115,7 @@ export = { ], }); - const errors = validate(stack); + const errors = validate(pipeline); test.equal(errors.length, 1); const error = errors[0]; @@ -217,7 +217,7 @@ export = { ], }); - const errors = validate(stack); + const errors = validate(pipeline); test.equal(errors.length, 1); const error = errors[0]; From 1f1f449f17d68671b68eb0b73f46049696b9dcb6 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Wed, 8 Jul 2020 17:29:35 +0000 Subject: [PATCH 07/39] dependencies => dependencyRoots --- packages/@aws-cdk/aws-ec2/lib/vpc.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/aws-ec2/lib/vpc.ts b/packages/@aws-cdk/aws-ec2/lib/vpc.ts index 8dd337a255a7e..bc0713cc5e880 100644 --- a/packages/@aws-cdk/aws-ec2/lib/vpc.ts +++ b/packages/@aws-cdk/aws-ec2/lib/vpc.ts @@ -1837,10 +1837,10 @@ class CompositeDependable implements IDependable { constructor() { const self = this; Dependable.implement(this, { - get dependencies() { + get dependencyRoots() { const ret = new Array(); for (const dep of self.dependables) { - ret.push(...Dependable.of(dep).dependencies); + ret.push(...Dependable.of(dep).dependencyRoots); } return ret; }, From fbcd47137bbecd6feb9a607004cbc988d8cc6c78 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Wed, 8 Jul 2020 17:31:10 +0000 Subject: [PATCH 08/39] Hoist an "App" when stacks are created as root --- packages/@aws-cdk/assets/lib/staging.ts | 3 ++- packages/@aws-cdk/core/lib/app.ts | 18 ++++++++++++- packages/@aws-cdk/core/lib/stack.ts | 28 +++++++++++--------- packages/@aws-cdk/core/test/test.resource.ts | 2 +- packages/@aws-cdk/core/test/test.stack.ts | 6 ++--- 5 files changed, 38 insertions(+), 19 deletions(-) diff --git a/packages/@aws-cdk/assets/lib/staging.ts b/packages/@aws-cdk/assets/lib/staging.ts index 87800ae8aa40f..3bff0ea4ceb0c 100644 --- a/packages/@aws-cdk/assets/lib/staging.ts +++ b/packages/@aws-cdk/assets/lib/staging.ts @@ -1,4 +1,5 @@ -import { AssetStaging, Construct } from '@aws-cdk/core'; +import { AssetStaging } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { toSymlinkFollow } from './compat'; import { FingerprintOptions } from './fs/options'; diff --git a/packages/@aws-cdk/core/lib/app.ts b/packages/@aws-cdk/core/lib/app.ts index bf20591b2f3dc..6706c19f9d979 100644 --- a/packages/@aws-cdk/core/lib/app.ts +++ b/packages/@aws-cdk/core/lib/app.ts @@ -1,5 +1,6 @@ +import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import * as cxapi from '@aws-cdk/cx-api'; -import { applyLegacyConstructSettings } from './private/construct-settings'; +import { Construct, ConstructScopeSettings } from "constructs"; import { TreeMetadata } from './private/tree-metadata'; import { Stage } from './stage'; @@ -137,3 +138,18 @@ export class App extends Stage { } } } + +/** + * Configures the construct scope to use legacy values for error/warning/info metadata keys + * as well as disable stack traces if needed. + */ +export function applyLegacyConstructSettings(scope: Construct) { + const settings = ConstructScopeSettings.of(scope); + if (scope.node.tryGetContext(cxapi.DISABLE_METADATA_STACK_TRACE) || process.env.CDK_DISABLE_STACK_TRACE) { + settings.disableStackTraces(); + } + + settings.errorMetadataKey = cxschema.ArtifactMetadataEntryType.ERROR; + settings.warningMetadataKey = cxschema.ArtifactMetadataEntryType.WARN; + settings.infoMetadataKey = cxschema.ArtifactMetadataEntryType.INFO; +} \ No newline at end of file diff --git a/packages/@aws-cdk/core/lib/stack.ts b/packages/@aws-cdk/core/lib/stack.ts index af8e4957e638b..c4933579f1f1a 100644 --- a/packages/@aws-cdk/core/lib/stack.ts +++ b/packages/@aws-cdk/core/lib/stack.ts @@ -3,6 +3,7 @@ import * as cxapi from '@aws-cdk/cx-api'; import { Construct, IConstruct } from 'constructs'; import * as fs from 'fs'; import * as path from 'path'; +import { App } from './app'; // These imports have to be at the end to prevent circular imports import { Arn, ArnComponents } from './arn'; import { DockerImageAssetLocation, DockerImageAssetSource, FileAssetLocation, FileAssetSource } from './assets'; @@ -14,7 +15,6 @@ import { ContextProvider } from './context-provider'; import { addDependency } from './deps'; import { Environment } from './environment'; import * as cfnlang from './private/cloudformation-lang'; -import { applyLegacyConstructSettings } from './private/construct-settings'; import { LogicalIDs } from './private/logical-id'; import { resolve } from './private/resolve'; import { makeUniqueId } from './private/uniqueid'; @@ -191,7 +191,7 @@ export class Stack extends Construct implements ITaggable { /** * Options for CloudFormation template (like version, transform, description). */ - public readonly templateOptions: ITemplateOptions = {}; + public readonly templateOptions: ITemplateOptions; /** * The AWS region into which this stack will be deployed (e.g. `us-west-2`). @@ -293,37 +293,39 @@ export class Stack extends Construct implements ITaggable { /** * Other stacks this stack depends on */ - private readonly _stackDependencies: { [uniqueId: string]: StackDependency } = { }; + private readonly _stackDependencies: { [uniqueId: string]: StackDependency }; /** * Lists all missing contextual information. * This is returned when the stack is synthesized under the 'missing' attribute * and allows tooling to obtain the context and re-synthesize. */ - private readonly _missingContext = new Array(); + private readonly _missingContext: cxschema.MissingContext[]; private readonly _stackName: string; /** * Creates a new stack. * - * @param scope Parent of this stack, usually a Program instance. + * @param scope Parent of this stack, usually an `App` or a `Stage`, but could be any construct. * @param id The construct ID of this stack. If `stackName` is not explicitly * defined, this id (and any parent IDs) will be used to determine the * physical ID of the stack. * @param props Stack properties. */ public constructor(scope?: Construct, id?: string, props: StackProps = {}) { - // For unit test convenience parents are optional, so bypass the type check when calling the parent. - super(scope!, id!); + // For unit test scope and id are optional for stacks, but we still want an App + // as the parent because apps implement much of the synthesis logic. + scope = scope ?? new App(); + id = id ?? 'stack'; - Object.defineProperty(this, STACK_SYMBOL, { value: true }); + super(scope, id); - // if this is a root, apply legacy settings for "constructs" so metadata - // keys and stack traces will work properly. - if (!scope) { - applyLegacyConstructSettings(this); - } + this._missingContext = new Array(); + this._stackDependencies = { }; + this.templateOptions = { }; + + Object.defineProperty(this, STACK_SYMBOL, { value: true }); this._logicalIds = new LogicalIDs(); diff --git a/packages/@aws-cdk/core/test/test.resource.ts b/packages/@aws-cdk/core/test/test.resource.ts index b659b87c85277..52a8c1662761b 100644 --- a/packages/@aws-cdk/core/test/test.resource.ts +++ b/packages/@aws-cdk/core/test/test.resource.ts @@ -654,7 +654,7 @@ export = { test.deepEqual(toCloudFormation(stack), { Resources: { ParentMyResource4B1FDBCC: { Type: 'MyResourceType', - Metadata: { [cxapi.PATH_METADATA_KEY]: 'Parent/MyResource' } } } }); + Metadata: { [cxapi.PATH_METADATA_KEY]: 'stack/Parent/MyResource' } } } }); test.done(); }, diff --git a/packages/@aws-cdk/core/test/test.stack.ts b/packages/@aws-cdk/core/test/test.stack.ts index 24d5e983af168..46c3c9384660a 100644 --- a/packages/@aws-cdk/core/test/test.stack.ts +++ b/packages/@aws-cdk/core/test/test.stack.ts @@ -130,9 +130,9 @@ export = { const o = new CfnOutput(stack, 'MyOutput', { value: 'boom' }); const c = new CfnCondition(stack, 'MyCondition'); - test.equal(stack.node.findChild(p.node.path), p); - test.equal(stack.node.findChild(o.node.path), o); - test.equal(stack.node.findChild(c.node.path), c); + test.equal(stack.node.findChild(p.node.id), p); + test.equal(stack.node.findChild(o.node.id), o); + test.equal(stack.node.findChild(c.node.id), c); test.done(); }, From 9c65456f096df7240a52241f2ed63d94d695ca91 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Wed, 8 Jul 2020 17:39:24 +0000 Subject: [PATCH 09/39] step functions --- packages/@aws-cdk/aws-stepfunctions/test/activity.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-stepfunctions/test/activity.test.ts b/packages/@aws-cdk/aws-stepfunctions/test/activity.test.ts index b2e8b4dca9b6e..1adfef0b3e68e 100644 --- a/packages/@aws-cdk/aws-stepfunctions/test/activity.test.ts +++ b/packages/@aws-cdk/aws-stepfunctions/test/activity.test.ts @@ -14,7 +14,7 @@ describe('Activity', () => { // THEN expect(stack).toHaveResource('AWS::StepFunctions::Activity', { - Name: 'Activity', + Name: 'stackActivityD885F0FA', }); }); From 1b41a31951e89acad149a8237ecfec7a86a80f6c Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Thu, 9 Jul 2020 06:14:26 +0000 Subject: [PATCH 10/39] lambda --- packages/@aws-cdk/aws-lambda/lib/function.ts | 6 +++--- .../@aws-cdk/aws-lambda/test/test.function.ts | 21 +++++++------------ .../aws-lambda/test/test.lambda-version.ts | 2 +- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/packages/@aws-cdk/aws-lambda/lib/function.ts b/packages/@aws-cdk/aws-lambda/lib/function.ts index 7f37e511d5cb2..38530bdaf8d33 100644 --- a/packages/@aws-cdk/aws-lambda/lib/function.ts +++ b/packages/@aws-cdk/aws-lambda/lib/function.ts @@ -3,7 +3,7 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import * as logs from '@aws-cdk/aws-logs'; import * as sqs from '@aws-cdk/aws-sqs'; -import { CfnResource, Duration, Fn, Lazy } from '@aws-cdk/core'; +import { CfnResource, Duration, Fn, Lazy, Stack } from '@aws-cdk/core'; import { Construct } from 'constructs'; import { Code, CodeConfig } from './code'; import { EventInvokeConfigOptions } from './event-invoke-config'; @@ -311,9 +311,9 @@ export class Function extends FunctionBase { // hash of the function itself, so a new version resource is created when // the function configuration changes. const cfn = this._currentVersion.node.defaultChild as CfnResource; + const originalLogicalId: string = Stack.of(this).resolve(cfn.logicalId); - cfn.overrideLogicalId(Lazy.stringValue({ produce: ctx => { - const originalLogicalId: string = ctx.resolve(cfn.logicalId); + cfn.overrideLogicalId(Lazy.stringValue({ produce: _ => { const hash = calculateFunctionHash(this); const logicalId = trimFromStart(originalLogicalId, 255 - 32); return `${logicalId}${hash}`; diff --git a/packages/@aws-cdk/aws-lambda/test/test.function.ts b/packages/@aws-cdk/aws-lambda/test/test.function.ts index ccdc4fd8ec250..9202aec90ec85 100644 --- a/packages/@aws-cdk/aws-lambda/test/test.function.ts +++ b/packages/@aws-cdk/aws-lambda/test/test.function.ts @@ -1,4 +1,4 @@ -import { expect, haveOutput } from '@aws-cdk/assert'; +import { SynthUtils } from '@aws-cdk/assert'; import * as logs from '@aws-cdk/aws-logs'; import * as s3 from '@aws-cdk/aws-s3'; import * as sqs from '@aws-cdk/aws-sqs'; @@ -215,18 +215,13 @@ export = testCase({ }); // THEN - expect(stack1).to(haveOutput({ - outputName: 'CurrentVersionArn', - outputValue: { - Ref: 'MyFunctionCurrentVersion197490AF1a9a73cf5c46aec5e40fb202042eb60b', - }, - })); - expect(stack2).to(haveOutput({ - outputName: 'CurrentVersionArn', - outputValue: { - Ref: 'MyFunctionCurrentVersion197490AF8360a045031060e3117269037b7bffd6', - }, - })); + const template1 = SynthUtils.synthesize(stack1).template; + const template2 = SynthUtils.synthesize(stack2).template; + + // these functions are different in their configuration but the original + // logical ID of the version would be the same unless the logical ID + // includes the hash of function's configuration. + test.notDeepEqual(template1.Outputs.CurrentVersionArn.Value, template2.Outputs.CurrentVersionArn.Value); test.done(); }, }, diff --git a/packages/@aws-cdk/aws-lambda/test/test.lambda-version.ts b/packages/@aws-cdk/aws-lambda/test/test.lambda-version.ts index b442ad67b4cdf..58252464bad15 100644 --- a/packages/@aws-cdk/aws-lambda/test/test.lambda-version.ts +++ b/packages/@aws-cdk/aws-lambda/test/test.lambda-version.ts @@ -134,7 +134,7 @@ export = { }, 'FunctionVersion': { 'Fn::GetAtt': [ - 'FnCurrentVersion17A89ABB19ed45993ff69fd011ae9fd4ab6e2005', + 'FnCurrentVersion17A89ABBab5c765f3c55e4e61583b51b00a95742', 'Version', ], }, From 1bcda1129e9fd84a51f295c83dc2f5d33831eef5 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Thu, 9 Jul 2020 06:28:01 +0000 Subject: [PATCH 11/39] upgrade constructs --- packages/@aws-cdk/alexa-ask/README.md | 4 ---- packages/@aws-cdk/alexa-ask/package.json | 4 ++-- packages/@aws-cdk/app-delivery/package.json | 4 ++-- packages/@aws-cdk/assert/package.json | 4 ++-- packages/@aws-cdk/assets/package.json | 4 ++-- packages/@aws-cdk/aws-accessanalyzer/package.json | 4 ++-- packages/@aws-cdk/aws-acmpca/package.json | 4 ++-- packages/@aws-cdk/aws-amazonmq/package.json | 4 ++-- packages/@aws-cdk/aws-amplify/package.json | 4 ++-- packages/@aws-cdk/aws-apigateway/package.json | 4 ++-- packages/@aws-cdk/aws-apigatewayv2/README.md | 6 +----- packages/@aws-cdk/aws-apigatewayv2/package.json | 4 ++-- packages/@aws-cdk/aws-appconfig/package.json | 4 ++-- packages/@aws-cdk/aws-applicationautoscaling/package.json | 4 ++-- packages/@aws-cdk/aws-appmesh/package.json | 4 ++-- packages/@aws-cdk/aws-appstream/package.json | 4 ++-- packages/@aws-cdk/aws-appsync/package.json | 4 ++-- packages/@aws-cdk/aws-athena/package.json | 4 ++-- packages/@aws-cdk/aws-autoscaling-common/package.json | 4 ++-- packages/@aws-cdk/aws-autoscaling-hooktargets/package.json | 4 ++-- packages/@aws-cdk/aws-autoscaling/package.json | 4 ++-- packages/@aws-cdk/aws-autoscalingplans/package.json | 4 ++-- packages/@aws-cdk/aws-backup/package.json | 4 ++-- packages/@aws-cdk/aws-batch/package.json | 4 ++-- packages/@aws-cdk/aws-budgets/package.json | 4 ++-- packages/@aws-cdk/aws-certificatemanager/package.json | 4 ++-- packages/@aws-cdk/aws-cloud9/package.json | 4 ++-- packages/@aws-cdk/aws-cloudformation/package.json | 4 ++-- packages/@aws-cdk/aws-cloudfront/package.json | 4 ++-- packages/@aws-cdk/aws-cloudtrail/package.json | 4 ++-- packages/@aws-cdk/aws-cloudwatch-actions/package.json | 4 ++-- packages/@aws-cdk/aws-cloudwatch/package.json | 4 ++-- packages/@aws-cdk/aws-codebuild/package.json | 4 ++-- packages/@aws-cdk/aws-codecommit/package.json | 4 ++-- packages/@aws-cdk/aws-codedeploy/package.json | 4 ++-- packages/@aws-cdk/aws-codeguruprofiler/package.json | 4 ++-- packages/@aws-cdk/aws-codepipeline-actions/package.json | 4 ++-- packages/@aws-cdk/aws-codepipeline/package.json | 4 ++-- packages/@aws-cdk/aws-codestar/package.json | 4 ++-- packages/@aws-cdk/aws-codestarnotifications/package.json | 4 ++-- packages/@aws-cdk/aws-cognito/package.json | 4 ++-- packages/@aws-cdk/aws-config/package.json | 4 ++-- packages/@aws-cdk/aws-datapipeline/package.json | 4 ++-- packages/@aws-cdk/aws-dax/package.json | 4 ++-- packages/@aws-cdk/aws-directoryservice/package.json | 4 ++-- packages/@aws-cdk/aws-dlm/package.json | 4 ++-- packages/@aws-cdk/aws-dms/package.json | 4 ++-- packages/@aws-cdk/aws-docdb/package.json | 4 ++-- packages/@aws-cdk/aws-dynamodb-global/package.json | 4 ++-- packages/@aws-cdk/aws-dynamodb/package.json | 4 ++-- packages/@aws-cdk/aws-ec2/package.json | 4 ++-- packages/@aws-cdk/aws-ecr-assets/package.json | 4 ++-- packages/@aws-cdk/aws-ecr/package.json | 4 ++-- packages/@aws-cdk/aws-ecs-patterns/package.json | 4 ++-- packages/@aws-cdk/aws-ecs/package.json | 4 ++-- packages/@aws-cdk/aws-efs/package.json | 4 ++-- packages/@aws-cdk/aws-eks-legacy/package.json | 4 ++-- packages/@aws-cdk/aws-eks/package.json | 4 ++-- packages/@aws-cdk/aws-elasticache/package.json | 4 ++-- packages/@aws-cdk/aws-elasticbeanstalk/package.json | 4 ++-- packages/@aws-cdk/aws-elasticloadbalancing/package.json | 4 ++-- .../aws-elasticloadbalancingv2-actions/package.json | 4 ++-- .../aws-elasticloadbalancingv2-targets/package.json | 4 ++-- packages/@aws-cdk/aws-elasticloadbalancingv2/README.md | 2 -- packages/@aws-cdk/aws-elasticloadbalancingv2/package.json | 4 ++-- packages/@aws-cdk/aws-elasticsearch/package.json | 4 ++-- packages/@aws-cdk/aws-emr/package.json | 4 ++-- packages/@aws-cdk/aws-events-targets/package.json | 4 ++-- packages/@aws-cdk/aws-events/package.json | 4 ++-- packages/@aws-cdk/aws-eventschemas/package.json | 4 ++-- packages/@aws-cdk/aws-fms/package.json | 4 ++-- packages/@aws-cdk/aws-fsx/package.json | 4 ++-- packages/@aws-cdk/aws-gamelift/package.json | 4 ++-- packages/@aws-cdk/aws-globalaccelerator/package.json | 4 ++-- packages/@aws-cdk/aws-glue/package.json | 4 ++-- packages/@aws-cdk/aws-greengrass/package.json | 4 ++-- packages/@aws-cdk/aws-guardduty/package.json | 4 ++-- packages/@aws-cdk/aws-iam/package.json | 4 ++-- packages/@aws-cdk/aws-inspector/package.json | 4 ++-- packages/@aws-cdk/aws-iot/package.json | 4 ++-- packages/@aws-cdk/aws-iot1click/package.json | 4 ++-- packages/@aws-cdk/aws-iotanalytics/package.json | 4 ++-- packages/@aws-cdk/aws-iotevents/package.json | 4 ++-- packages/@aws-cdk/aws-iotthingsgraph/package.json | 4 ++-- packages/@aws-cdk/aws-kinesis/package.json | 4 ++-- packages/@aws-cdk/aws-kinesisanalytics/package.json | 4 ++-- packages/@aws-cdk/aws-kinesisfirehose/package.json | 4 ++-- packages/@aws-cdk/aws-kms/package.json | 4 ++-- packages/@aws-cdk/aws-lakeformation/package.json | 4 ++-- packages/@aws-cdk/aws-lambda-destinations/package.json | 4 ++-- packages/@aws-cdk/aws-lambda-event-sources/package.json | 4 ++-- packages/@aws-cdk/aws-lambda-nodejs/package.json | 4 ++-- packages/@aws-cdk/aws-lambda/package.json | 4 ++-- packages/@aws-cdk/aws-logs-destinations/package.json | 4 ++-- packages/@aws-cdk/aws-logs/package.json | 4 ++-- packages/@aws-cdk/aws-managedblockchain/package.json | 4 ++-- packages/@aws-cdk/aws-mediaconvert/package.json | 4 ++-- packages/@aws-cdk/aws-medialive/package.json | 4 ++-- packages/@aws-cdk/aws-mediastore/package.json | 4 ++-- packages/@aws-cdk/aws-msk/package.json | 4 ++-- packages/@aws-cdk/aws-neptune/package.json | 4 ++-- packages/@aws-cdk/aws-opsworks/package.json | 4 ++-- packages/@aws-cdk/aws-opsworkscm/package.json | 4 ++-- packages/@aws-cdk/aws-pinpoint/package.json | 4 ++-- packages/@aws-cdk/aws-pinpointemail/package.json | 4 ++-- packages/@aws-cdk/aws-qldb/package.json | 4 ++-- packages/@aws-cdk/aws-ram/package.json | 4 ++-- packages/@aws-cdk/aws-rds/package.json | 4 ++-- packages/@aws-cdk/aws-redshift/package.json | 4 ++-- packages/@aws-cdk/aws-robomaker/package.json | 4 ++-- packages/@aws-cdk/aws-route53-patterns/package.json | 4 ++-- packages/@aws-cdk/aws-route53-targets/package.json | 4 ++-- packages/@aws-cdk/aws-route53/package.json | 4 ++-- packages/@aws-cdk/aws-route53resolver/README.md | 4 ---- packages/@aws-cdk/aws-route53resolver/package.json | 4 ++-- packages/@aws-cdk/aws-s3-assets/package.json | 4 ++-- packages/@aws-cdk/aws-s3-deployment/package.json | 4 ++-- packages/@aws-cdk/aws-s3-notifications/package.json | 4 ++-- packages/@aws-cdk/aws-s3/package.json | 4 ++-- packages/@aws-cdk/aws-sagemaker/package.json | 4 ++-- packages/@aws-cdk/aws-sam/package.json | 4 ++-- packages/@aws-cdk/aws-sdb/package.json | 4 ++-- packages/@aws-cdk/aws-secretsmanager/package.json | 4 ++-- packages/@aws-cdk/aws-securityhub/package.json | 4 ++-- packages/@aws-cdk/aws-servicecatalog/package.json | 4 ++-- packages/@aws-cdk/aws-servicediscovery/package.json | 4 ++-- packages/@aws-cdk/aws-ses-actions/package.json | 4 ++-- packages/@aws-cdk/aws-ses/package.json | 4 ++-- packages/@aws-cdk/aws-sns-subscriptions/package.json | 4 ++-- packages/@aws-cdk/aws-sns/package.json | 4 ++-- packages/@aws-cdk/aws-sqs/package.json | 4 ++-- packages/@aws-cdk/aws-ssm/package.json | 4 ++-- packages/@aws-cdk/aws-stepfunctions-tasks/package.json | 4 ++-- packages/@aws-cdk/aws-stepfunctions/package.json | 4 ++-- packages/@aws-cdk/aws-transfer/package.json | 4 ++-- packages/@aws-cdk/aws-waf/package.json | 4 ++-- packages/@aws-cdk/aws-wafregional/package.json | 4 ++-- packages/@aws-cdk/aws-wafv2/package.json | 4 ++-- packages/@aws-cdk/aws-workspaces/package.json | 4 ++-- packages/@aws-cdk/cloudformation-include/package.json | 4 ++-- packages/@aws-cdk/core/lib/app.ts | 2 +- packages/@aws-cdk/core/lib/private/construct-settings.ts | 2 +- packages/@aws-cdk/core/package.json | 4 ++-- packages/@aws-cdk/custom-resources/package.json | 4 ++-- packages/@aws-cdk/example-construct-library/package.json | 4 ++-- packages/@monocdk-experiment/assert/package.json | 4 ++-- packages/decdk/package.json | 2 +- packages/monocdk-experiment/package.json | 4 ++-- tools/pkglint/lib/rules.ts | 2 +- 149 files changed, 287 insertions(+), 301 deletions(-) diff --git a/packages/@aws-cdk/alexa-ask/README.md b/packages/@aws-cdk/alexa-ask/README.md index fcf3976ab1057..6850302a7b516 100644 --- a/packages/@aws-cdk/alexa-ask/README.md +++ b/packages/@aws-cdk/alexa-ask/README.md @@ -6,10 +6,6 @@ > All classes with the `Cfn` prefix in this module ([CFN Resources](https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_lib)) are always stable and safe to use. -![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge) - -> The APIs of higher level constructs in this module are experimental and under active development. They are subject to non-backward compatible changes or removal in any future version. These are not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be announced in the release notes. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package. - --- diff --git a/packages/@aws-cdk/alexa-ask/package.json b/packages/@aws-cdk/alexa-ask/package.json index 0780dc4abc2f3..d2b6a289ae1a9 100644 --- a/packages/@aws-cdk/alexa-ask/package.json +++ b/packages/@aws-cdk/alexa-ask/package.json @@ -71,11 +71,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/app-delivery/package.json b/packages/@aws-cdk/app-delivery/package.json index 921d5a3baa485..92d330c25f594 100644 --- a/packages/@aws-cdk/app-delivery/package.json +++ b/packages/@aws-cdk/app-delivery/package.json @@ -49,7 +49,7 @@ "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "devDependencies": { "@aws-cdk/assert": "0.0.0", @@ -87,7 +87,7 @@ "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/assert/package.json b/packages/@aws-cdk/assert/package.json index 41d9dba86351b..9b177f80f5599 100644 --- a/packages/@aws-cdk/assert/package.json +++ b/packages/@aws-cdk/assert/package.json @@ -32,12 +32,12 @@ "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", "jest": "^25.5.4", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "repository": { "url": "https://github.com/aws/aws-cdk.git", diff --git a/packages/@aws-cdk/assets/package.json b/packages/@aws-cdk/assets/package.json index b6168378f99e7..4315b9bc7a362 100644 --- a/packages/@aws-cdk/assets/package.json +++ b/packages/@aws-cdk/assets/package.json @@ -77,13 +77,13 @@ "dependencies": { "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 58eeffa453713..ddb5bd4e09f78 100644 --- a/packages/@aws-cdk/aws-accessanalyzer/package.json +++ b/packages/@aws-cdk/aws-accessanalyzer/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 d1117277f1ccc..8b3b044697a30 100644 --- a/packages/@aws-cdk/aws-acmpca/package.json +++ b/packages/@aws-cdk/aws-acmpca/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 1ed841f3d83d5..04e0469d03c8d 100644 --- a/packages/@aws-cdk/aws-amazonmq/package.json +++ b/packages/@aws-cdk/aws-amazonmq/package.json @@ -71,11 +71,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-amplify/package.json b/packages/@aws-cdk/aws-amplify/package.json index 8fd2db8cc1e31..0e9a34634ebc2 100644 --- a/packages/@aws-cdk/aws-amplify/package.json +++ b/packages/@aws-cdk/aws-amplify/package.json @@ -78,7 +78,7 @@ "@aws-cdk/aws-codecommit": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/aws-iam": "0.0.0", @@ -87,7 +87,7 @@ "@aws-cdk/aws-codecommit": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-apigateway/package.json b/packages/@aws-cdk/aws-apigateway/package.json index 43e041b72719b..861869751a3c2 100644 --- a/packages/@aws-cdk/aws-apigateway/package.json +++ b/packages/@aws-cdk/aws-apigateway/package.json @@ -82,7 +82,7 @@ "@aws-cdk/aws-s3-assets": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -97,7 +97,7 @@ "@aws-cdk/aws-s3-assets": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-apigatewayv2/README.md b/packages/@aws-cdk/aws-apigatewayv2/README.md index a885fa9979695..ce0abacc97ee3 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/README.md +++ b/packages/@aws-cdk/aws-apigatewayv2/README.md @@ -1,5 +1,4 @@ ## AWS::APIGatewayv2 Construct Library - --- @@ -7,13 +6,10 @@ > All classes with the `Cfn` prefix in this module ([CFN Resources](https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_lib)) are always stable and safe to use. -![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge) - -> The APIs of higher level constructs in this module are experimental and under active development. They are subject to non-backward compatible changes or removal in any future version. These are not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be announced in the release notes. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package. - --- + ## Table of Contents - [Introduction](#introduction) diff --git a/packages/@aws-cdk/aws-apigatewayv2/package.json b/packages/@aws-cdk/aws-apigatewayv2/package.json index 455be870c237a..ef7f7e9fb0ec3 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/package.json +++ b/packages/@aws-cdk/aws-apigatewayv2/package.json @@ -74,13 +74,13 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 fd4d1831a83c0..0c64d8c34334c 100644 --- a/packages/@aws-cdk/aws-appconfig/package.json +++ b/packages/@aws-cdk/aws-appconfig/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-applicationautoscaling/package.json b/packages/@aws-cdk/aws-applicationautoscaling/package.json index 66cb34dd6ad8b..cb4fdbd04a5a2 100644 --- a/packages/@aws-cdk/aws-applicationautoscaling/package.json +++ b/packages/@aws-cdk/aws-applicationautoscaling/package.json @@ -75,7 +75,7 @@ "@aws-cdk/aws-cloudwatch": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -83,7 +83,7 @@ "@aws-cdk/aws-cloudwatch": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-appmesh/package.json b/packages/@aws-cdk/aws-appmesh/package.json index 627a3398ddd0e..b443886fb0c09 100644 --- a/packages/@aws-cdk/aws-appmesh/package.json +++ b/packages/@aws-cdk/aws-appmesh/package.json @@ -80,14 +80,14 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-servicediscovery": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/aws-ec2": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-servicediscovery": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 268f7d2ba7493..a7e309d33a09b 100644 --- a/packages/@aws-cdk/aws-appstream/package.json +++ b/packages/@aws-cdk/aws-appstream/package.json @@ -71,11 +71,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-appsync/package.json b/packages/@aws-cdk/aws-appsync/package.json index 4a312f78f0575..39868be68cb3e 100644 --- a/packages/@aws-cdk/aws-appsync/package.json +++ b/packages/@aws-cdk/aws-appsync/package.json @@ -76,7 +76,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -85,7 +85,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 0efddaf0d3fc3..5d69cd1791fe0 100644 --- a/packages/@aws-cdk/aws-athena/package.json +++ b/packages/@aws-cdk/aws-athena/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-autoscaling-common/package.json b/packages/@aws-cdk/aws-autoscaling-common/package.json index 81a4863553519..fb0ddab2d6702 100644 --- a/packages/@aws-cdk/aws-autoscaling-common/package.json +++ b/packages/@aws-cdk/aws-autoscaling-common/package.json @@ -69,13 +69,13 @@ "dependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "awslint": { "exclude": [ diff --git a/packages/@aws-cdk/aws-autoscaling-hooktargets/package.json b/packages/@aws-cdk/aws-autoscaling-hooktargets/package.json index 2cb6997c6d5eb..b653638fc8f82 100644 --- a/packages/@aws-cdk/aws-autoscaling-hooktargets/package.json +++ b/packages/@aws-cdk/aws-autoscaling-hooktargets/package.json @@ -74,7 +74,7 @@ "@aws-cdk/aws-sns-subscriptions": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -85,7 +85,7 @@ "@aws-cdk/aws-sns-subscriptions": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-autoscaling/package.json b/packages/@aws-cdk/aws-autoscaling/package.json index a87777c5adb7e..75207298e3455 100644 --- a/packages/@aws-cdk/aws-autoscaling/package.json +++ b/packages/@aws-cdk/aws-autoscaling/package.json @@ -81,7 +81,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -93,7 +93,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-autoscalingplans/package.json b/packages/@aws-cdk/aws-autoscalingplans/package.json index 33d06952fd906..d55e4b5938f31 100644 --- a/packages/@aws-cdk/aws-autoscalingplans/package.json +++ b/packages/@aws-cdk/aws-autoscalingplans/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-backup/package.json b/packages/@aws-cdk/aws-backup/package.json index ee3f9d9bb52df..768e886856481 100644 --- a/packages/@aws-cdk/aws-backup/package.json +++ b/packages/@aws-cdk/aws-backup/package.json @@ -81,7 +81,7 @@ "@aws-cdk/aws-rds": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/aws-dynamodb": "0.0.0", @@ -93,7 +93,7 @@ "@aws-cdk/aws-rds": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-batch/package.json b/packages/@aws-cdk/aws-batch/package.json index 03cf0b3a097ac..a52ce330911e3 100644 --- a/packages/@aws-cdk/aws-batch/package.json +++ b/packages/@aws-cdk/aws-batch/package.json @@ -76,7 +76,7 @@ "@aws-cdk/aws-ecr": "0.0.0", "@aws-cdk/aws-ecs": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -85,7 +85,7 @@ "@aws-cdk/aws-ecr": "0.0.0", "@aws-cdk/aws-ecs": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 665e1f65bad6d..b9b4c34076b3c 100644 --- a/packages/@aws-cdk/aws-budgets/package.json +++ b/packages/@aws-cdk/aws-budgets/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-certificatemanager/package.json b/packages/@aws-cdk/aws-certificatemanager/package.json index ea1e12a742290..a5cfdc1cd0b48 100644 --- a/packages/@aws-cdk/aws-certificatemanager/package.json +++ b/packages/@aws-cdk/aws-certificatemanager/package.json @@ -74,7 +74,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-route53": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -82,7 +82,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-route53": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 977a087bc3ec6..6f7fe42437bba 100644 --- a/packages/@aws-cdk/aws-cloud9/package.json +++ b/packages/@aws-cdk/aws-cloud9/package.json @@ -74,14 +74,14 @@ "@aws-cdk/core": "0.0.0", "@aws-cdk/aws-codecommit": "0.0.0", "@aws-cdk/aws-ec2": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-cloudformation/package.json b/packages/@aws-cdk/aws-cloudformation/package.json index e52f11a6126c1..80adc8012e02d 100644 --- a/packages/@aws-cdk/aws-cloudformation/package.json +++ b/packages/@aws-cdk/aws-cloudformation/package.json @@ -83,7 +83,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -93,7 +93,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-cloudfront/package.json b/packages/@aws-cdk/aws-cloudfront/package.json index bcb3052981e62..69d0187face31 100644 --- a/packages/@aws-cdk/aws-cloudfront/package.json +++ b/packages/@aws-cdk/aws-cloudfront/package.json @@ -78,7 +78,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -88,7 +88,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-cloudtrail/package.json b/packages/@aws-cdk/aws-cloudtrail/package.json index 235774d2a52c3..b82c8e49bc532 100644 --- a/packages/@aws-cdk/aws-cloudtrail/package.json +++ b/packages/@aws-cdk/aws-cloudtrail/package.json @@ -81,7 +81,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -93,7 +93,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "awslint": { "exclude": [ diff --git a/packages/@aws-cdk/aws-cloudwatch-actions/package.json b/packages/@aws-cdk/aws-cloudwatch-actions/package.json index c062d152c1a6a..2449f0a0c0eca 100644 --- a/packages/@aws-cdk/aws-cloudwatch-actions/package.json +++ b/packages/@aws-cdk/aws-cloudwatch-actions/package.json @@ -73,7 +73,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -83,7 +83,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-cloudwatch/package.json b/packages/@aws-cdk/aws-cloudwatch/package.json index 1d0fba8dda1ea..80d7f52ec6ad4 100644 --- a/packages/@aws-cdk/aws-cloudwatch/package.json +++ b/packages/@aws-cdk/aws-cloudwatch/package.json @@ -73,13 +73,13 @@ "dependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "awslint": { "exclude": [ diff --git a/packages/@aws-cdk/aws-codebuild/package.json b/packages/@aws-cdk/aws-codebuild/package.json index ddfd79158f15d..b8bf8dec5000d 100644 --- a/packages/@aws-cdk/aws-codebuild/package.json +++ b/packages/@aws-cdk/aws-codebuild/package.json @@ -91,7 +91,7 @@ "@aws-cdk/aws-s3-assets": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -108,7 +108,7 @@ "@aws-cdk/aws-s3-assets": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 4771e2e597860..5edfd039500f5 100644 --- a/packages/@aws-cdk/aws-codecommit/package.json +++ b/packages/@aws-cdk/aws-codecommit/package.json @@ -81,14 +81,14 @@ "@aws-cdk/aws-events": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-codedeploy/package.json b/packages/@aws-cdk/aws-codedeploy/package.json index a424b23f6b4b1..523d79122f1d3 100644 --- a/packages/@aws-cdk/aws-codedeploy/package.json +++ b/packages/@aws-cdk/aws-codedeploy/package.json @@ -83,7 +83,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -96,7 +96,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 263f1b6b57e8f..57d6f531055f2 100644 --- a/packages/@aws-cdk/aws-codeguruprofiler/package.json +++ b/packages/@aws-cdk/aws-codeguruprofiler/package.json @@ -74,12 +74,12 @@ "dependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-codepipeline-actions/package.json b/packages/@aws-cdk/aws-codepipeline-actions/package.json index 6436d1dfaf6f4..95d132cc809f9 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/package.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/package.json @@ -90,7 +90,7 @@ "@aws-cdk/aws-sns-subscriptions": "0.0.0", "@aws-cdk/core": "0.0.0", "case": "1.6.3", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -110,7 +110,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/aws-sns-subscriptions": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "bundledDependencies": [ "case" diff --git a/packages/@aws-cdk/aws-codepipeline/package.json b/packages/@aws-cdk/aws-codepipeline/package.json index e79af2610b30e..6c585f52e28c4 100644 --- a/packages/@aws-cdk/aws-codepipeline/package.json +++ b/packages/@aws-cdk/aws-codepipeline/package.json @@ -82,7 +82,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -91,7 +91,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-codestar/package.json b/packages/@aws-cdk/aws-codestar/package.json index b0e7360eb20ff..1e381cad2a86d 100644 --- a/packages/@aws-cdk/aws-codestar/package.json +++ b/packages/@aws-cdk/aws-codestar/package.json @@ -74,12 +74,12 @@ "dependencies": { "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 e0f83c904a3bf..28e4200bd5435 100644 --- a/packages/@aws-cdk/aws-codestarnotifications/package.json +++ b/packages/@aws-cdk/aws-codestarnotifications/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 4affcf8a748c0..ca6e2601ec878 100644 --- a/packages/@aws-cdk/aws-cognito/package.json +++ b/packages/@aws-cdk/aws-cognito/package.json @@ -78,7 +78,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -87,7 +87,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-config/package.json b/packages/@aws-cdk/aws-config/package.json index 815002b198693..72cafd42c72bb 100644 --- a/packages/@aws-cdk/aws-config/package.json +++ b/packages/@aws-cdk/aws-config/package.json @@ -77,7 +77,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -86,7 +86,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-datapipeline/package.json b/packages/@aws-cdk/aws-datapipeline/package.json index 6241408d8b4db..167aa469b2708 100644 --- a/packages/@aws-cdk/aws-datapipeline/package.json +++ b/packages/@aws-cdk/aws-datapipeline/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-dax/package.json b/packages/@aws-cdk/aws-dax/package.json index 832eef0889ffc..f754ca0917b15 100644 --- a/packages/@aws-cdk/aws-dax/package.json +++ b/packages/@aws-cdk/aws-dax/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-directoryservice/package.json b/packages/@aws-cdk/aws-directoryservice/package.json index 864be4883ac18..0851c7647387f 100644 --- a/packages/@aws-cdk/aws-directoryservice/package.json +++ b/packages/@aws-cdk/aws-directoryservice/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 7a1501c04cf14..e7cd34bb37cac 100644 --- a/packages/@aws-cdk/aws-dlm/package.json +++ b/packages/@aws-cdk/aws-dlm/package.json @@ -71,11 +71,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 d18b689160ac1..46da0f6bd2cd2 100644 --- a/packages/@aws-cdk/aws-dms/package.json +++ b/packages/@aws-cdk/aws-dms/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 7d481895413bf..988c7f1702138 100644 --- a/packages/@aws-cdk/aws-docdb/package.json +++ b/packages/@aws-cdk/aws-docdb/package.json @@ -77,7 +77,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/aws-efs": "0.0.0", @@ -85,7 +85,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-dynamodb-global/package.json b/packages/@aws-cdk/aws-dynamodb-global/package.json index 439c7a7f88aab..2c0c0f88245f8 100644 --- a/packages/@aws-cdk/aws-dynamodb-global/package.json +++ b/packages/@aws-cdk/aws-dynamodb-global/package.json @@ -50,7 +50,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "devDependencies": { "@aws-cdk/assert": "0.0.0", @@ -65,7 +65,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "scripts": { "build": "cdk-build", diff --git a/packages/@aws-cdk/aws-dynamodb/package.json b/packages/@aws-cdk/aws-dynamodb/package.json index 8d8f284019d5e..0a798316858c4 100644 --- a/packages/@aws-cdk/aws-dynamodb/package.json +++ b/packages/@aws-cdk/aws-dynamodb/package.json @@ -83,7 +83,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -94,7 +94,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-ec2/package.json b/packages/@aws-cdk/aws-ec2/package.json index 66b6f7736aa9a..f9917f0523906 100644 --- a/packages/@aws-cdk/aws-ec2/package.json +++ b/packages/@aws-cdk/aws-ec2/package.json @@ -82,7 +82,7 @@ "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -96,7 +96,7 @@ "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-ecr-assets/package.json b/packages/@aws-cdk/aws-ecr-assets/package.json index 97424cd312769..d27c871b9deb4 100644 --- a/packages/@aws-cdk/aws-ecr-assets/package.json +++ b/packages/@aws-cdk/aws-ecr-assets/package.json @@ -79,7 +79,7 @@ "@aws-cdk/assets": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "minimatch": "^3.0.4", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -90,7 +90,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "nyc": { "statements": 70 diff --git a/packages/@aws-cdk/aws-ecr/package.json b/packages/@aws-cdk/aws-ecr/package.json index f9c5274804822..8526590dd58d0 100644 --- a/packages/@aws-cdk/aws-ecr/package.json +++ b/packages/@aws-cdk/aws-ecr/package.json @@ -79,7 +79,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -87,7 +87,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-ecs-patterns/package.json b/packages/@aws-cdk/aws-ecs-patterns/package.json index 0ce5c9f8074f4..6fb679c788796 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/package.json +++ b/packages/@aws-cdk/aws-ecs-patterns/package.json @@ -82,7 +82,7 @@ "@aws-cdk/aws-servicediscovery": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -99,7 +99,7 @@ "@aws-cdk/aws-servicediscovery": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-ecs/package.json b/packages/@aws-cdk/aws-ecs/package.json index af006d82275b3..c46cc6eb6796b 100644 --- a/packages/@aws-cdk/aws-ecs/package.json +++ b/packages/@aws-cdk/aws-ecs/package.json @@ -96,7 +96,7 @@ "@aws-cdk/aws-ssm": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -122,7 +122,7 @@ "@aws-cdk/aws-ssm": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 5ad4e98cca10f..a183b64ba2b9a 100644 --- a/packages/@aws-cdk/aws-efs/package.json +++ b/packages/@aws-cdk/aws-efs/package.json @@ -75,7 +75,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -84,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": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-eks-legacy/package.json b/packages/@aws-cdk/aws-eks-legacy/package.json index 8a2be7d7ea219..9933002a29f8c 100644 --- a/packages/@aws-cdk/aws-eks-legacy/package.json +++ b/packages/@aws-cdk/aws-eks-legacy/package.json @@ -78,7 +78,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-ssm": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -89,7 +89,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-ssm": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-eks/package.json b/packages/@aws-cdk/aws-eks/package.json index cf01a4ecc22af..094bfed6ae149 100644 --- a/packages/@aws-cdk/aws-eks/package.json +++ b/packages/@aws-cdk/aws-eks/package.json @@ -81,7 +81,7 @@ "@aws-cdk/aws-ssm": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", - "constructs": "4.1.1-pre.0", + "constructs": "4.1.1-pre.1", "yaml": "1.10.0" }, "bundledDependencies": [ @@ -96,7 +96,7 @@ "@aws-cdk/aws-ssm": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-elasticache/package.json b/packages/@aws-cdk/aws-elasticache/package.json index c58b9696502c1..573a6b8afc863 100644 --- a/packages/@aws-cdk/aws-elasticache/package.json +++ b/packages/@aws-cdk/aws-elasticache/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 99d0b37df6a88..07477737b2e20 100644 --- a/packages/@aws-cdk/aws-elasticbeanstalk/package.json +++ b/packages/@aws-cdk/aws-elasticbeanstalk/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 be91874ed8aa4..906864a818449 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancing/package.json +++ b/packages/@aws-cdk/aws-elasticloadbalancing/package.json @@ -73,13 +73,13 @@ "dependencies": { "@aws-cdk/aws-ec2": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-ec2": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 5cbb397836965..bbde2d891ff44 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2-actions/package.json +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2-actions/package.json @@ -71,7 +71,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-cognito": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -80,7 +80,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-cognito": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 c69449cdbca59..e61048bf778ca 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2-targets/package.json +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2-targets/package.json @@ -71,7 +71,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -80,7 +80,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/README.md b/packages/@aws-cdk/aws-elasticloadbalancingv2/README.md index 4ef361dd5512c..5ce453e0595d5 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/README.md +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/README.md @@ -4,8 +4,6 @@ ![cfn-resources: Stable](https://img.shields.io/badge/cfn--resources-stable-success.svg?style=for-the-badge) -![cdk-constructs: Stable](https://img.shields.io/badge/cdk--constructs-stable-success.svg?style=for-the-badge) - --- diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/package.json b/packages/@aws-cdk/aws-elasticloadbalancingv2/package.json index 2e800caf25834..80427c6c655be 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/package.json +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/package.json @@ -78,7 +78,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -89,7 +89,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-elasticsearch/package.json b/packages/@aws-cdk/aws-elasticsearch/package.json index 105ada465da78..8693077873b74 100644 --- a/packages/@aws-cdk/aws-elasticsearch/package.json +++ b/packages/@aws-cdk/aws-elasticsearch/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 5a0773900b2d4..b9b1d03e70d45 100644 --- a/packages/@aws-cdk/aws-emr/package.json +++ b/packages/@aws-cdk/aws-emr/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-events-targets/package.json b/packages/@aws-cdk/aws-events-targets/package.json index 786defdfc8051..1b9bdf487b2b6 100644 --- a/packages/@aws-cdk/aws-events-targets/package.json +++ b/packages/@aws-cdk/aws-events-targets/package.json @@ -90,7 +90,7 @@ "@aws-cdk/aws-batch": "0.0.0", "@aws-cdk/aws-kinesis": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -107,7 +107,7 @@ "@aws-cdk/aws-stepfunctions": "0.0.0", "@aws-cdk/aws-batch": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0", + "constructs": "4.1.1-pre.1", "@aws-cdk/aws-kinesis": "0.0.0" }, "engines": { diff --git a/packages/@aws-cdk/aws-events/package.json b/packages/@aws-cdk/aws-events/package.json index eb5226ce3778d..4972e58a70741 100644 --- a/packages/@aws-cdk/aws-events/package.json +++ b/packages/@aws-cdk/aws-events/package.json @@ -74,13 +74,13 @@ "dependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-eventschemas/package.json b/packages/@aws-cdk/aws-eventschemas/package.json index 5c1b758f739d2..78aab4e4521cc 100644 --- a/packages/@aws-cdk/aws-eventschemas/package.json +++ b/packages/@aws-cdk/aws-eventschemas/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 fc9bc7109efc8..393a779392297 100644 --- a/packages/@aws-cdk/aws-fms/package.json +++ b/packages/@aws-cdk/aws-fms/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 da7c61e9718c9..444c6e50c1157 100644 --- a/packages/@aws-cdk/aws-fsx/package.json +++ b/packages/@aws-cdk/aws-fsx/package.json @@ -76,14 +76,14 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 6773dcfbefad6..b40bca636f4b5 100644 --- a/packages/@aws-cdk/aws-gamelift/package.json +++ b/packages/@aws-cdk/aws-gamelift/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-globalaccelerator/package.json b/packages/@aws-cdk/aws-globalaccelerator/package.json index f8fb6fb3c55bd..024d1dafaabcb 100644 --- a/packages/@aws-cdk/aws-globalaccelerator/package.json +++ b/packages/@aws-cdk/aws-globalaccelerator/package.json @@ -75,11 +75,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-glue/package.json b/packages/@aws-cdk/aws-glue/package.json index 7a4de9ddfd397..8554bb901a499 100644 --- a/packages/@aws-cdk/aws-glue/package.json +++ b/packages/@aws-cdk/aws-glue/package.json @@ -75,7 +75,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -83,7 +83,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 e9c908e84d534..89aaf56c7c506 100644 --- a/packages/@aws-cdk/aws-greengrass/package.json +++ b/packages/@aws-cdk/aws-greengrass/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-guardduty/package.json b/packages/@aws-cdk/aws-guardduty/package.json index 121dc4f8df4ff..bcf5d9826dcd8 100644 --- a/packages/@aws-cdk/aws-guardduty/package.json +++ b/packages/@aws-cdk/aws-guardduty/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-iam/package.json b/packages/@aws-cdk/aws-iam/package.json index 830e6230d907e..bf141427925a9 100644 --- a/packages/@aws-cdk/aws-iam/package.json +++ b/packages/@aws-cdk/aws-iam/package.json @@ -74,12 +74,12 @@ "dependencies": { "@aws-cdk/core": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "engines": { diff --git a/packages/@aws-cdk/aws-inspector/package.json b/packages/@aws-cdk/aws-inspector/package.json index 046e052a2646e..16738350690e1 100644 --- a/packages/@aws-cdk/aws-inspector/package.json +++ b/packages/@aws-cdk/aws-inspector/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 d46e15bf36cf8..f65b143053033 100644 --- a/packages/@aws-cdk/aws-iot/package.json +++ b/packages/@aws-cdk/aws-iot/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 03d79ef4fa82b..e726b3f27df6b 100644 --- a/packages/@aws-cdk/aws-iot1click/package.json +++ b/packages/@aws-cdk/aws-iot1click/package.json @@ -71,11 +71,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 b623e8d717e54..14678a3bb24d3 100644 --- a/packages/@aws-cdk/aws-iotanalytics/package.json +++ b/packages/@aws-cdk/aws-iotanalytics/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 984e3dedb530e..7f557b4095856 100644 --- a/packages/@aws-cdk/aws-iotevents/package.json +++ b/packages/@aws-cdk/aws-iotevents/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 13dffd01e7eb2..79d2f3c13fb6e 100644 --- a/packages/@aws-cdk/aws-iotthingsgraph/package.json +++ b/packages/@aws-cdk/aws-iotthingsgraph/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 738feecf37bbd..011878ccb82ca 100644 --- a/packages/@aws-cdk/aws-kinesis/package.json +++ b/packages/@aws-cdk/aws-kinesis/package.json @@ -74,7 +74,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -82,7 +82,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-kinesisanalytics/package.json b/packages/@aws-cdk/aws-kinesisanalytics/package.json index 4a1526f94f50b..6a008294eebbf 100644 --- a/packages/@aws-cdk/aws-kinesisanalytics/package.json +++ b/packages/@aws-cdk/aws-kinesisanalytics/package.json @@ -73,12 +73,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 967f9b17d88cd..aa82be52f8608 100644 --- a/packages/@aws-cdk/aws-kinesisfirehose/package.json +++ b/packages/@aws-cdk/aws-kinesisfirehose/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-kms/package.json b/packages/@aws-cdk/aws-kms/package.json index 0ad037d4987fd..bf9770c5cef31 100644 --- a/packages/@aws-cdk/aws-kms/package.json +++ b/packages/@aws-cdk/aws-kms/package.json @@ -73,13 +73,13 @@ "dependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-lakeformation/package.json b/packages/@aws-cdk/aws-lakeformation/package.json index b9460e7343370..e80245be8a092 100644 --- a/packages/@aws-cdk/aws-lakeformation/package.json +++ b/packages/@aws-cdk/aws-lakeformation/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-lambda-destinations/package.json b/packages/@aws-cdk/aws-lambda-destinations/package.json index 74144c9646739..5fe4854700553 100644 --- a/packages/@aws-cdk/aws-lambda-destinations/package.json +++ b/packages/@aws-cdk/aws-lambda-destinations/package.json @@ -72,7 +72,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -82,7 +82,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-lambda-event-sources/package.json b/packages/@aws-cdk/aws-lambda-event-sources/package.json index ac26238da3b16..16bd0cf34c12e 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/package.json +++ b/packages/@aws-cdk/aws-lambda-event-sources/package.json @@ -78,7 +78,7 @@ "@aws-cdk/aws-sns-subscriptions": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -94,7 +94,7 @@ "@aws-cdk/aws-sns-subscriptions": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-lambda-nodejs/package.json b/packages/@aws-cdk/aws-lambda-nodejs/package.json index 7ede38af5cae9..a52e6c320b890 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/package.json +++ b/packages/@aws-cdk/aws-lambda-nodejs/package.json @@ -67,13 +67,13 @@ "dependencies": { "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-lambda/package.json b/packages/@aws-cdk/aws-lambda/package.json index 5c2344004c84a..748ef3c91ecaa 100644 --- a/packages/@aws-cdk/aws-lambda/package.json +++ b/packages/@aws-cdk/aws-lambda/package.json @@ -93,7 +93,7 @@ "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -107,7 +107,7 @@ "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-logs-destinations/package.json b/packages/@aws-cdk/aws-logs-destinations/package.json index 4fe7db3faf6a1..a53bbb712e2f0 100644 --- a/packages/@aws-cdk/aws-logs-destinations/package.json +++ b/packages/@aws-cdk/aws-logs-destinations/package.json @@ -71,7 +71,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -80,7 +80,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-logs/package.json b/packages/@aws-cdk/aws-logs/package.json index 46bd6b88097d9..06769c67137f4 100644 --- a/packages/@aws-cdk/aws-logs/package.json +++ b/packages/@aws-cdk/aws-logs/package.json @@ -74,14 +74,14 @@ "@aws-cdk/aws-cloudwatch": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-cloudwatch": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 727af6f7ebf2f..1509ac832b5de 100644 --- a/packages/@aws-cdk/aws-managedblockchain/package.json +++ b/packages/@aws-cdk/aws-managedblockchain/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-mediaconvert/package.json b/packages/@aws-cdk/aws-mediaconvert/package.json index 30e7ea0b0abe6..3b9f223890ee1 100644 --- a/packages/@aws-cdk/aws-mediaconvert/package.json +++ b/packages/@aws-cdk/aws-mediaconvert/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 e1e0f4f930968..db3d6ef5e3971 100644 --- a/packages/@aws-cdk/aws-medialive/package.json +++ b/packages/@aws-cdk/aws-medialive/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 6d065601c48cf..5c1d514f30c76 100644 --- a/packages/@aws-cdk/aws-mediastore/package.json +++ b/packages/@aws-cdk/aws-mediastore/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 3c8db2ff73461..44c3224b64d02 100644 --- a/packages/@aws-cdk/aws-msk/package.json +++ b/packages/@aws-cdk/aws-msk/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-neptune/package.json b/packages/@aws-cdk/aws-neptune/package.json index 3348403d8ace2..a16b0c1380807 100644 --- a/packages/@aws-cdk/aws-neptune/package.json +++ b/packages/@aws-cdk/aws-neptune/package.json @@ -71,11 +71,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 b9ca88ac05ecd..69612612becea 100644 --- a/packages/@aws-cdk/aws-opsworks/package.json +++ b/packages/@aws-cdk/aws-opsworks/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 ca81e3bcc7919..867b24735dc6f 100644 --- a/packages/@aws-cdk/aws-opsworkscm/package.json +++ b/packages/@aws-cdk/aws-opsworkscm/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 8a75d0e98b9a2..663df1362e42c 100644 --- a/packages/@aws-cdk/aws-pinpoint/package.json +++ b/packages/@aws-cdk/aws-pinpoint/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 b0338e684c920..63d3703656478 100644 --- a/packages/@aws-cdk/aws-pinpointemail/package.json +++ b/packages/@aws-cdk/aws-pinpointemail/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 22152f3b71e80..dd08e33d72b1c 100644 --- a/packages/@aws-cdk/aws-qldb/package.json +++ b/packages/@aws-cdk/aws-qldb/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-ram/package.json b/packages/@aws-cdk/aws-ram/package.json index 632167f0a748d..3d4840154a793 100644 --- a/packages/@aws-cdk/aws-ram/package.json +++ b/packages/@aws-cdk/aws-ram/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-rds/package.json b/packages/@aws-cdk/aws-rds/package.json index d5b715fad2f45..ee70453dba1e1 100644 --- a/packages/@aws-cdk/aws-rds/package.json +++ b/packages/@aws-cdk/aws-rds/package.json @@ -82,7 +82,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -96,7 +96,7 @@ "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 f6c469f5f75c3..830e5285cad98 100644 --- a/packages/@aws-cdk/aws-redshift/package.json +++ b/packages/@aws-cdk/aws-redshift/package.json @@ -76,7 +76,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -86,7 +86,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 ff151cba11c12..3d6fc09c761fb 100644 --- a/packages/@aws-cdk/aws-robomaker/package.json +++ b/packages/@aws-cdk/aws-robomaker/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-route53-patterns/package.json b/packages/@aws-cdk/aws-route53-patterns/package.json index e4ff11b40cde7..8ed8530de318f 100644 --- a/packages/@aws-cdk/aws-route53-patterns/package.json +++ b/packages/@aws-cdk/aws-route53-patterns/package.json @@ -74,7 +74,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -86,7 +86,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-route53-targets/package.json b/packages/@aws-cdk/aws-route53-targets/package.json index 80106c93a44f8..bb6c58d653053 100644 --- a/packages/@aws-cdk/aws-route53-targets/package.json +++ b/packages/@aws-cdk/aws-route53-targets/package.json @@ -79,7 +79,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -94,7 +94,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-route53/package.json b/packages/@aws-cdk/aws-route53/package.json index e5e407fcb6828..1176190c153a2 100644 --- a/packages/@aws-cdk/aws-route53/package.json +++ b/packages/@aws-cdk/aws-route53/package.json @@ -76,7 +76,7 @@ "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -84,7 +84,7 @@ "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-route53resolver/README.md b/packages/@aws-cdk/aws-route53resolver/README.md index 3afc83c252d8f..917898616e54d 100644 --- a/packages/@aws-cdk/aws-route53resolver/README.md +++ b/packages/@aws-cdk/aws-route53resolver/README.md @@ -6,10 +6,6 @@ > All classes with the `Cfn` prefix in this module ([CFN Resources](https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_lib)) are always stable and safe to use. -![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge) - -> The APIs of higher level constructs in this module are experimental and under active development. They are subject to non-backward compatible changes or removal in any future version. These are not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be announced in the release notes. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package. - --- diff --git a/packages/@aws-cdk/aws-route53resolver/package.json b/packages/@aws-cdk/aws-route53resolver/package.json index 6d367e18836e3..99d1adefb2b62 100644 --- a/packages/@aws-cdk/aws-route53resolver/package.json +++ b/packages/@aws-cdk/aws-route53resolver/package.json @@ -71,11 +71,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-s3-assets/package.json b/packages/@aws-cdk/aws-s3-assets/package.json index 49d85d52b7faa..ac93b49a58537 100644 --- a/packages/@aws-cdk/aws-s3-assets/package.json +++ b/packages/@aws-cdk/aws-s3-assets/package.json @@ -75,7 +75,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -85,7 +85,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-s3-deployment/package.json b/packages/@aws-cdk/aws-s3-deployment/package.json index 40cc5cca206c5..199af096b7c06 100644 --- a/packages/@aws-cdk/aws-s3-deployment/package.json +++ b/packages/@aws-cdk/aws-s3-deployment/package.json @@ -90,7 +90,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-s3-assets": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -100,7 +100,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-s3-assets": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-s3-notifications/package.json b/packages/@aws-cdk/aws-s3-notifications/package.json index 0b03db34897b4..2a02103e6ac9e 100644 --- a/packages/@aws-cdk/aws-s3-notifications/package.json +++ b/packages/@aws-cdk/aws-s3-notifications/package.json @@ -71,7 +71,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -81,7 +81,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-s3/package.json b/packages/@aws-cdk/aws-s3/package.json index f7f5fb3f4cc09..e4201f53ebc29 100644 --- a/packages/@aws-cdk/aws-s3/package.json +++ b/packages/@aws-cdk/aws-s3/package.json @@ -75,7 +75,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -83,7 +83,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-sagemaker/package.json b/packages/@aws-cdk/aws-sagemaker/package.json index 908fe630d39e6..5ab714947e67a 100644 --- a/packages/@aws-cdk/aws-sagemaker/package.json +++ b/packages/@aws-cdk/aws-sagemaker/package.json @@ -71,11 +71,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 4195522f840ac..2420a431033b8 100644 --- a/packages/@aws-cdk/aws-sam/package.json +++ b/packages/@aws-cdk/aws-sam/package.json @@ -74,11 +74,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 6a9694c35afea..9909752355fbb 100644 --- a/packages/@aws-cdk/aws-sdb/package.json +++ b/packages/@aws-cdk/aws-sdb/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-secretsmanager/package.json b/packages/@aws-cdk/aws-secretsmanager/package.json index 9d8e553c6cb8e..7e802ea3e5bcc 100644 --- a/packages/@aws-cdk/aws-secretsmanager/package.json +++ b/packages/@aws-cdk/aws-secretsmanager/package.json @@ -78,7 +78,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-sam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/aws-ec2": "0.0.0", @@ -87,7 +87,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-sam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 0a8bb60d3fa67..9af9d5e7e83f6 100644 --- a/packages/@aws-cdk/aws-securityhub/package.json +++ b/packages/@aws-cdk/aws-securityhub/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 d2d5f050ace89..1c65c3bfeb2c0 100644 --- a/packages/@aws-cdk/aws-servicecatalog/package.json +++ b/packages/@aws-cdk/aws-servicecatalog/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-servicediscovery/package.json b/packages/@aws-cdk/aws-servicediscovery/package.json index 1395974e5a8ba..51a3ed7aa4fa0 100644 --- a/packages/@aws-cdk/aws-servicediscovery/package.json +++ b/packages/@aws-cdk/aws-servicediscovery/package.json @@ -78,7 +78,7 @@ "@aws-cdk/aws-elasticloadbalancingv2": "0.0.0", "@aws-cdk/aws-route53": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -86,7 +86,7 @@ "@aws-cdk/aws-elasticloadbalancingv2": "0.0.0", "@aws-cdk/aws-route53": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 8939e3070fc43..460f408ae430e 100644 --- a/packages/@aws-cdk/aws-ses-actions/package.json +++ b/packages/@aws-cdk/aws-ses-actions/package.json @@ -74,7 +74,7 @@ "@aws-cdk/aws-ses": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -85,7 +85,7 @@ "@aws-cdk/aws-ses": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-ses/package.json b/packages/@aws-cdk/aws-ses/package.json index bd26613d0ec73..af0a9192bb426 100644 --- a/packages/@aws-cdk/aws-ses/package.json +++ b/packages/@aws-cdk/aws-ses/package.json @@ -74,14 +74,14 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-sns-subscriptions/package.json b/packages/@aws-cdk/aws-sns-subscriptions/package.json index 5332297286bfc..c82174f46a719 100644 --- a/packages/@aws-cdk/aws-sns-subscriptions/package.json +++ b/packages/@aws-cdk/aws-sns-subscriptions/package.json @@ -71,7 +71,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -80,7 +80,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-sns/package.json b/packages/@aws-cdk/aws-sns/package.json index 3bae1d52ee263..0bbc501f4cf20 100644 --- a/packages/@aws-cdk/aws-sns/package.json +++ b/packages/@aws-cdk/aws-sns/package.json @@ -81,7 +81,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -91,7 +91,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-sqs/package.json b/packages/@aws-cdk/aws-sqs/package.json index e450ff387a4f4..f11099f887ff9 100644 --- a/packages/@aws-cdk/aws-sqs/package.json +++ b/packages/@aws-cdk/aws-sqs/package.json @@ -77,7 +77,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -85,7 +85,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-ssm/package.json b/packages/@aws-cdk/aws-ssm/package.json index 29994e587a5d3..81806315562e6 100644 --- a/packages/@aws-cdk/aws-ssm/package.json +++ b/packages/@aws-cdk/aws-ssm/package.json @@ -75,7 +75,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -83,7 +83,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 e1cd6afb30bf6..ee78dd681d6a5 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/package.json +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/package.json @@ -85,7 +85,7 @@ "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/aws-stepfunctions": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -106,7 +106,7 @@ "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/aws-stepfunctions": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-stepfunctions/package.json b/packages/@aws-cdk/aws-stepfunctions/package.json index 11e13d5451693..3750659d22fb7 100644 --- a/packages/@aws-cdk/aws-stepfunctions/package.json +++ b/packages/@aws-cdk/aws-stepfunctions/package.json @@ -75,7 +75,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -84,7 +84,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 01df765f20ea0..f5ed9ad18c797 100644 --- a/packages/@aws-cdk/aws-transfer/package.json +++ b/packages/@aws-cdk/aws-transfer/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 fa9e08ca3687f..4175023da3f2f 100644 --- a/packages/@aws-cdk/aws-waf/package.json +++ b/packages/@aws-cdk/aws-waf/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 fa6dfd854b0a8..fb10179198d3a 100644 --- a/packages/@aws-cdk/aws-wafregional/package.json +++ b/packages/@aws-cdk/aws-wafregional/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 0ef5264a299bf..b857c23370186 100644 --- a/packages/@aws-cdk/aws-wafv2/package.json +++ b/packages/@aws-cdk/aws-wafv2/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "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 0dc63f8f9d6ea..85787cf19d2b1 100644 --- a/packages/@aws-cdk/aws-workspaces/package.json +++ b/packages/@aws-cdk/aws-workspaces/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/cloudformation-include/package.json b/packages/@aws-cdk/cloudformation-include/package.json index ee08615cf4078..5433002517ed1 100644 --- a/packages/@aws-cdk/cloudformation-include/package.json +++ b/packages/@aws-cdk/cloudformation-include/package.json @@ -176,7 +176,7 @@ "@aws-cdk/aws-wafv2": "0.0.0", "@aws-cdk/aws-workspaces": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0", + "constructs": "4.1.1-pre.1", "yaml": "1.10.0" }, "peerDependencies": { @@ -299,7 +299,7 @@ "@aws-cdk/aws-wafv2": "0.0.0", "@aws-cdk/aws-workspaces": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "devDependencies": { "@aws-cdk/assert": "0.0.0", diff --git a/packages/@aws-cdk/core/lib/app.ts b/packages/@aws-cdk/core/lib/app.ts index 6706c19f9d979..0ad6bde3ef110 100644 --- a/packages/@aws-cdk/core/lib/app.ts +++ b/packages/@aws-cdk/core/lib/app.ts @@ -1,6 +1,6 @@ import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import * as cxapi from '@aws-cdk/cx-api'; -import { Construct, ConstructScopeSettings } from "constructs"; +import { Construct, ConstructScopeSettings } from 'constructs'; import { TreeMetadata } from './private/tree-metadata'; import { Stage } from './stage'; diff --git a/packages/@aws-cdk/core/lib/private/construct-settings.ts b/packages/@aws-cdk/core/lib/private/construct-settings.ts index 6bbd272edd556..8ed7421f515fc 100644 --- a/packages/@aws-cdk/core/lib/private/construct-settings.ts +++ b/packages/@aws-cdk/core/lib/private/construct-settings.ts @@ -1,6 +1,6 @@ import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import * as cxapi from '@aws-cdk/cx-api'; -import { Construct, ConstructScopeSettings } from "constructs"; +import { Construct, ConstructScopeSettings } from 'constructs'; /** * Configures the construct scope to use legacy values for error/warning/info metadata keys diff --git a/packages/@aws-cdk/core/package.json b/packages/@aws-cdk/core/package.json index 9035a03160fda..4ebd763c651dd 100644 --- a/packages/@aws-cdk/core/package.json +++ b/packages/@aws-cdk/core/package.json @@ -170,7 +170,7 @@ "minimatch": "^3.0.4", "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "bundledDependencies": [ "fs-extra", @@ -180,7 +180,7 @@ "peerDependencies": { "@aws-cdk/cloud-assembly-schema": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/custom-resources/package.json b/packages/@aws-cdk/custom-resources/package.json index 18a0656d170fa..cb87e322ab2d8 100644 --- a/packages/@aws-cdk/custom-resources/package.json +++ b/packages/@aws-cdk/custom-resources/package.json @@ -90,7 +90,7 @@ "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -100,7 +100,7 @@ "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/example-construct-library/package.json b/packages/@aws-cdk/example-construct-library/package.json index ac1b68f7bf2b9..8b0a4f052597e 100644 --- a/packages/@aws-cdk/example-construct-library/package.json +++ b/packages/@aws-cdk/example-construct-library/package.json @@ -73,7 +73,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -83,7 +83,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@monocdk-experiment/assert/package.json b/packages/@monocdk-experiment/assert/package.json index fdf560e3046a1..53e20aac52b31 100644 --- a/packages/@monocdk-experiment/assert/package.json +++ b/packages/@monocdk-experiment/assert/package.json @@ -44,7 +44,7 @@ "ts-jest": "^26.1.1", "@monocdk-experiment/rewrite-imports": "0.0.0", "monocdk-experiment": "0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "dependencies": { "@aws-cdk/cloudformation-diff": "0.0.0" @@ -52,7 +52,7 @@ "peerDependencies": { "jest": "^25.5.4", "monocdk-experiment": "^0.0.0", - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "repository": { "url": "https://github.com/aws/aws-cdk.git", diff --git a/packages/decdk/package.json b/packages/decdk/package.json index b6d2b3ca7c751..f79bcc52a38e9 100644 --- a/packages/decdk/package.json +++ b/packages/decdk/package.json @@ -176,7 +176,7 @@ "@aws-cdk/custom-resources": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "4.1.1-pre.0", + "constructs": "4.1.1-pre.1", "fs-extra": "^9.0.1", "jsii-reflect": "^1.7.0", "jsonschema": "^1.2.6", diff --git a/packages/monocdk-experiment/package.json b/packages/monocdk-experiment/package.json index 2f3ab6e0c7b6b..fab8c62338b31 100644 --- a/packages/monocdk-experiment/package.json +++ b/packages/monocdk-experiment/package.json @@ -91,7 +91,7 @@ ], "dependencies": { "case": "1.6.3", - "constructs": "4.1.1-pre.0", + "constructs": "4.1.1-pre.1", "fs-extra": "^9.0.1", "jsonschema": "^1.2.5", "minimatch": "^3.0.4", @@ -257,7 +257,7 @@ "typescript": "~3.8.3" }, "peerDependencies": { - "constructs": "4.1.1-pre.0" + "constructs": "4.1.1-pre.1" }, "homepage": "https://github.com/aws/aws-cdk", "engines": { diff --git a/tools/pkglint/lib/rules.ts b/tools/pkglint/lib/rules.ts index 4694d6cf43ad9..33f46b264bad9 100644 --- a/tools/pkglint/lib/rules.ts +++ b/tools/pkglint/lib/rules.ts @@ -1219,7 +1219,7 @@ export class ConstructsDependency extends ValidationRule { public readonly name = 'constructs/dependency'; public validate(pkg: PackageJson) { - const REQUIRED_VERSION = '4.1.1-pre.0'; + const REQUIRED_VERSION = '4.1.1-pre.1'; if (pkg.devDependencies?.constructs && pkg.devDependencies?.constructs !== REQUIRED_VERSION) { pkg.report({ From dcf020e3b4f6389a41418f7d1027f9252e9d6971 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Thu, 9 Jul 2020 06:30:30 +0000 Subject: [PATCH 12/39] fix README --- packages/@aws-cdk/alexa-ask/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/@aws-cdk/alexa-ask/README.md b/packages/@aws-cdk/alexa-ask/README.md index 6850302a7b516..fcf3976ab1057 100644 --- a/packages/@aws-cdk/alexa-ask/README.md +++ b/packages/@aws-cdk/alexa-ask/README.md @@ -6,6 +6,10 @@ > All classes with the `Cfn` prefix in this module ([CFN Resources](https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_lib)) are always stable and safe to use. +![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge) + +> The APIs of higher level constructs in this module are experimental and under active development. They are subject to non-backward compatible changes or removal in any future version. These are not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be announced in the release notes. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package. + --- From cd6310aa1791043876d3fb3533d776f8646874d0 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Thu, 9 Jul 2020 08:21:47 +0000 Subject: [PATCH 13/39] update readme --- packages/@aws-cdk/aws-route53resolver/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/@aws-cdk/aws-route53resolver/README.md b/packages/@aws-cdk/aws-route53resolver/README.md index 917898616e54d..3afc83c252d8f 100644 --- a/packages/@aws-cdk/aws-route53resolver/README.md +++ b/packages/@aws-cdk/aws-route53resolver/README.md @@ -6,6 +6,10 @@ > All classes with the `Cfn` prefix in this module ([CFN Resources](https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_lib)) are always stable and safe to use. +![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge) + +> The APIs of higher level constructs in this module are experimental and under active development. They are subject to non-backward compatible changes or removal in any future version. These are not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be announced in the release notes. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package. + --- From de75d9ad2ceeb9e26d13d175905a18921c5acc2e Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Thu, 9 Jul 2020 11:37:11 +0000 Subject: [PATCH 14/39] progression --- packages/@aws-cdk/assert/lib/synth-utils.ts | 26 +++++++++----- .../test/test.composite-alarm.ts | 2 +- .../test/profiling-group.test.ts | 7 ++-- .../aws-events/test/test.event-bus.ts | 2 +- .../@aws-cdk/aws-events/test/test.rule.ts | 36 ------------------- packages/@aws-cdk/aws-s3/test/test.bucket.ts | 11 ++++-- packages/@aws-cdk/core/lib/synthesis.ts | 19 ---------- 7 files changed, 31 insertions(+), 72 deletions(-) diff --git a/packages/@aws-cdk/assert/lib/synth-utils.ts b/packages/@aws-cdk/assert/lib/synth-utils.ts index 19951e61ee1c9..02e612292898d 100644 --- a/packages/@aws-cdk/assert/lib/synth-utils.ts +++ b/packages/@aws-cdk/assert/lib/synth-utils.ts @@ -4,13 +4,12 @@ import * as fs from 'fs'; import * as path from 'path'; export class SynthUtils { + /** + * Returns the cloud assembly template artifact for a stack. + */ public static synthesize(stack: core.Stack, options: core.SynthesisOptions = { }): cxapi.CloudFormationStackArtifact { // always synthesize against the root (be it an App or whatever) so all artifacts will be included - const root = stack.node.root; - - // if the root is an app, invoke "synth" to avoid double synthesis - const assembly = core.Synthesis.synthesize(root, options); - + const assembly = synthesizeApp(stack, options); return assembly.getStackArtifact(stack.artifactId); } @@ -51,10 +50,7 @@ export class SynthUtils { */ public static _synthesizeWithNested(stack: core.Stack, options: core.SynthesisOptions = { }): cxapi.CloudFormationStackArtifact | object { // always synthesize against the root (be it an App or whatever) so all artifacts will be included - const root = stack.node.root; - - // if the root is an app, invoke "synth" to avoid double synthesis - const assembly = root instanceof core.App ? root.synth() : core.Synthesis.synthesize(root, options); + const assembly = synthesizeApp(stack, options); // if this is a nested stack (it has a parent), then just read the template as a string if (stack.nestedStackParent) { @@ -65,6 +61,18 @@ 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) { + 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'); + } + + return root.synth(options); +} + export interface SubsetOptions { /** * Match all resources of the given type diff --git a/packages/@aws-cdk/aws-cloudwatch/test/test.composite-alarm.ts b/packages/@aws-cdk/aws-cloudwatch/test/test.composite-alarm.ts index 633d792f79401..91443995d8dc1 100644 --- a/packages/@aws-cdk/aws-cloudwatch/test/test.composite-alarm.ts +++ b/packages/@aws-cdk/aws-cloudwatch/test/test.composite-alarm.ts @@ -53,7 +53,7 @@ export = { }); expect(stack).to(haveResource('AWS::CloudWatch::CompositeAlarm', { - AlarmName: 'CompositeAlarm', + AlarmName: 'stackCompositeAlarm5626DF56', AlarmRule: { 'Fn::Join': [ '', diff --git a/packages/@aws-cdk/aws-codeguruprofiler/test/profiling-group.test.ts b/packages/@aws-cdk/aws-codeguruprofiler/test/profiling-group.test.ts index 0fbf063cccfaa..715376b3ea635 100644 --- a/packages/@aws-cdk/aws-codeguruprofiler/test/profiling-group.test.ts +++ b/packages/@aws-cdk/aws-codeguruprofiler/test/profiling-group.test.ts @@ -190,15 +190,14 @@ describe('profiling group', () => { test('default profiling group without name', () => { const stack = new Stack(); - new ProfilingGroup(stack, 'MyProfilingGroup', { - }); + new ProfilingGroup(stack, 'MyProfilingGroup'); expect(stack).toMatch({ 'Resources': { 'MyProfilingGroup829F0507': { 'Type': 'AWS::CodeGuruProfiler::ProfilingGroup', 'Properties': { - 'ProfilingGroupName': 'MyProfilingGroup', + 'ProfilingGroupName': 'stackMyProfilingGroupFF8661FB', }, }, }, @@ -215,7 +214,7 @@ describe('profiling group', () => { 'MyProfilingGroupWithAReallyLongProfilingGroupNameThatExceedsTheLimitOfProfilingGroupNameSizeInOrderToDoSoTheNameMustBeGreaterThanTwoHundredAndFiftyFiveCharactersInSuchCasesWePickUpTheFirstOneTwentyCharactersFromTheBeginningAndTheEndAndConca4B39908C': { 'Type': 'AWS::CodeGuruProfiler::ProfilingGroup', 'Properties': { - 'ProfilingGroupName': 'MyProfilingGroupWithAReallyLongProfilingGroupNameThatExceedsTheLimitOfProfilingGroupNameSizeInOrderToDoSoTheNameMustBeGrnTwoHundredAndFiftyFiveCharactersInSuchCasesWePickUpTheFirstOneTwentyCharactersFromTheBeginningAndTheEndAndConca2FE009B0', + 'ProfilingGroupName': 'stackMyProfilingGroupWithAReallyLongProfilingGroupNameThatExceedsTheLimitOfProfilingGroupNameSizeInOrderToDoSoTheNameMuserThanTwoHundredAndFiftyFiveCharactersInSuchCasesWePickUpTheFirstOneTwentyCharactersFromTheBeginningAndTheEndAndE6003CC8', }, }, }, diff --git a/packages/@aws-cdk/aws-events/test/test.event-bus.ts b/packages/@aws-cdk/aws-events/test/test.event-bus.ts index c32824884c08e..ef5b08c1c429e 100644 --- a/packages/@aws-cdk/aws-events/test/test.event-bus.ts +++ b/packages/@aws-cdk/aws-events/test/test.event-bus.ts @@ -14,7 +14,7 @@ export = { // THEN expect(stack).to(haveResource('AWS::Events::EventBus', { - Name: 'Bus', + Name: 'stackBus7803A768', })); test.done(); diff --git a/packages/@aws-cdk/aws-events/test/test.rule.ts b/packages/@aws-cdk/aws-events/test/test.rule.ts index 3d347cdff77fa..544f4d5f8f3ef 100644 --- a/packages/@aws-cdk/aws-events/test/test.rule.ts +++ b/packages/@aws-cdk/aws-events/test/test.rule.ts @@ -579,42 +579,6 @@ export = { test.done(); }, - 'requires that the source stack be part of an App'(test: Test) { - const app = new cdk.App(); - - const sourceAccount = '123456789012'; - const sourceStack = new cdk.Stack(undefined, 'SourceStack', { env: { account: sourceAccount, region: 'us-west-2' } }); - const rule = new Rule(sourceStack, 'Rule'); - - const targetAccount = '234567890123'; - const targetStack = new cdk.Stack(app, 'TargetStack', { env: { account: targetAccount, region: 'us-west-2' } }); - const resource = new Construct(targetStack, 'Resource'); - - test.throws(() => { - rule.addTarget(new SomeTarget('T', resource)); - }, /Event stack which uses cross-account targets must be part of a CDK app/); - - test.done(); - }, - - 'requires that the target stack be part of an App'(test: Test) { - const app = new cdk.App(); - - const sourceAccount = '123456789012'; - const sourceStack = new cdk.Stack(app, 'SourceStack', { env: { account: sourceAccount, region: 'us-west-2' } }); - const rule = new Rule(sourceStack, 'Rule'); - - const targetAccount = '234567890123'; - const targetStack = new cdk.Stack(undefined, 'TargetStack', { env: { account: targetAccount, region: 'us-west-2' } }); - const resource = new Construct(targetStack, 'Resource'); - - test.throws(() => { - rule.addTarget(new SomeTarget('T', resource)); - }, /Target stack which uses cross-account event targets must be part of a CDK app/); - - test.done(); - }, - 'requires that the source and target stacks be part of the same App'(test: Test) { const sourceApp = new cdk.App(); const sourceAccount = '123456789012'; diff --git a/packages/@aws-cdk/aws-s3/test/test.bucket.ts b/packages/@aws-cdk/aws-s3/test/test.bucket.ts index 92440f7d05586..a6fab30406034 100644 --- a/packages/@aws-cdk/aws-s3/test/test.bucket.ts +++ b/packages/@aws-cdk/aws-s3/test/test.bucket.ts @@ -611,13 +611,20 @@ export = { test.done(); }, - 'import can also be used to import arbitrary ARNs'(test: Test) { + 'import does not create any resources'(test: Test) { const stack = new cdk.Stack(); const bucket = s3.Bucket.fromBucketAttributes(stack, 'ImportedBucket', { bucketArn: 'arn:aws:s3:::my-bucket' }); bucket.addToResourcePolicy(new iam.PolicyStatement({ resources: ['*'], actions: ['*'] })); // at this point we technically didn't create any resources in the consuming stack. expect(stack).toMatch({}); + test.done(); + }, + + 'import can also be used to import arbitrary ARNs'(test: Test) { + const stack = new cdk.Stack(); + const bucket = s3.Bucket.fromBucketAttributes(stack, 'ImportedBucket', { bucketArn: 'arn:aws:s3:::my-bucket' }); + bucket.addToResourcePolicy(new iam.PolicyStatement({ resources: ['*'], actions: ['*'] })); // but now we can reference the bucket // you can even use the bucket name, which will be extracted from the arn provided. @@ -868,7 +875,7 @@ export = { 'MyBucketKeyC17130CF': { 'Type': 'AWS::KMS::Key', 'Properties': { - 'Description': 'Created by MyBucket', + 'Description': 'Created by stack/MyBucket', 'KeyPolicy': { 'Statement': [ { diff --git a/packages/@aws-cdk/core/lib/synthesis.ts b/packages/@aws-cdk/core/lib/synthesis.ts index c63de5620f781..eba615697ab39 100644 --- a/packages/@aws-cdk/core/lib/synthesis.ts +++ b/packages/@aws-cdk/core/lib/synthesis.ts @@ -1,6 +1,4 @@ import * as cxapi from '@aws-cdk/cx-api'; -import { IConstruct } from 'constructs'; -import { synthesize } from './private/synthesis'; /** * Options for synthesis. @@ -20,20 +18,3 @@ export interface SynthesisOptions extends cxapi.AssemblyBuildOptions { */ readonly skipValidation?: boolean; } - -/** - * Allows synthesizing arbitrary CDK trees. - */ -export class Synthesis { - - /** - * Synthesizes the tree from `root` and returns the cloud assembly. - * @param root The root of the tree - * @param options Synthesis options. - */ - public static synthesize(root: IConstruct, options: SynthesisOptions) { - return synthesize(root, options); - } - - private constructor() { } -} \ No newline at end of file From 59ad3fd9a7e308db3f5e529d8f2c5ee3f6e028a9 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Thu, 9 Jul 2020 12:20:46 +0000 Subject: [PATCH 15/39] rename default stack name to "Stack" --- packages/@aws-cdk/core/lib/stack.ts | 4 ++-- packages/@aws-cdk/core/test/test.resource.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/@aws-cdk/core/lib/stack.ts b/packages/@aws-cdk/core/lib/stack.ts index c4933579f1f1a..2fecb1df9ab4e 100644 --- a/packages/@aws-cdk/core/lib/stack.ts +++ b/packages/@aws-cdk/core/lib/stack.ts @@ -317,7 +317,7 @@ export class Stack extends Construct implements ITaggable { // For unit test scope and id are optional for stacks, but we still want an App // as the parent because apps implement much of the synthesis logic. scope = scope ?? new App(); - id = id ?? 'stack'; + id = id ?? 'Stack'; // this will also be the default stack name super(scope, id); @@ -938,7 +938,7 @@ export class Stack extends Construct implements ITaggable { // In unit tests our Stack (which is the only component) may not have an // id, so in that case just pretend it's "Stack". if (ids.length === 1 && !ids[0]) { - ids[0] = 'Stack'; + throw new Error('unexpected: stack id must always be defined (it will be "Stack" by default)'); } return makeStackName(ids); diff --git a/packages/@aws-cdk/core/test/test.resource.ts b/packages/@aws-cdk/core/test/test.resource.ts index 52a8c1662761b..1e3cd742c7af2 100644 --- a/packages/@aws-cdk/core/test/test.resource.ts +++ b/packages/@aws-cdk/core/test/test.resource.ts @@ -654,7 +654,7 @@ export = { test.deepEqual(toCloudFormation(stack), { Resources: { ParentMyResource4B1FDBCC: { Type: 'MyResourceType', - Metadata: { [cxapi.PATH_METADATA_KEY]: 'stack/Parent/MyResource' } } } }); + Metadata: { [cxapi.PATH_METADATA_KEY]: 'Stack/Parent/MyResource' } } } }); test.done(); }, From e71e3a72a4e4bf598f586916619543eb62290190 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Thu, 9 Jul 2020 12:21:04 +0000 Subject: [PATCH 16/39] force resynth in tests --- packages/@aws-cdk/assert/lib/synth-utils.ts | 8 +++++++- packages/@aws-cdk/core/lib/stage.ts | 10 +++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/assert/lib/synth-utils.ts b/packages/@aws-cdk/assert/lib/synth-utils.ts index 02e612292898d..2794559f1f543 100644 --- a/packages/@aws-cdk/assert/lib/synth-utils.ts +++ b/packages/@aws-cdk/assert/lib/synth-utils.ts @@ -70,7 +70,13 @@ function synthesizeApp(stack: core.Stack, options: core.SynthesisOptions) { throw new Error('unexpected: all stacks must be part of a Stage or an App'); } - return root.synth(options); + // to support incremental assertions (i.e. "expect(stack).toNotContainSomething(); doSomething(); expect(stack).toContainSomthing()") + const forceResynth = true; + + return root.synth({ + forceResynth, + ...options, + }); } export interface SubsetOptions { diff --git a/packages/@aws-cdk/core/lib/stage.ts b/packages/@aws-cdk/core/lib/stage.ts index 8678e7c1506b4..c9c565d385304 100644 --- a/packages/@aws-cdk/core/lib/stage.ts +++ b/packages/@aws-cdk/core/lib/stage.ts @@ -170,7 +170,7 @@ export class Stage extends Construct { * calls will return the same assembly. */ public synth(options: StageSynthesisOptions = { }): cxapi.CloudAssembly { - if (!this.assembly) { + if (!this.assembly || options.forceResynth) { const runtimeInfo = this.node.tryGetContext(cxapi.DISABLE_VERSION_REPORTING) ? undefined : collectRuntimeInformation(); this.assembly = synthesize(this, { skipValidation: options.skipValidation, @@ -205,4 +205,12 @@ export interface StageSynthesisOptions { * @default - false */ readonly skipValidation?: boolean; + + /** + * Force a re-synth, even if the stage has already been synthesized. + * This is used by tests to allow for incremental verification of the output. + * Do not use in production. + * @default false + */ + readonly forceResynth?: boolean; } From b4087ccf468c7a201e0079889b749fd010729fb6 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Thu, 9 Jul 2020 12:21:12 +0000 Subject: [PATCH 17/39] ec2 --- .../@aws-cdk/aws-ec2/test/connections.test.ts | 4 +-- packages/@aws-cdk/aws-ec2/test/volume.test.ts | 32 +++++++++---------- .../aws-ec2/test/vpc-endpoint.test.ts | 2 +- packages/@aws-cdk/aws-ec2/test/vpc.test.ts | 6 ++-- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/packages/@aws-cdk/aws-ec2/test/connections.test.ts b/packages/@aws-cdk/aws-ec2/test/connections.test.ts index 294f405511de3..a8e9544f5e8ec 100644 --- a/packages/@aws-cdk/aws-ec2/test/connections.test.ts +++ b/packages/@aws-cdk/aws-ec2/test/connections.test.ts @@ -78,7 +78,7 @@ nodeunitShim({ // THEN expect(stack).to(haveResource('AWS::EC2::SecurityGroup', { - GroupDescription: 'SecurityGroup1', + GroupDescription: 'Stack/SecurityGroup1', SecurityGroupIngress: [ { Description: 'from 0.0.0.0/0:88', @@ -91,7 +91,7 @@ nodeunitShim({ })); expect(stack).to(haveResource('AWS::EC2::SecurityGroup', { - GroupDescription: 'SecurityGroup2', + GroupDescription: 'Stack/SecurityGroup2', SecurityGroupIngress: [ { Description: 'from 0.0.0.0/0:88', diff --git a/packages/@aws-cdk/aws-ec2/test/volume.test.ts b/packages/@aws-cdk/aws-ec2/test/volume.test.ts index dbe368285fb40..65237726fdca5 100644 --- a/packages/@aws-cdk/aws-ec2/test/volume.test.ts +++ b/packages/@aws-cdk/aws-ec2/test/volume.test.ts @@ -739,7 +739,7 @@ nodeunitShim({ ], Condition: { 'ForAnyValue:StringEquals': { - 'ec2:ResourceTag/VolumeGrantAttach-BD7A9717': 'd9a17c1c9e8ef6866e4dbeef41c741b2', + 'ec2:ResourceTag/VolumeGrantAttach-986A0A5E': '8240681c85c17071be6d87ec6e2930c7', }, }, }], @@ -748,8 +748,8 @@ nodeunitShim({ cdkExpect(stack).to(haveResourceLike('AWS::EC2::Volume', { Tags: [ { - Key: 'VolumeGrantAttach-BD7A9717', - Value: 'd9a17c1c9e8ef6866e4dbeef41c741b2', + Key: 'VolumeGrantAttach-986A0A5E', + Value: '8240681c85c17071be6d87ec6e2930c7', }, ], }, ResourcePart.Properties)); @@ -757,8 +757,8 @@ nodeunitShim({ Tags: [ {}, { - Key: 'VolumeGrantAttach-BD7A9717', - Value: 'd9a17c1c9e8ef6866e4dbeef41c741b2', + Key: 'VolumeGrantAttach-986A0A5E', + Value: '8240681c85c17071be6d87ec6e2930c7', }, ], }, ResourcePart.Properties)); @@ -816,7 +816,7 @@ nodeunitShim({ ], Condition: { 'ForAnyValue:StringEquals': { - 'ec2:ResourceTag/VolumeGrantAttach-TestSuffix': 'd9a17c1c9e8ef6866e4dbeef41c741b2', + 'ec2:ResourceTag/VolumeGrantAttach-TestSuffix': '8240681c85c17071be6d87ec6e2930c7', }, }, }], @@ -826,7 +826,7 @@ nodeunitShim({ Tags: [ { Key: 'VolumeGrantAttach-TestSuffix', - Value: 'd9a17c1c9e8ef6866e4dbeef41c741b2', + Value: '8240681c85c17071be6d87ec6e2930c7', }, ], }, ResourcePart.Properties)); @@ -835,7 +835,7 @@ nodeunitShim({ {}, { Key: 'VolumeGrantAttach-TestSuffix', - Value: 'd9a17c1c9e8ef6866e4dbeef41c741b2', + Value: '8240681c85c17071be6d87ec6e2930c7', }, ], }, ResourcePart.Properties)); @@ -1051,7 +1051,7 @@ nodeunitShim({ ], Condition: { 'ForAnyValue:StringEquals': { - 'ec2:ResourceTag/VolumeGrantDetach-BD7A9717': 'd9a17c1c9e8ef6866e4dbeef41c741b2', + 'ec2:ResourceTag/VolumeGrantDetach-986A0A5E': '8240681c85c17071be6d87ec6e2930c7', }, }, }], @@ -1060,8 +1060,8 @@ nodeunitShim({ cdkExpect(stack).to(haveResourceLike('AWS::EC2::Volume', { Tags: [ { - Key: 'VolumeGrantDetach-BD7A9717', - Value: 'd9a17c1c9e8ef6866e4dbeef41c741b2', + Key: 'VolumeGrantDetach-986A0A5E', + Value: '8240681c85c17071be6d87ec6e2930c7', }, ], }, ResourcePart.Properties)); @@ -1069,8 +1069,8 @@ nodeunitShim({ Tags: [ {}, { - Key: 'VolumeGrantDetach-BD7A9717', - Value: 'd9a17c1c9e8ef6866e4dbeef41c741b2', + Key: 'VolumeGrantDetach-986A0A5E', + Value: '8240681c85c17071be6d87ec6e2930c7', }, ], }, ResourcePart.Properties)); @@ -1128,7 +1128,7 @@ nodeunitShim({ ], Condition: { 'ForAnyValue:StringEquals': { - 'ec2:ResourceTag/VolumeGrantDetach-TestSuffix': 'd9a17c1c9e8ef6866e4dbeef41c741b2', + 'ec2:ResourceTag/VolumeGrantDetach-TestSuffix': '8240681c85c17071be6d87ec6e2930c7', }, }, }], @@ -1138,7 +1138,7 @@ nodeunitShim({ Tags: [ { Key: 'VolumeGrantDetach-TestSuffix', - Value: 'd9a17c1c9e8ef6866e4dbeef41c741b2', + Value: '8240681c85c17071be6d87ec6e2930c7', }, ], }, ResourcePart.Properties)); @@ -1147,7 +1147,7 @@ nodeunitShim({ {}, { Key: 'VolumeGrantDetach-TestSuffix', - Value: 'd9a17c1c9e8ef6866e4dbeef41c741b2', + Value: '8240681c85c17071be6d87ec6e2930c7', }, ], }, ResourcePart.Properties)); diff --git a/packages/@aws-cdk/aws-ec2/test/vpc-endpoint.test.ts b/packages/@aws-cdk/aws-ec2/test/vpc-endpoint.test.ts index 60d18187027b1..8da616c907cb2 100644 --- a/packages/@aws-cdk/aws-ec2/test/vpc-endpoint.test.ts +++ b/packages/@aws-cdk/aws-ec2/test/vpc-endpoint.test.ts @@ -260,7 +260,7 @@ nodeunitShim({ })); expect(stack).to(haveResource('AWS::EC2::SecurityGroup', { - GroupDescription: 'VpcNetwork/EcrDocker/SecurityGroup', + GroupDescription: 'Stack/VpcNetwork/EcrDocker/SecurityGroup', VpcId: { Ref: 'VpcNetworkB258E83A', }, diff --git a/packages/@aws-cdk/aws-ec2/test/vpc.test.ts b/packages/@aws-cdk/aws-ec2/test/vpc.test.ts index baacb5eb9fbe7..aa306bfd909c6 100644 --- a/packages/@aws-cdk/aws-ec2/test/vpc.test.ts +++ b/packages/@aws-cdk/aws-ec2/test/vpc.test.ts @@ -32,11 +32,11 @@ nodeunitShim({ new Vpc(stack, 'TheVPC'); expect(stack).to( haveResource('AWS::EC2::VPC', - hasTags( [ {Key: 'Name', Value: 'TheVPC'} ])), + hasTags( [ {Key: 'Name', Value: 'TestStack/TheVPC'} ])), ); expect(stack).to( haveResource('AWS::EC2::InternetGateway', - hasTags( [ {Key: 'Name', Value: 'TheVPC'} ])), + hasTags( [ {Key: 'Name', Value: 'TestStack/TheVPC'} ])), ); test.done(); }, @@ -408,7 +408,7 @@ nodeunitShim({ for (let i = 1; i < 4; i++) { expect(stack).to(haveResource('AWS::EC2::Subnet', hasTags([{ Key: 'Name', - Value: `VPC/egressSubnet${i}`, + Value: `TestStack/VPC/egressSubnet${i}`, }, { Key: 'aws-cdk:subnet-name', Value: 'egress', From 71441ec14a63039c28f3d69fdd6cd3485c473686 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Thu, 9 Jul 2020 12:39:02 +0000 Subject: [PATCH 18/39] some more tests --- packages/@aws-cdk/aws-glue/test/test.table.ts | 2 +- packages/@aws-cdk/aws-kinesis/test/stream.test.ts | 8 ++++---- packages/@aws-cdk/aws-lambda/lib/filesystem.ts | 3 ++- packages/@aws-cdk/aws-lambda/test/test.function.ts | 2 +- packages/@aws-cdk/aws-stepfunctions/test/activity.test.ts | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/@aws-cdk/aws-glue/test/test.table.ts b/packages/@aws-cdk/aws-glue/test/test.table.ts index b00466ebdb21d..dcb91be7b783c 100644 --- a/packages/@aws-cdk/aws-glue/test/test.table.ts +++ b/packages/@aws-cdk/aws-glue/test/test.table.ts @@ -391,7 +391,7 @@ export = { ], Version: '2012-10-17', }, - Description: 'Created by Table/Bucket', + Description: 'Created by Stack/Table/Bucket', })); expect(stack).to(haveResource('AWS::S3::Bucket', { diff --git a/packages/@aws-cdk/aws-kinesis/test/stream.test.ts b/packages/@aws-cdk/aws-kinesis/test/stream.test.ts index 40bbe5ea8097b..5197d96e9437c 100644 --- a/packages/@aws-cdk/aws-kinesis/test/stream.test.ts +++ b/packages/@aws-cdk/aws-kinesis/test/stream.test.ts @@ -338,7 +338,7 @@ describe('Kinesis data streams', () => { MyStreamKey76F3300E: { Type: 'AWS::KMS::Key', Properties: { - Description: 'Created by MyStream', + Description: 'Created by Stack/MyStream', KeyPolicy: { Statement: [ { @@ -555,7 +555,7 @@ describe('Kinesis data streams', () => { ], Version: '2012-10-17', }, - Description: 'Created by MyStream', + Description: 'Created by Stack/MyStream', }, UpdateReplacePolicy: 'Retain', DeletionPolicy: 'Retain', @@ -684,7 +684,7 @@ describe('Kinesis data streams', () => { ], Version: '2012-10-17', }, - Description: 'Created by MyStream', + Description: 'Created by Stack/MyStream', }, UpdateReplacePolicy: 'Retain', DeletionPolicy: 'Retain', @@ -753,7 +753,7 @@ describe('Kinesis data streams', () => { MyStreamKey76F3300E: { Type: 'AWS::KMS::Key', Properties: { - Description: 'Created by MyStream', + Description: 'Created by Stack/MyStream', KeyPolicy: { Statement: [ { diff --git a/packages/@aws-cdk/aws-lambda/lib/filesystem.ts b/packages/@aws-cdk/aws-lambda/lib/filesystem.ts index 108c7ea4116f7..7be79f5b79b0d 100644 --- a/packages/@aws-cdk/aws-lambda/lib/filesystem.ts +++ b/packages/@aws-cdk/aws-lambda/lib/filesystem.ts @@ -1,7 +1,8 @@ import { Connections } from '@aws-cdk/aws-ec2'; import * as efs from '@aws-cdk/aws-efs'; import * as iam from '@aws-cdk/aws-iam'; -import { IDependable, Stack } from '@aws-cdk/core'; +import { Stack } from '@aws-cdk/core'; +import { IDependable } from 'constructs'; /** * FileSystem configurations for the Lambda function diff --git a/packages/@aws-cdk/aws-lambda/test/test.function.ts b/packages/@aws-cdk/aws-lambda/test/test.function.ts index e72ffd094126d..13e533f8fac9d 100644 --- a/packages/@aws-cdk/aws-lambda/test/test.function.ts +++ b/packages/@aws-cdk/aws-lambda/test/test.function.ts @@ -1,4 +1,4 @@ -import { expect, SynthUtils } from '@aws-cdk/assert'; +import { expect, haveResource, SynthUtils } from '@aws-cdk/assert'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as efs from '@aws-cdk/aws-efs'; import * as logs from '@aws-cdk/aws-logs'; diff --git a/packages/@aws-cdk/aws-stepfunctions/test/activity.test.ts b/packages/@aws-cdk/aws-stepfunctions/test/activity.test.ts index 1adfef0b3e68e..3506ab362f481 100644 --- a/packages/@aws-cdk/aws-stepfunctions/test/activity.test.ts +++ b/packages/@aws-cdk/aws-stepfunctions/test/activity.test.ts @@ -14,7 +14,7 @@ describe('Activity', () => { // THEN expect(stack).toHaveResource('AWS::StepFunctions::Activity', { - Name: 'stackActivityD885F0FA', + Name: 'StackActivityAACA61A2', }); }); From 743f5c2c14cbd9c7422ff78094c9baf268c2e9bf Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Thu, 9 Jul 2020 12:45:04 +0000 Subject: [PATCH 19/39] version hashes changed because path changed --- .../aws-lambda/test/integ.current-version.expected.json | 8 ++++---- .../aws-lambda/test/integ.layer-version.lit.expected.json | 2 +- .../aws-lambda/test/integ.log-retention.expected.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/@aws-cdk/aws-lambda/test/integ.current-version.expected.json b/packages/@aws-cdk/aws-lambda/test/integ.current-version.expected.json index 1a3ea891ebc6d..bf269c8f6d555 100644 --- a/packages/@aws-cdk/aws-lambda/test/integ.current-version.expected.json +++ b/packages/@aws-cdk/aws-lambda/test/integ.current-version.expected.json @@ -85,7 +85,7 @@ "MyLambdaServiceRole4539ECB6" ] }, - "MyLambdaCurrentVersionE7A382CC86b18af374d6e380aa07074d2490e2df": { + "MyLambdaCurrentVersionE7A382CC721de083c6b4b6360a9c534b79eb610e": { "Type": "AWS::Lambda::Version", "Properties": { "FunctionName": { @@ -103,7 +103,7 @@ }, "Qualifier": { "Fn::GetAtt": [ - "MyLambdaCurrentVersionE7A382CC86b18af374d6e380aa07074d2490e2df", + "MyLambdaCurrentVersionE7A382CC721de083c6b4b6360a9c534b79eb610e", "Version" ] }, @@ -118,7 +118,7 @@ }, "FunctionVersion": { "Fn::GetAtt": [ - "MyLambdaCurrentVersionE7A382CC86b18af374d6e380aa07074d2490e2df", + "MyLambdaCurrentVersionE7A382CC721de083c6b4b6360a9c534b79eb610e", "Version" ] }, @@ -140,4 +140,4 @@ "Description": "Artifact hash for asset \"8811a2632ac5564a08fd269e159298f7e497f259578b0dc5e927a1f48ab24d34\"" } } -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda/test/integ.layer-version.lit.expected.json b/packages/@aws-cdk/aws-lambda/test/integ.layer-version.lit.expected.json index 93687882379f7..71f26e3ec36fc 100644 --- a/packages/@aws-cdk/aws-lambda/test/integ.layer-version.lit.expected.json +++ b/packages/@aws-cdk/aws-lambda/test/integ.layer-version.lit.expected.json @@ -130,4 +130,4 @@ "Description": "Artifact hash for asset \"8811a2632ac5564a08fd269e159298f7e497f259578b0dc5e927a1f48ab24d34\"" } } -} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-lambda/test/integ.log-retention.expected.json b/packages/@aws-cdk/aws-lambda/test/integ.log-retention.expected.json index f123d24edf60a..972753eb9ff0f 100644 --- a/packages/@aws-cdk/aws-lambda/test/integ.log-retention.expected.json +++ b/packages/@aws-cdk/aws-lambda/test/integ.log-retention.expected.json @@ -344,4 +344,4 @@ "Description": "Artifact hash for asset \"11aa2ce8971716ca7c8d28d472ab5e937131e78e136d0de8f4997fb11c4de847\"" } } -} +} \ No newline at end of file From 469480d022f3a351b61321d476dc87ad42ccd0b5 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Thu, 9 Jul 2020 18:29:30 +0000 Subject: [PATCH 20/39] progression --- packages/@aws-cdk/aws-apigatewayv2/README.md | 5 ++++- .../aws-apigatewayv2/lib/common/domain-name.ts | 3 ++- .../aws-apigatewayv2/lib/http/api-mapping.ts | 3 ++- .../aws-cloudformation/test/test.nested-stack.ts | 2 +- .../@aws-cdk/aws-codecommit/test/test.codecommit.ts | 2 +- .../@aws-cdk/aws-elasticloadbalancingv2/README.md | 2 ++ .../aws-s3-notifications/test/lambda/lambda.test.ts | 10 +++++----- .../@aws-cdk/aws-s3-notifications/test/queue.test.ts | 2 +- .../aws-secretsmanager/test/test.secret-rotation.ts | 10 +++++----- .../@aws-cdk/aws-sns-subscriptions/test/subs.test.ts | 12 ++++++------ 10 files changed, 29 insertions(+), 22 deletions(-) diff --git a/packages/@aws-cdk/aws-apigatewayv2/README.md b/packages/@aws-cdk/aws-apigatewayv2/README.md index 54e37abd830ae..5cca13127e97f 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/README.md +++ b/packages/@aws-cdk/aws-apigatewayv2/README.md @@ -6,10 +6,13 @@ > All classes with the `Cfn` prefix in this module ([CFN Resources](https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_lib)) are always stable and safe to use. +![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge) + +> The APIs of higher level constructs in this module are experimental and under active development. They are subject to non-backward compatible changes or removal in any future version. These are not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be announced in the release notes. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package. + --- - ## Table of Contents - [Introduction](#introduction) diff --git a/packages/@aws-cdk/aws-apigatewayv2/lib/common/domain-name.ts b/packages/@aws-cdk/aws-apigatewayv2/lib/common/domain-name.ts index 93234807bbf09..eaef6605ef897 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/lib/common/domain-name.ts +++ b/packages/@aws-cdk/aws-apigatewayv2/lib/common/domain-name.ts @@ -1,5 +1,6 @@ import { ICertificate } from '@aws-cdk/aws-certificatemanager'; -import { Construct, IResource, Resource, Token } from '@aws-cdk/core'; +import { IResource, Resource, Token } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnDomainName, CfnDomainNameProps } from '../apigatewayv2.generated'; /** diff --git a/packages/@aws-cdk/aws-apigatewayv2/lib/http/api-mapping.ts b/packages/@aws-cdk/aws-apigatewayv2/lib/http/api-mapping.ts index 855c6a1f30638..7050e9f01b512 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/lib/http/api-mapping.ts +++ b/packages/@aws-cdk/aws-apigatewayv2/lib/http/api-mapping.ts @@ -1,4 +1,5 @@ -import { Construct, Resource } from '@aws-cdk/core'; +import { Resource } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnApiMapping, CfnApiMappingProps } from '../apigatewayv2.generated'; import { IApiMapping, IDomainName } from '../common'; import { IHttpApi } from '../http/api'; 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 bb2e37e12c851..1a5c6c441d39c 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/test.nested-stack.ts +++ b/packages/@aws-cdk/aws-cloudformation/test/test.nested-stack.ts @@ -886,7 +886,7 @@ export = { }, }, Outputs: { - nestedresourceinnested59B1F01CConsumedAttribute: { + StacknestedresourceinnestedE8C78B2EConsumedAttribute: { Value: { 'Fn::GetAtt': [ 'resourceinnested', diff --git a/packages/@aws-cdk/aws-codecommit/test/test.codecommit.ts b/packages/@aws-cdk/aws-codecommit/test/test.codecommit.ts index bd7a6ac54ec0c..b7a86eaaa9769 100644 --- a/packages/@aws-cdk/aws-codecommit/test/test.codecommit.ts +++ b/packages/@aws-cdk/aws-codecommit/test/test.codecommit.ts @@ -29,7 +29,7 @@ export = { 'all', ], DestinationArn: 'arn:aws:sns:*:123456789012:my_topic', - Name: 'MyRepository/arn:aws:sns:*:123456789012:my_topic', + Name: 'Stack/MyRepository/arn:aws:sns:*:123456789012:my_topic', }, ], }, diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/README.md b/packages/@aws-cdk/aws-elasticloadbalancingv2/README.md index 5ce453e0595d5..4ef361dd5512c 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/README.md +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/README.md @@ -4,6 +4,8 @@ ![cfn-resources: Stable](https://img.shields.io/badge/cfn--resources-stable-success.svg?style=for-the-badge) +![cdk-constructs: Stable](https://img.shields.io/badge/cdk--constructs-stable-success.svg?style=for-the-badge) + --- diff --git a/packages/@aws-cdk/aws-s3-notifications/test/lambda/lambda.test.ts b/packages/@aws-cdk/aws-s3-notifications/test/lambda/lambda.test.ts index 67e2e2eae9071..2ed5a5a920da6 100644 --- a/packages/@aws-cdk/aws-s3-notifications/test/lambda/lambda.test.ts +++ b/packages/@aws-cdk/aws-s3-notifications/test/lambda/lambda.test.ts @@ -1,4 +1,5 @@ // import { SynthUtils } from '@aws-cdk/assert'; +import { ResourcePart } from '@aws-cdk/assert'; import '@aws-cdk/assert/jest'; import * as lambda from '@aws-cdk/aws-lambda'; import * as s3 from '@aws-cdk/aws-s3'; @@ -84,12 +85,11 @@ test('permissions are added as a dependency to the notifications resource when u const lambdaDestination = new s3n.LambdaDestination(fn); - bucket.addEventNotification(s3.EventType.OBJECT_CREATED, lambdaDestination, { prefix: 'v1/'}); - - const notifications = stack.node.findAll().filter(c => c.node.id === 'Notifications')[0]; - const dependencies = notifications!.node.dependencies; + bucket.addEventNotification(s3.EventType.OBJECT_CREATED, lambdaDestination, { prefix: 'v1/' }); - expect(dependencies[0].node.id).toEqual('AllowBucketNotificationsFromMyBucket'); + expect(stack).toHaveResource('Custom::S3BucketNotifications', { + DependsOn: [ 'SingletonLambdauuidAllowBucketNotificationsFromStackMyBucketE0D5A788C8D3DB22' ], + }, ResourcePart.CompleteDefinition); }); test('add multiple event notifications using a singleton function', () => { diff --git a/packages/@aws-cdk/aws-s3-notifications/test/queue.test.ts b/packages/@aws-cdk/aws-s3-notifications/test/queue.test.ts index d1e4f1abf1bc9..d67d634b410aa 100644 --- a/packages/@aws-cdk/aws-s3-notifications/test/queue.test.ts +++ b/packages/@aws-cdk/aws-s3-notifications/test/queue.test.ts @@ -136,6 +136,6 @@ test('if the queue is encrypted with a custom kms key, the key resource policy i ], Version: '2012-10-17', }, - Description: 'Created by Queue', + Description: 'Created by Stack/Queue', }); }); diff --git a/packages/@aws-cdk/aws-secretsmanager/test/test.secret-rotation.ts b/packages/@aws-cdk/aws-secretsmanager/test/test.secret-rotation.ts index 73eed329f232d..9ea54c9a25037 100644 --- a/packages/@aws-cdk/aws-secretsmanager/test/test.secret-rotation.ts +++ b/packages/@aws-cdk/aws-secretsmanager/test/test.secret-rotation.ts @@ -26,7 +26,7 @@ export = { // THEN expect(stack).to(haveResource('AWS::EC2::SecurityGroupIngress', { IpProtocol: 'tcp', - Description: 'from SecretRotationSecurityGroupAEC520AB:3306', + Description: 'from StackSecretRotationSecurityGroup79E4F5FF:3306', FromPort: 3306, GroupId: { 'Fn::GetAtt': [ @@ -59,7 +59,7 @@ export = { })); expect(stack).to(haveResource('AWS::EC2::SecurityGroup', { - GroupDescription: 'SecretRotation/SecurityGroup', + GroupDescription: 'Stack/SecretRotation/SecurityGroup', })); expect(stack).to(haveResource('AWS::Serverless::Application', { @@ -83,7 +83,7 @@ export = { ], ], }, - functionName: 'SecretRotation', + functionName: 'StackSecretRotation369145BF', vpcSecurityGroupIds: { 'Fn::GetAtt': [ 'SecretRotationSecurityGroup9985012B', @@ -182,7 +182,7 @@ export = { ], ], }, - functionName: 'SecretRotation', + functionName: 'StackSecretRotation369145BF', vpcSecurityGroupIds: { 'Fn::GetAtt': [ 'SecretRotationSecurityGroup9985012B', @@ -329,7 +329,7 @@ export = { ], ], }, - functionName: 'RotationSecretRotationSecretRotationSecretRotationSecretRotation', + functionName: 'SecretRotationSecretRotationSecretRotationSecretRotationA7DEE631', vpcSecurityGroupIds: { 'Fn::GetAtt': [ 'SecretRotationSecretRotationSecretRotationSecretRotationSecretRotationSecurityGroupBFCB171A', diff --git a/packages/@aws-cdk/aws-sns-subscriptions/test/subs.test.ts b/packages/@aws-cdk/aws-sns-subscriptions/test/subs.test.ts index 241c1dfdb1491..211500d5371b6 100644 --- a/packages/@aws-cdk/aws-sns-subscriptions/test/subs.test.ts +++ b/packages/@aws-cdk/aws-sns-subscriptions/test/subs.test.ts @@ -284,7 +284,7 @@ test('queue subscription', () => { ], }, }, - 'MyQueueMyTopic9B00631B': { + 'MyQueueStackMyTopic9EF397EEFDFDC132': { 'Type': 'AWS::SNS::Subscription', 'Properties': { 'Protocol': 'sqs', @@ -361,7 +361,7 @@ test('queue subscription with user provided dlq', () => { ], }, }, - 'MyQueueMyTopic9B00631B': { + 'MyQueueStackMyTopic9EF397EEFDFDC132': { 'Type': 'AWS::SNS::Subscription', 'Properties': { 'Protocol': 'sqs', @@ -518,7 +518,7 @@ test('lambda subscription', () => { 'MyFuncServiceRole54065130', ], }, - 'MyFuncAllowInvokeMyTopicDD0A15B8': { + 'MyFuncAllowInvokeStackMyTopic9EF397EEFE1A035D': { 'Type': 'AWS::Lambda::Permission', 'Properties': { 'Action': 'lambda:InvokeFunction', @@ -781,7 +781,7 @@ test('multiple subscriptions', () => { ], }, }, - 'MyQueueMyTopic9B00631B': { + 'MyQueueStackMyTopic9EF397EEFDFDC132': { 'Type': 'AWS::SNS::Subscription', 'Properties': { 'Protocol': 'sqs', @@ -846,7 +846,7 @@ test('multiple subscriptions', () => { 'MyFuncServiceRole54065130', ], }, - 'MyFuncAllowInvokeMyTopicDD0A15B8': { + 'MyFuncAllowInvokeStackMyTopic9EF397EEFE1A035D': { 'Type': 'AWS::Lambda::Permission', 'Properties': { 'Action': 'lambda:InvokeFunction', @@ -887,7 +887,7 @@ test('throws with mutliple subscriptions of the same subscriber', () => { topic.addSubscription(new subs.SqsSubscription(queue)); expect(() => topic.addSubscription(new subs.SqsSubscription(queue))) - .toThrowError(/A subscription with id \"MyTopic\" already exists under the scope MyQueue/); + .toThrowError(/A subscription with id \"StackMyTopic9EF397EE\" already exists under the scope Stack\/MyQueue/); }); test('with filter policy', () => { From 122a912cce3788b4dfbd19676849d9f750b087be Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Fri, 10 Jul 2020 06:33:38 +0000 Subject: [PATCH 21/39] use DependencyGroup instead of CompositeDependable --- packages/@aws-cdk/aws-ec2/lib/vpc.ts | 28 ++------------------------ packages/@aws-cdk/aws-iam/lib/grant.ts | 21 ++----------------- 2 files changed, 4 insertions(+), 45 deletions(-) diff --git a/packages/@aws-cdk/aws-ec2/lib/vpc.ts b/packages/@aws-cdk/aws-ec2/lib/vpc.ts index bc0713cc5e880..4263f3a91aea1 100644 --- a/packages/@aws-cdk/aws-ec2/lib/vpc.ts +++ b/packages/@aws-cdk/aws-ec2/lib/vpc.ts @@ -1,7 +1,7 @@ import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import { ContextProvider, IResource, Lazy, Resource, Stack, Tag, Token } from '@aws-cdk/core'; import * as cxapi from '@aws-cdk/cx-api'; -import { Construct, Dependable, DependencyGroup, IConstruct, IDependable } from 'constructs'; +import { Construct, DependencyGroup, IConstruct, IDependable } from 'constructs'; import { CfnEIP, CfnInternetGateway, CfnNatGateway, CfnRoute, CfnRouteTable, CfnSubnet, CfnSubnetRouteTableAssociation, CfnVPC, CfnVPCGatewayAttachment, CfnVPNGatewayRoutePropagation } from './ec2.generated'; @@ -345,7 +345,7 @@ abstract class VpcBase extends Resource implements IVpc { return { subnetIds: subnets.map(s => s.subnetId), availabilityZones: subnets.map(s => s.availabilityZone), - internetConnectivityEstablished: tap(new CompositeDependable(), d => subnets.forEach(s => d.add(s.internetConnectivityEstablished))), + internetConnectivityEstablished: tap(new DependencyGroup(), d => subnets.forEach(s => d.add(s.internetConnectivityEstablished))), subnets, hasPublic: subnets.some(s => pubs.has(s)), }; @@ -1831,30 +1831,6 @@ function flatMap(xs: T[], fn: (x: T) => U[]): U[] { return ret; } -class CompositeDependable implements IDependable { - private readonly dependables = new Array(); - - constructor() { - const self = this; - Dependable.implement(this, { - get dependencyRoots() { - const ret = new Array(); - for (const dep of self.dependables) { - ret.push(...Dependable.of(dep).dependencyRoots); - } - return ret; - }, - }); - } - - /** - * Add a construct to the dependency roots - */ - public add(dep: IDependable) { - this.dependables.push(dep); - } -} - /** * Invoke a function on a value (for its side effect) and return the value */ diff --git a/packages/@aws-cdk/aws-iam/lib/grant.ts b/packages/@aws-cdk/aws-iam/lib/grant.ts index b9f5cbdd53584..de88121e0b04e 100644 --- a/packages/@aws-cdk/aws-iam/lib/grant.ts +++ b/packages/@aws-cdk/aws-iam/lib/grant.ts @@ -1,4 +1,4 @@ -import { Dependable, IConstruct, IDependable } from 'constructs'; +import { Dependable, DependencyGroup, IConstruct, IDependable } from 'constructs'; import { PolicyStatement } from './policy-statement'; import { IGrantable, IPrincipal } from './principals'; @@ -190,7 +190,7 @@ export class Grant implements IDependable { principalStatement: statement, resourceStatement: result.resourceStatement, options, - policyDependable: resourceDependable ? new CompositeDependable(result, resourceDependable) : result, + policyDependable: resourceDependable ? new DependencyGroup(result, resourceDependable) : result, }); } @@ -316,20 +316,3 @@ export interface AddToResourcePolicyResult { */ readonly policyDependable?: IDependable; } - -/** - * Composite dependable - * - * Not as simple as eagerly getting the dependency roots from the - * inner dependables, as they may be mutable so we need to defer - * the query. - */ -export class CompositeDependable implements IDependable { - constructor(...dependables: IDependable[]) { - Dependable.implement(this, { - get dependencyRoots(): IConstruct[] { - return Array.prototype.concat.apply([], dependables.map(d => Dependable.of(d).dependencyRoots)); - }, - }); - } -} \ No newline at end of file From 0ffcd453584086d2eb880b07bacef1ee474ecfb4 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Fri, 10 Jul 2020 06:34:08 +0000 Subject: [PATCH 22/39] more test updates --- packages/@aws-cdk/aws-cloudformation/test/test.deps.ts | 6 +++--- .../@aws-cdk/aws-cloudformation/test/test.nested-stack.ts | 2 +- packages/@aws-cdk/aws-docdb/test/cluster.test.ts | 4 ++-- packages/@aws-cdk/aws-ec2/test/bastion-host.test.ts | 1 + .../aws-elasticloadbalancingv2/test/alb/test.listener.ts | 7 +++---- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/@aws-cdk/aws-cloudformation/test/test.deps.ts b/packages/@aws-cdk/aws-cloudformation/test/test.deps.ts index ed87cf1f6c3b3..57f59bbb729b4 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/test.deps.ts +++ b/packages/@aws-cdk/aws-cloudformation/test/test.deps.ts @@ -209,9 +209,9 @@ export = { const nested2 = new NestedStack(nested1, 'Nested2'); // THEN - test.throws(() => nested1.addDependency(root), /Nested stack 'Nested1' cannot depend on a parent stack ''/); - test.throws(() => nested2.addDependency(nested1), /Nested stack 'Nested1\/Nested2' cannot depend on a parent stack 'Nested1'/); - test.throws(() => nested2.addDependency(root), /Nested stack 'Nested1\/Nested2' cannot depend on a parent stack ''/); + test.throws(() => nested1.addDependency(root), /Nested stack 'Stack\/Nested1' cannot depend on a parent stack 'Stack'/); + test.throws(() => nested2.addDependency(nested1), /Nested stack 'Stack\/Nested1\/Nested2' cannot depend on a parent stack 'Stack\/Nested1'/); + test.throws(() => nested2.addDependency(root), /Nested stack 'Stack\/Nested1\/Nested2' cannot depend on a parent stack 'Stack'/); test.done(); }, 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 1a5c6c441d39c..4215e4e4ab245 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/test.nested-stack.ts +++ b/packages/@aws-cdk/aws-cloudformation/test/test.nested-stack.ts @@ -900,7 +900,7 @@ export = { ConsumedAttribute: { 'Fn::GetAtt': [ 'nestedNestedStacknestedNestedStackResource3DD143BF', - 'Outputs.nestedresourceinnested59B1F01CConsumedAttribute', + 'Outputs.StacknestedresourceinnestedE8C78B2EConsumedAttribute', ], }, })); diff --git a/packages/@aws-cdk/aws-docdb/test/cluster.test.ts b/packages/@aws-cdk/aws-docdb/test/cluster.test.ts index 957ea0bd40a85..5ae7d24dfc77a 100644 --- a/packages/@aws-cdk/aws-docdb/test/cluster.test.ts +++ b/packages/@aws-cdk/aws-docdb/test/cluster.test.ts @@ -592,7 +592,7 @@ describe('DatabaseCluster', () => { ], ], }, - functionName: 'DatabaseRotationSingleUser458A45BE', + functionName: 'StackDatabaseRotationSingleUserF00A3AD1', vpcSubnetIds: { 'Fn::Join': [ '', @@ -710,7 +710,7 @@ describe('DatabaseCluster', () => { ], ], }, - functionName: 'DatabaseRotation0D47EBD2', + functionName: 'StackDatabaseRotation6713F62B', vpcSubnetIds: { 'Fn::Join': [ '', diff --git a/packages/@aws-cdk/aws-ec2/test/bastion-host.test.ts b/packages/@aws-cdk/aws-ec2/test/bastion-host.test.ts index 738b66c3d82cc..e0f567009721e 100644 --- a/packages/@aws-cdk/aws-ec2/test/bastion-host.test.ts +++ b/packages/@aws-cdk/aws-ec2/test/bastion-host.test.ts @@ -1,3 +1,4 @@ + import { expect, haveResource } from '@aws-cdk/assert'; import { Stack } from '@aws-cdk/core'; import { nodeunitShim, Test } from 'nodeunit-shim'; diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/test.listener.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/test.listener.ts index fd73e219648fc..9ec59bde834e7 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/test.listener.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/test.listener.ts @@ -114,7 +114,8 @@ export = { 'HTTPS listener requires certificate'(test: Test) { // GIVEN - const stack = new cdk.Stack(); + const app = new cdk.App(); + const stack = new cdk.Stack(app, 'Stack'); const vpc = new ec2.Vpc(stack, 'Stack'); const lb = new elbv2.ApplicationLoadBalancer(stack, 'LB', { vpc }); @@ -125,9 +126,7 @@ export = { }); // THEN - const errors = lb.node.validate(); - test.deepEqual(errors.map(e => e.message), ['HTTPS Listener needs at least one certificate (call addCertificates)']); - + test.throws(() => app.synth(), /HTTPS Listener needs at least one certificate/); test.done(); }, From e246cc797f7239cd6cd4703fda3b1596635db134 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Sun, 12 Jul 2020 09:30:36 +0000 Subject: [PATCH 23/39] more updates --- .../@aws-cdk/aws-apigateway/lib/deployment.ts | 35 ++++++------------- .../@aws-cdk/aws-apigateway/lib/restapi.ts | 14 +++++++- .../integ.restapi.multistack.expected.json | 4 +-- .../aws-apigateway/test/test.deployment.ts | 8 ++--- .../aws-apigateway/test/test.vpc-link.ts | 2 +- 5 files changed, 30 insertions(+), 33 deletions(-) diff --git a/packages/@aws-cdk/aws-apigateway/lib/deployment.ts b/packages/@aws-cdk/aws-apigateway/lib/deployment.ts index da3787153a1e7..07dd38fe49781 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/deployment.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/deployment.ts @@ -1,4 +1,4 @@ -import { CfnResource, Lazy, RemovalPolicy, Resource, Stack } from '@aws-cdk/core'; +import { Lazy, RemovalPolicy, Resource, Stack } from '@aws-cdk/core'; import { Construct } from 'constructs'; import * as crypto from 'crypto'; import { CfnDeployment } from './apigateway.generated'; @@ -78,6 +78,15 @@ export class Deployment extends Resource { this.api = props.api; this.deploymentId = Lazy.stringValue({ produce: () => this.resource.ref }); + + // https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-deployment.html + // Quoting from CloudFormation's docs: "If you create an + // AWS::ApiGateway::RestApi resource and its methods (using + // AWS::ApiGateway::Method) in the same template as your deployment, the + // deployment must depend on the RestApi's methods. + if (this.api instanceof RestApi) { + this.node.addDependency(this.api._methodsDependencyGroup); + } } /** @@ -91,30 +100,6 @@ export class Deployment extends Resource { public addToLogicalId(data: any) { this.resource.addToLogicalId(data); } - - /** - * Hook into synthesis before it occurs and make any final adjustments. - */ - protected prepare() { - if (this.api instanceof RestApi) { - // Ignore IRestApi that are imported - - /* - * https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-deployment.html - * Quoting from CloudFormation's docs - "If you create an AWS::ApiGateway::RestApi resource and its methods (using AWS::ApiGateway::Method) in - * the same template as your deployment, the deployment must depend on the RestApi's methods. To create a dependency, add a DependsOn attribute - * to the deployment. If you don't, AWS CloudFormation creates the deployment right after it creates the RestApi resource that doesn't contain - * any methods, and AWS CloudFormation encounters the following error: The REST API doesn't contain any methods." - */ - - /* - * Adding a dependency between LatestDeployment and Method construct, using ConstructNode.addDependencies(), creates additional dependencies - * between AWS::ApiGateway::Deployment and the AWS::Lambda::Permission nodes (children under Method), causing cyclic dependency errors. Hence, - * falling back to declaring dependencies between the underlying CfnResources. - */ - this.api.methods.map(m => m.node.defaultChild as CfnResource).forEach(m => this.resource.addDependsOn(m)); - } - } } interface LatestDeploymentResourceProps { diff --git a/packages/@aws-cdk/aws-apigateway/lib/restapi.ts b/packages/@aws-cdk/aws-apigateway/lib/restapi.ts index b538af885f70c..c4f4ff108092e 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/restapi.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/restapi.ts @@ -1,7 +1,7 @@ import { IVpcEndpoint } from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import { CfnOutput, IResource as IResourceBase, Resource, Stack } from '@aws-cdk/core'; -import { Construct } from 'constructs'; +import { Construct, DependencyGroup } from 'constructs'; import { ApiDefinition } from './api-definition'; import { ApiKey, ApiKeyOptions, IApiKey } from './api-key'; import { CfnAccount, CfnRestApi } from './apigateway.generated'; @@ -544,9 +544,17 @@ export class RestApi extends RestApiBase { */ public readonly methods = new Array(); + /** + * A dependency group that represents all methods attached to this API GW (lazy). + * @internal + */ + public readonly _methodsDependencyGroup: DependencyGroup; + constructor(scope: Construct, id: string, props: RestApiProps = { }) { super(scope, id, props); + this._methodsDependencyGroup = new DependencyGroup(); + const resource = new CfnRestApi(this, 'Resource', { name: this.physicalName, description: props.description, @@ -621,6 +629,10 @@ export class RestApi extends RestApiBase { */ public _attachMethod(method: Method) { this.methods.push(method); + + // we want to take a direct dependency on the CfnMethod resource because + // Method itself has other children and depending on them will cause cyclic deps. + this._methodsDependencyGroup.add(method.node.findChild('Resource')); } /** diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.multistack.expected.json b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.multistack.expected.json index 92ca8ad632bfc..5aa57732955bc 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.multistack.expected.json +++ b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.multistack.expected.json @@ -120,7 +120,7 @@ "BooksApi60AC975F" ] }, - "BooksApiDeployment86CA39AFc1570c78b1ea90526c0309cd74b7b8d0": { + "BooksApiDeployment86CA39AF4ff82f86c127f53c9de94d266b1906be": { "Type": "AWS::ApiGateway::Deployment", "Properties": { "RestApiId": { @@ -141,7 +141,7 @@ "Ref": "BooksApi60AC975F" }, "DeploymentId": { - "Ref": "BooksApiDeployment86CA39AFc1570c78b1ea90526c0309cd74b7b8d0" + "Ref": "BooksApiDeployment86CA39AF4ff82f86c127f53c9de94d266b1906be" }, "StageName": "prod" } diff --git a/packages/@aws-cdk/aws-apigateway/test/test.deployment.ts b/packages/@aws-cdk/aws-apigateway/test/test.deployment.ts index 47118594132a5..0f5ce4a37732d 100644 --- a/packages/@aws-cdk/aws-apigateway/test/test.deployment.ts +++ b/packages/@aws-cdk/aws-apigateway/test/test.deployment.ts @@ -150,16 +150,16 @@ export = { // the logical ID changed const template = synthesize(); test.ok(!template.Resources.deployment33381975bba46c5132329b81e7befcbbba5a0e75, 'old resource id is not deleted'); - test.ok(template.Resources.deployment33381975075f46a4503208d69fcffed2f263c48c, - `new resource deployment33381975075f46a4503208d69fcffed2f263c48c is not created, instead found ${Object.keys(template.Resources)}`); + test.ok(template.Resources.deployment333819758aa4cdb9d204502b959c4903f4d5d29f, + `new resource deployment333819758aa4cdb9d204502b959c4903f4d5d29f is not created, instead found ${Object.keys(template.Resources)}`); // tokens supported, and are resolved upon synthesis const value = 'hello hello'; deployment.addToLogicalId({ foo: Lazy.stringValue({ produce: () => value }) }); const template2 = synthesize(); - test.ok(template2.Resources.deployment33381975b6d7672e4c9afd0b741e41d07739786b, - `resource deployment33381975b6d7672e4c9afd0b741e41d07739786b not found, instead found ${Object.keys(template2.Resources)}`); + test.ok(template2.Resources.deployment333819758d91bed959c6bd6268ba84f6d33e888e, + `resource deployment333819758d91bed959c6bd6268ba84f6d33e888e not found, instead found ${Object.keys(template2.Resources)}`); test.done(); diff --git a/packages/@aws-cdk/aws-apigateway/test/test.vpc-link.ts b/packages/@aws-cdk/aws-apigateway/test/test.vpc-link.ts index 331889ffbdf1e..b619f1fdd4030 100644 --- a/packages/@aws-cdk/aws-apigateway/test/test.vpc-link.ts +++ b/packages/@aws-cdk/aws-apigateway/test/test.vpc-link.ts @@ -47,7 +47,7 @@ export = { // THEN expect(stack).to(haveResourceLike('AWS::ApiGateway::VpcLink', { - Name: 'VpcLink', + Name: 'StackVpcLink0E48D8A7', TargetArns: [ { Ref: 'NLB03D178991' }, { Ref: 'NLB13224D47C' }, From fef4483b051e8bb7305aeed3871c291271a3db99 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Sun, 12 Jul 2020 12:04:00 +0000 Subject: [PATCH 24/39] rename "forceResynth" to "force" --- packages/@aws-cdk/assert/lib/synth-utils.ts | 4 ++-- packages/@aws-cdk/core/lib/stage.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/@aws-cdk/assert/lib/synth-utils.ts b/packages/@aws-cdk/assert/lib/synth-utils.ts index 2794559f1f543..ea3b39542fc67 100644 --- a/packages/@aws-cdk/assert/lib/synth-utils.ts +++ b/packages/@aws-cdk/assert/lib/synth-utils.ts @@ -71,10 +71,10 @@ function synthesizeApp(stack: core.Stack, options: core.SynthesisOptions) { } // to support incremental assertions (i.e. "expect(stack).toNotContainSomething(); doSomething(); expect(stack).toContainSomthing()") - const forceResynth = true; + const force = true; return root.synth({ - forceResynth, + force, ...options, }); } diff --git a/packages/@aws-cdk/core/lib/stage.ts b/packages/@aws-cdk/core/lib/stage.ts index c9c565d385304..d5904cd928a4a 100644 --- a/packages/@aws-cdk/core/lib/stage.ts +++ b/packages/@aws-cdk/core/lib/stage.ts @@ -170,7 +170,7 @@ export class Stage extends Construct { * calls will return the same assembly. */ public synth(options: StageSynthesisOptions = { }): cxapi.CloudAssembly { - if (!this.assembly || options.forceResynth) { + if (!this.assembly || options.force) { const runtimeInfo = this.node.tryGetContext(cxapi.DISABLE_VERSION_REPORTING) ? undefined : collectRuntimeInformation(); this.assembly = synthesize(this, { skipValidation: options.skipValidation, @@ -212,5 +212,5 @@ export interface StageSynthesisOptions { * Do not use in production. * @default false */ - readonly forceResynth?: boolean; + readonly force?: boolean; } From e2ffafa408c787f43684d4a2f79fef697e058cec Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Sun, 12 Jul 2020 12:04:07 +0000 Subject: [PATCH 25/39] more test updates --- .../@aws-cdk/aws-appmesh/test/test.virtual-node.ts | 2 +- .../aws-autoscaling/test/auto-scaling-group.test.ts | 10 +++++----- .../aws-autoscaling/test/lifecyclehooks.test.ts | 2 +- .../@aws-cdk/aws-autoscaling/test/scaling.test.ts | 2 +- .../aws-autoscaling/test/scheduled-action.test.ts | 4 ++-- packages/@aws-cdk/aws-cognito/test/user-pool.test.ts | 4 ++-- packages/@aws-cdk/aws-dynamodb/test/dynamodb.test.ts | 10 +++++----- .../aws-servicediscovery/test/test.instance.ts | 12 ++++++------ 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/packages/@aws-cdk/aws-appmesh/test/test.virtual-node.ts b/packages/@aws-cdk/aws-appmesh/test/test.virtual-node.ts index 82589e2c52ac5..57f86fbb900f3 100644 --- a/packages/@aws-cdk/aws-appmesh/test/test.virtual-node.ts +++ b/packages/@aws-cdk/aws-appmesh/test/test.virtual-node.ts @@ -148,7 +148,7 @@ export = { }, }, }, - VirtualNodeName: 'meshtestnode428A9479', + VirtualNodeName: 'StackmeshtestnodeF42773EB', }), ); diff --git a/packages/@aws-cdk/aws-autoscaling/test/auto-scaling-group.test.ts b/packages/@aws-cdk/aws-autoscaling/test/auto-scaling-group.test.ts index 244b27cb9e67f..df31679ac1237 100644 --- a/packages/@aws-cdk/aws-autoscaling/test/auto-scaling-group.test.ts +++ b/packages/@aws-cdk/aws-autoscaling/test/auto-scaling-group.test.ts @@ -32,7 +32,7 @@ nodeunitShim({ 'MyFleetInstanceSecurityGroup774E8234': { 'Type': 'AWS::EC2::SecurityGroup', 'Properties': { - 'GroupDescription': 'MyFleet/InstanceSecurityGroup', + 'GroupDescription': 'TestStack/MyFleet/InstanceSecurityGroup', 'SecurityGroupEgress': [ { 'CidrIp': '0.0.0.0/0', @@ -43,7 +43,7 @@ nodeunitShim({ 'Tags': [ { 'Key': 'Name', - 'Value': 'MyFleet', + 'Value': 'TestStack/MyFleet', }, ], @@ -68,7 +68,7 @@ nodeunitShim({ 'Tags': [ { 'Key': 'Name', - 'Value': 'MyFleet', + 'Value': 'TestStack/MyFleet', }, ], }, @@ -122,7 +122,7 @@ nodeunitShim({ { 'Key': 'Name', 'PropagateAtLaunch': true, - 'Value': 'MyFleet', + 'Value': 'TestStack/MyFleet', }, ], @@ -521,7 +521,7 @@ nodeunitShim({ { Key: 'Name', PropagateAtLaunch: true, - Value: 'MyFleet', + Value: 'TestStack/MyFleet', }, { Key: 'notsuper', diff --git a/packages/@aws-cdk/aws-autoscaling/test/lifecyclehooks.test.ts b/packages/@aws-cdk/aws-autoscaling/test/lifecyclehooks.test.ts index 1f8ae4c651a55..bd4b77f1dbf67 100644 --- a/packages/@aws-cdk/aws-autoscaling/test/lifecyclehooks.test.ts +++ b/packages/@aws-cdk/aws-autoscaling/test/lifecyclehooks.test.ts @@ -3,7 +3,7 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import * as cdk from '@aws-cdk/core'; import { Construct } from 'constructs'; -import { nodeunitShim, Test } from 'nodeunit'; +import { nodeunitShim, Test } from 'nodeunit-shim'; import * as autoscaling from '../lib'; nodeunitShim({ diff --git a/packages/@aws-cdk/aws-autoscaling/test/scaling.test.ts b/packages/@aws-cdk/aws-autoscaling/test/scaling.test.ts index 0293f8b42ae97..20b4ed988da95 100644 --- a/packages/@aws-cdk/aws-autoscaling/test/scaling.test.ts +++ b/packages/@aws-cdk/aws-autoscaling/test/scaling.test.ts @@ -4,7 +4,7 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as elbv2 from '@aws-cdk/aws-elasticloadbalancingv2'; import * as cdk from '@aws-cdk/core'; import { Construct } from 'constructs'; -import { nodeunitShim, Test } from 'nodeunit'; +import { nodeunitShim, Test } from 'nodeunit-shim'; import * as autoscaling from '../lib'; nodeunitShim({ diff --git a/packages/@aws-cdk/aws-autoscaling/test/scheduled-action.test.ts b/packages/@aws-cdk/aws-autoscaling/test/scheduled-action.test.ts index 2c81cba3a94aa..1c14701d2ef81 100644 --- a/packages/@aws-cdk/aws-autoscaling/test/scheduled-action.test.ts +++ b/packages/@aws-cdk/aws-autoscaling/test/scheduled-action.test.ts @@ -2,7 +2,7 @@ import { expect, haveResource, MatchStyle } from '@aws-cdk/assert'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as cdk from '@aws-cdk/core'; import { Construct } from 'constructs'; -import { nodeunitShim, Test } from 'nodeunit'; +import { nodeunitShim, Test } from 'nodeunit-shim'; import * as autoscaling from '../lib'; nodeunitShim({ @@ -70,7 +70,7 @@ nodeunitShim({ { Key: 'Name', PropagateAtLaunch: true, - Value: 'ASG', + Value: 'Stack/ASG', }, ], VPCZoneIdentifier: [ diff --git a/packages/@aws-cdk/aws-cognito/test/user-pool.test.ts b/packages/@aws-cdk/aws-cognito/test/user-pool.test.ts index 7693ff3c088ea..128d86cce3423 100644 --- a/packages/@aws-cdk/aws-cognito/test/user-pool.test.ts +++ b/packages/@aws-cdk/aws-cognito/test/user-pool.test.ts @@ -33,7 +33,7 @@ describe('User Pool', () => { SnsCallerArn: { 'Fn::GetAtt': [ 'PoolsmsRoleC3352CE6', 'Arn' ], }, - ExternalId: 'Pool', + ExternalId: 'StackPool7DFA52F5', }, lambdaTriggers: ABSENT, }); @@ -45,7 +45,7 @@ describe('User Pool', () => { Action: 'sts:AssumeRole', Condition: { StringEquals: { - 'sts:ExternalId': 'Pool', + 'sts:ExternalId': 'StackPool7DFA52F5', }, }, Effect: 'Allow', diff --git a/packages/@aws-cdk/aws-dynamodb/test/dynamodb.test.ts b/packages/@aws-cdk/aws-dynamodb/test/dynamodb.test.ts index 0da2017e8784e..a496870e97aab 100644 --- a/packages/@aws-cdk/aws-dynamodb/test/dynamodb.test.ts +++ b/packages/@aws-cdk/aws-dynamodb/test/dynamodb.test.ts @@ -723,7 +723,7 @@ test('if an encryption key is included, encrypt/decrypt permissions are also add ], 'Version': '2012-10-17', }, - 'Description': 'Customer-managed key auto-created for encrypting DynamoDB table at Table A', + 'Description': 'Customer-managed key auto-created for encrypting DynamoDB table at Stack/Table A', 'EnableKeyRotation': true, }, 'UpdateReplacePolicy': 'Retain', @@ -1760,7 +1760,7 @@ describe('grants', () => { const user = new iam.User(stack, 'user'); // WHEN - expect(() => table.grantTableListStreams(user)).toThrow(/DynamoDB Streams must be enabled on the table my-table/); + expect(() => table.grantTableListStreams(user)).toThrow(/DynamoDB Streams must be enabled on the table Stack\/my-table/); }); test('"grantTableListStreams" allows principal to list all streams for this table', () => { @@ -1806,7 +1806,7 @@ describe('grants', () => { const user = new iam.User(stack, 'user'); // WHEN - expect(() => table.grantStreamRead(user)).toThrow(/DynamoDB Streams must be enabled on the table my-table/); + expect(() => table.grantStreamRead(user)).toThrow(/DynamoDB Streams must be enabled on the table Stack\/my-table/); }); test('"grantStreamRead" allows principal to read and describe the table stream"', () => { @@ -2270,7 +2270,7 @@ describe('global', () => { ServiceToken: { 'Fn::GetAtt': [ 'awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D', - 'Outputs.awscdkawsdynamodbReplicaProviderframeworkonEventF9504691Arn', + 'Outputs.StackawscdkawsdynamodbReplicaProviderframeworkonEvent27E7BDE8Arn', ], }, TableName: { @@ -2286,7 +2286,7 @@ describe('global', () => { ServiceToken: { 'Fn::GetAtt': [ 'awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D', - 'Outputs.awscdkawsdynamodbReplicaProviderframeworkonEventF9504691Arn', + 'Outputs.StackawscdkawsdynamodbReplicaProviderframeworkonEvent27E7BDE8Arn', ], }, TableName: { diff --git a/packages/@aws-cdk/aws-servicediscovery/test/test.instance.ts b/packages/@aws-cdk/aws-servicediscovery/test/test.instance.ts index c06e0a61cccd7..57d207c94a6a9 100644 --- a/packages/@aws-cdk/aws-servicediscovery/test/test.instance.ts +++ b/packages/@aws-cdk/aws-servicediscovery/test/test.instance.ts @@ -37,7 +37,7 @@ export = { 'Id', ], }, - InstanceId: 'MyNamespaceMyServiceIpInstanceBACEB9D2', + InstanceId: 'StackMyNamespaceMyServiceIpInstanceF1B9ABBE', })); test.done(); @@ -75,7 +75,7 @@ export = { 'Id', ], }, - InstanceId: 'MyNamespaceMyServiceIpInstanceBACEB9D2', + InstanceId: 'StackMyNamespaceMyServiceIpInstanceF1B9ABBE', })); test.done(); @@ -115,7 +115,7 @@ export = { 'Id', ], }, - InstanceId: 'MyNamespaceMyServiceIpInstanceBACEB9D2', + InstanceId: 'StackMyNamespaceMyServiceIpInstanceF1B9ABBE', })); test.done(); @@ -273,7 +273,7 @@ export = { 'Id', ], }, - InstanceId: 'MyNamespaceMyServiceLoadbalancerD1112A76', + InstanceId: 'StackMyNamespaceMyServiceLoadbalancer228D42DF', })); test.done(); @@ -355,7 +355,7 @@ export = { 'Id', ], }, - InstanceId: 'MyNamespaceMyServiceCnameInstance0EB1C98D', + InstanceId: 'StackMyNamespaceMyServiceCnameInstance24D3C50C', })); test.done(); @@ -408,7 +408,7 @@ export = { 'Id', ], }, - InstanceId: 'MyNamespaceMyServiceNonIpInstance7EFD703A', + InstanceId: 'StackMyNamespaceMyServiceNonIpInstance990D5FF0', })); test.done(); From f7d5d60c6b3d2df42397d41a421f6ab97467e328 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Sun, 12 Jul 2020 14:39:04 +0000 Subject: [PATCH 26/39] progression --- .../@aws-cdk/aws-appsync/lib/data-source.ts | 3 +- packages/@aws-cdk/aws-appsync/lib/resolver.ts | 3 +- .../aws-autoscaling/lib/auto-scaling-group.ts | 8 +-- .../lib/aws-dynamodb-global.ts | 2 +- packages/@aws-cdk/aws-ec2/lib/instance.ts | 6 +- packages/@aws-cdk/aws-ec2/lib/volume.ts | 4 +- packages/@aws-cdk/aws-ec2/lib/vpc.ts | 6 +- .../aws-ecr-assets/lib/image-asset.ts | 4 +- .../@aws-cdk/aws-ecs/lib/base/base-service.ts | 4 +- .../@aws-cdk/aws-ecs/lib/images/repository.ts | 4 +- .../test/ec2/test.ec2-task-definition.ts | 18 +++--- .../test/fargate/test.fargate-service.ts | 6 +- .../fargate/test.fargate-task-definition.ts | 2 +- .../@aws-cdk/aws-ecs/test/test.ecs-cluster.ts | 32 +++++----- .../@aws-cdk/aws-eks-legacy/lib/cluster.ts | 6 +- packages/@aws-cdk/aws-eks/lib/cluster.ts | 4 +- .../@aws-cdk/aws-eks/test/test.fargate.ts | 2 +- .../@aws-cdk/aws-eks/test/test.k8s-patch.ts | 2 +- .../lib/alb/application-listener-rule.ts | 2 +- .../lib/alb/application-target-group.ts | 6 +- .../lib/shared/base-listener.ts | 4 +- .../lib/shared/base-target-group.ts | 2 +- .../aws-events-targets/lib/ecs-task.ts | 3 +- .../@aws-cdk/aws-iam/lib/unknown-principal.ts | 4 +- .../aws-lambda-event-sources/test/test.api.ts | 20 +++---- .../test/test.dynamo.ts | 2 +- packages/@aws-cdk/aws-rds/lib/cluster.ts | 4 +- packages/@aws-cdk/aws-s3/test/test.aspect.ts | 2 +- .../@aws-cdk/aws-ses-actions/lib/lambda.ts | 2 +- packages/@aws-cdk/aws-ses-actions/lib/s3.ts | 3 +- packages/@aws-cdk/core/lib/app.ts | 19 ------ .../@aws-cdk/core/lib/context-provider.ts | 3 +- packages/@aws-cdk/core/lib/index.ts | 2 + packages/@aws-cdk/core/lib/logging.ts | 59 +++++++++++++++++++ .../core/lib/private/construct-settings.ts | 18 ------ .../core/lib/private/tree-metadata.ts | 3 +- packages/@aws-cdk/core/lib/stack.ts | 8 +-- packages/@aws-cdk/core/test/test.app.ts | 7 ++- packages/@aws-cdk/core/test/test.construct.ts | 8 +-- packages/@aws-cdk/pipelines/lib/pipeline.ts | 5 +- 40 files changed, 167 insertions(+), 135 deletions(-) create mode 100644 packages/@aws-cdk/core/lib/logging.ts delete mode 100644 packages/@aws-cdk/core/lib/private/construct-settings.ts diff --git a/packages/@aws-cdk/aws-appsync/lib/data-source.ts b/packages/@aws-cdk/aws-appsync/lib/data-source.ts index 0daf1f996a452..8fe442b25040b 100644 --- a/packages/@aws-cdk/aws-appsync/lib/data-source.ts +++ b/packages/@aws-cdk/aws-appsync/lib/data-source.ts @@ -1,7 +1,8 @@ import { ITable } from '@aws-cdk/aws-dynamodb'; import { IGrantable, IPrincipal, IRole, Role, ServicePrincipal } from '@aws-cdk/aws-iam'; import { IFunction } from '@aws-cdk/aws-lambda'; -import { Construct, IResolvable } from '@aws-cdk/core'; +import { IResolvable } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnDataSource } from './appsync.generated'; import { GraphQLApi } from './graphqlapi'; import { BaseResolverProps, Resolver } from './resolver'; diff --git a/packages/@aws-cdk/aws-appsync/lib/resolver.ts b/packages/@aws-cdk/aws-appsync/lib/resolver.ts index ef5e524ac75ae..b0c45554aa313 100644 --- a/packages/@aws-cdk/aws-appsync/lib/resolver.ts +++ b/packages/@aws-cdk/aws-appsync/lib/resolver.ts @@ -1,4 +1,5 @@ -import { Construct, IResolvable } from '@aws-cdk/core'; +import { IResolvable } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { CfnResolver } from './appsync.generated'; import { BaseDataSource } from './data-source'; import { GraphQLApi } from './graphqlapi'; diff --git a/packages/@aws-cdk/aws-autoscaling/lib/auto-scaling-group.ts b/packages/@aws-cdk/aws-autoscaling/lib/auto-scaling-group.ts index 08c5a2b932500..11aa77324c384 100644 --- a/packages/@aws-cdk/aws-autoscaling/lib/auto-scaling-group.ts +++ b/packages/@aws-cdk/aws-autoscaling/lib/auto-scaling-group.ts @@ -6,8 +6,8 @@ import * as iam from '@aws-cdk/aws-iam'; import * as sns from '@aws-cdk/aws-sns'; import { - CfnAutoScalingRollingUpdate, Duration, Fn, IResource, Lazy, PhysicalName, Resource, Stack, - Tag, Tokenization, withResolved, + CfnAutoScalingRollingUpdate, Duration, Fn, IResource, Lazy, Logging, PhysicalName, Resource, + Stack, Tag, Tokenization, withResolved, } from '@aws-cdk/core'; import { Construct } from 'constructs'; import { CfnAutoScalingGroup, CfnAutoScalingGroupProps, CfnLaunchConfiguration } from './autoscaling.generated'; @@ -559,7 +559,7 @@ export class AutoScalingGroup extends AutoScalingGroupBase implements }); if (desiredCapacity !== undefined) { - this.node.addWarning('desiredCapacity has been configured. Be aware this will reset the size of your AutoScalingGroup on every deployment. See https://github.com/aws/aws-cdk/issues/5215'); + Logging.of(this).addWarning('desiredCapacity has been configured. Be aware this will reset the size of your AutoScalingGroup on every deployment. See https://github.com/aws/aws-cdk/issues/5215'); } this.maxInstanceLifetime = props.maxInstanceLifetime; @@ -1138,7 +1138,7 @@ function synthesizeBlockDeviceMappings(construct: Construct, blockDevices: Block throw new Error('iops property is required with volumeType: EbsDeviceVolumeType.IO1'); } } else if (volumeType !== EbsDeviceVolumeType.IO1) { - construct.node.addWarning('iops will be ignored without volumeType: EbsDeviceVolumeType.IO1'); + Logging.of(construct).addWarning('iops will be ignored without volumeType: EbsDeviceVolumeType.IO1'); } } 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 095e657f26f79..95d7383e6f173 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 @@ -41,7 +41,7 @@ export class GlobalTable extends Construct { constructor(scope: Construct, id: string, props: GlobalTableProps) { super(scope, id); - this.node.addWarning('The @aws-cdk/aws-dynamodb-global module has been deprecated in favor of @aws-cdk/aws-dynamodb.Table.replicationRegions'); + cdk.Logging.of(this).addWarning('The @aws-cdk/aws-dynamodb-global module has been deprecated in favor of @aws-cdk/aws-dynamodb.Table.replicationRegions'); this._regionalTables = []; diff --git a/packages/@aws-cdk/aws-ec2/lib/instance.ts b/packages/@aws-cdk/aws-ec2/lib/instance.ts index 7ddf75f86b975..4a1651d711981 100644 --- a/packages/@aws-cdk/aws-ec2/lib/instance.ts +++ b/packages/@aws-cdk/aws-ec2/lib/instance.ts @@ -1,6 +1,6 @@ import * as iam from '@aws-cdk/aws-iam'; -import { Duration, Fn, IResource, Lazy, Resource, Tag } from '@aws-cdk/core'; +import { Duration, Fn, IResource, Lazy, Logging, Resource, Tag } from '@aws-cdk/core'; import { Construct } from 'constructs'; import { Connections, IConnectable } from './connections'; import { CfnInstance } from './ec2.generated'; @@ -292,13 +292,13 @@ export class Instance extends Resource implements IInstance { if (selected.length === 1) { subnet = selected[0]; } else { - this.node.addError(`Need exactly 1 subnet to match AZ '${props.availabilityZone}', found ${selected.length}. Use a different availabilityZone.`); + Logging.of(this).addError(`Need exactly 1 subnet to match AZ '${props.availabilityZone}', found ${selected.length}. Use a different availabilityZone.`); } } else { if (subnets.length > 0) { subnet = subnets[0]; } else { - this.node.addError(`Did not find any subnets matching '${JSON.stringify(props.vpcSubnets)}', please use a different selection.`); + Logging.of(this).addError(`Did not find any subnets matching '${JSON.stringify(props.vpcSubnets)}', please use a different selection.`); } } if (!subnet) { diff --git a/packages/@aws-cdk/aws-ec2/lib/volume.ts b/packages/@aws-cdk/aws-ec2/lib/volume.ts index a83ea66979098..606d18618d838 100644 --- a/packages/@aws-cdk/aws-ec2/lib/volume.ts +++ b/packages/@aws-cdk/aws-ec2/lib/volume.ts @@ -2,7 +2,7 @@ import * as crypto from 'crypto'; import { AccountRootPrincipal, Grant, IGrantable } from '@aws-cdk/aws-iam'; import { IKey, ViaServicePrincipal } from '@aws-cdk/aws-kms'; -import { IResource, Resource, Size, SizeRoundingBehavior, Stack, Tag, Token } from '@aws-cdk/core'; +import { IResource, Logging, Resource, Size, SizeRoundingBehavior, Stack, Tag, Token } from '@aws-cdk/core'; import { Construct } from 'constructs'; import { CfnInstance, CfnVolume } from './ec2.generated'; import { IInstance } from './instance'; @@ -177,7 +177,7 @@ export function synthesizeBlockDeviceMappings(construct: Construct, blockDevices throw new Error('iops property is required with volumeType: EbsDeviceVolumeType.IO1'); } } else if (volumeType !== EbsDeviceVolumeType.IO1) { - construct.node.addWarning('iops will be ignored without volumeType: EbsDeviceVolumeType.IO1'); + Logging.of(construct).addWarning('iops will be ignored without volumeType: EbsDeviceVolumeType.IO1'); } } diff --git a/packages/@aws-cdk/aws-ec2/lib/vpc.ts b/packages/@aws-cdk/aws-ec2/lib/vpc.ts index 4263f3a91aea1..ddefc3fd710be 100644 --- a/packages/@aws-cdk/aws-ec2/lib/vpc.ts +++ b/packages/@aws-cdk/aws-ec2/lib/vpc.ts @@ -1,5 +1,5 @@ import * as cxschema from '@aws-cdk/cloud-assembly-schema'; -import { ContextProvider, IResource, Lazy, Resource, Stack, Tag, Token } from '@aws-cdk/core'; +import { ContextProvider, IResource, Lazy, Logging, Resource, Stack, Tag, Token } from '@aws-cdk/core'; import * as cxapi from '@aws-cdk/cx-api'; import { Construct, DependencyGroup, IConstruct, IDependable } from 'constructs'; import { @@ -376,7 +376,7 @@ abstract class VpcBase extends Resource implements IVpc { const routeTableIds = allRouteTableIds(flatten(vpnRoutePropagation.map(s => this.selectSubnets(s).subnets))); if (routeTableIds.length === 0) { - this.node.addError(`enableVpnGateway: no subnets matching selection: '${JSON.stringify(vpnRoutePropagation)}'. Select other subnets to add routes to.`); + Logging.of(this).addError(`enableVpnGateway: no subnets matching selection: '${JSON.stringify(vpnRoutePropagation)}'. Select other subnets to add routes to.`); } const routePropagation = new CfnVPNGatewayRoutePropagation(this, 'RoutePropagation', { @@ -1853,7 +1853,7 @@ class ImportedSubnet extends Resource implements ISubnet, IPublicSubnet, IPrivat ? `at '${scope.node.path}/${id}'` : `'${attrs.subnetId}'`; // tslint:disable-next-line: max-line-length - scope.node.addWarning(`No routeTableId was provided to the subnet ${ref}. Attempting to read its .routeTable.routeTableId will return null/undefined. (More info: https://github.com/aws/aws-cdk/pull/3171)`); + Logging.of(this).addWarning(`No routeTableId was provided to the subnet ${ref}. Attempting to read its .routeTable.routeTableId will return null/undefined. (More info: https://github.com/aws/aws-cdk/pull/3171)`); } this._availabilityZone = attrs.availabilityZone; 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 b86925d322f2e..e5c3d0a29d15a 100644 --- a/packages/@aws-cdk/aws-ecr-assets/lib/image-asset.ts +++ b/packages/@aws-cdk/aws-ecr-assets/lib/image-asset.ts @@ -1,6 +1,6 @@ import * as assets from '@aws-cdk/assets'; import * as ecr from '@aws-cdk/aws-ecr'; -import { Stack, Token } from '@aws-cdk/core'; +import { Logging, Stack, Token } from '@aws-cdk/core'; import { Construct } from 'constructs'; import * as fs from 'fs'; import * as minimatch from 'minimatch'; @@ -113,7 +113,7 @@ export class DockerImageAsset extends Construct implements assets.IAsset { }); if (props.repositoryName) { - this.node.addWarning('DockerImageAsset.repositoryName is deprecated. Override "core.Stack.addDockerImageAsset" to control asset locations'); + Logging.of(this).addWarning('DockerImageAsset.repositoryName is deprecated. Override "core.Stack.addDockerImageAsset" to control asset locations'); } // include build context in "extra" so it will impact the hash diff --git a/packages/@aws-cdk/aws-ecs/lib/base/base-service.ts b/packages/@aws-cdk/aws-ecs/lib/base/base-service.ts index 16948e91b9166..ceaa43efe03ea 100644 --- a/packages/@aws-cdk/aws-ecs/lib/base/base-service.ts +++ b/packages/@aws-cdk/aws-ecs/lib/base/base-service.ts @@ -5,7 +5,7 @@ import * as elb from '@aws-cdk/aws-elasticloadbalancing'; import * as elbv2 from '@aws-cdk/aws-elasticloadbalancingv2'; import * as iam from '@aws-cdk/aws-iam'; import * as cloudmap from '@aws-cdk/aws-servicediscovery'; -import { Duration, IResolvable, IResource, Lazy, Resource, Stack } from '@aws-cdk/core'; +import { Duration, IResolvable, IResource, Lazy, Logging, Resource, Stack } from '@aws-cdk/core'; import { Construct } from 'constructs'; import { LoadBalancerTargetOptions, NetworkMode, TaskDefinition } from '../base/task-definition'; import { ICluster } from '../cluster'; @@ -357,7 +357,7 @@ export abstract class BaseService extends Resource }); if (props.deploymentController?.type === DeploymentControllerType.EXTERNAL) { - this.node.addWarning('taskDefinition and launchType are blanked out when using external deployment controller.'); + Logging.of(this).addWarning('taskDefinition and launchType are blanked out when using external deployment controller.'); } this.serviceArn = this.getResourceArnAttribute(this.resource.ref, { diff --git a/packages/@aws-cdk/aws-ecs/lib/images/repository.ts b/packages/@aws-cdk/aws-ecs/lib/images/repository.ts index 7bef7ef41ce22..b11f5255a39a1 100644 --- a/packages/@aws-cdk/aws-ecs/lib/images/repository.ts +++ b/packages/@aws-cdk/aws-ecs/lib/images/repository.ts @@ -1,5 +1,5 @@ import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; -import { Token } from '@aws-cdk/core'; +import { Logging, Token } from '@aws-cdk/core'; import { Construct } from 'constructs'; import { ContainerDefinition } from '../container-definition'; import { ContainerImage, ContainerImageConfig } from '../container-image'; @@ -38,7 +38,7 @@ export class RepositoryImage extends ContainerImage { 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)) { - scope.node.addWarning("Proper policies need to be attached before pulling from ECR repository, or use 'fromEcrRepository'."); + Logging.of(scope).addWarning("Proper policies need to be attached before pulling from ECR repository, or use 'fromEcrRepository'."); } if (this.props.credentials) { diff --git a/packages/@aws-cdk/aws-ecs/test/ec2/test.ec2-task-definition.ts b/packages/@aws-cdk/aws-ecs/test/ec2/test.ec2-task-definition.ts index d6bee7ccea946..f986737e23c69 100644 --- a/packages/@aws-cdk/aws-ecs/test/ec2/test.ec2-task-definition.ts +++ b/packages/@aws-cdk/aws-ecs/test/ec2/test.ec2-task-definition.ts @@ -18,7 +18,7 @@ export = { // THEN expect(stack).to(haveResource('AWS::ECS::TaskDefinition', { - Family: 'Ec2TaskDef', + Family: 'StackEc2TaskDefF03698CF', NetworkMode: ecs.NetworkMode.BRIDGE, RequiresCompatibilities: ['EC2'], })); @@ -194,7 +194,7 @@ export = { // THEN expect(stack).to(haveResource('AWS::ECS::TaskDefinition', { - Family: 'Ec2TaskDef', + Family: 'StackEc2TaskDefF03698CF', ContainerDefinitions: [{ Essential: true, Memory: 512, @@ -287,7 +287,7 @@ export = { // THEN expect(stack).to(haveResource('AWS::ECS::TaskDefinition', { - Family: 'Ec2TaskDef', + Family: 'StackEc2TaskDefF03698CF', ContainerDefinitions: [ { Command: [ @@ -428,7 +428,7 @@ export = { })); expect(stack).to(haveResource('AWS::ECS::TaskDefinition', { - Family: 'Ec2TaskDef', + Family: 'StackEc2TaskDefF03698CF', ContainerDefinitions: [{ Essential: true, Memory: 512, @@ -557,7 +557,7 @@ export = { // THEN expect(stack).to(haveResource('AWS::ECS::TaskDefinition', { - Family: 'Ec2TaskDef', + Family: 'StackEc2TaskDefF03698CF', ContainerDefinitions: [ { Essential: true, @@ -624,7 +624,7 @@ export = { // THEN expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { - Family: 'Ec2TaskDef', + Family: 'StackEc2TaskDefF03698CF', ContainerDefinitions: [{ MountPoints: [ { @@ -675,7 +675,7 @@ export = { // THEN expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { - Family: 'Ec2TaskDef', + Family: 'StackEc2TaskDefF03698CF', ContainerDefinitions: [{ Name: 'dependency1', }, @@ -858,7 +858,7 @@ export = { // THEN expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { - Family: 'Ec2TaskDef', + Family: 'StackEc2TaskDefF03698CF', ContainerDefinitions: [{ MountPoints: [ { @@ -966,7 +966,7 @@ export = { // THEN expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { - Family: 'Ec2TaskDef', + Family: 'StackEc2TaskDefF03698CF', Volumes: [{ Name: 'scratch', DockerVolumeConfiguration: { diff --git a/packages/@aws-cdk/aws-ecs/test/fargate/test.fargate-service.ts b/packages/@aws-cdk/aws-ecs/test/fargate/test.fargate-service.ts index 454d904f7592f..5a33ccf0af893 100644 --- a/packages/@aws-cdk/aws-ecs/test/fargate/test.fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs/test/fargate/test.fargate-service.ts @@ -66,7 +66,7 @@ export = { })); expect(stack).to(haveResource('AWS::EC2::SecurityGroup', { - GroupDescription: 'FargateService/SecurityGroup', + GroupDescription: 'Stack/FargateService/SecurityGroup', SecurityGroupEgress: [ { CidrIp: '0.0.0.0/0', @@ -897,7 +897,7 @@ export = { protocol: ecs.Protocol.TCP, })], }); - }, /Container 'FargateTaskDef\/MainContainer' has no mapping for port 8001 and protocol tcp. Did you call "container.addPortMappings\(\)"\?/); + }, /Container 'Stack\/FargateTaskDef\/MainContainer' has no mapping for port 8001 and protocol tcp. Did you call "container.addPortMappings\(\)"\?/); test.done(); }, @@ -932,7 +932,7 @@ export = { containerPort: 8002, })], }); - }, /Container 'FargateTaskDef\/MainContainer' has no mapping for port 8002 and protocol tcp. Did you call "container.addPortMappings\(\)"\?/); + }, /Container 'Stack\/FargateTaskDef\/MainContainer' has no mapping for port 8002 and protocol tcp. Did you call "container.addPortMappings\(\)"\?/); test.done(); }, diff --git a/packages/@aws-cdk/aws-ecs/test/fargate/test.fargate-task-definition.ts b/packages/@aws-cdk/aws-ecs/test/fargate/test.fargate-task-definition.ts index 05e65d48d1730..989c55a6c94cc 100644 --- a/packages/@aws-cdk/aws-ecs/test/fargate/test.fargate-task-definition.ts +++ b/packages/@aws-cdk/aws-ecs/test/fargate/test.fargate-task-definition.ts @@ -13,7 +13,7 @@ export = { // THEN expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { - Family: 'FargateTaskDef', + Family: 'StackFargateTaskDefF2C9186E', NetworkMode: ecs.NetworkMode.AWS_VPC, RequiresCompatibilities: ['FARGATE'], Cpu: '256', diff --git a/packages/@aws-cdk/aws-ecs/test/test.ecs-cluster.ts b/packages/@aws-cdk/aws-ecs/test/test.ecs-cluster.ts index b7d4b59a47e79..ef08231fd176a 100644 --- a/packages/@aws-cdk/aws-ecs/test/test.ecs-cluster.ts +++ b/packages/@aws-cdk/aws-ecs/test/test.ecs-cluster.ts @@ -26,7 +26,7 @@ export = { Tags: [ { Key: 'Name', - Value: 'EcsCluster/Vpc', + Value: 'Stack/EcsCluster/Vpc', }, ], })); @@ -74,7 +74,7 @@ export = { { Key: 'Name', PropagateAtLaunch: true, - Value: 'EcsCluster/DefaultAutoScalingGroup', + Value: 'Stack/EcsCluster/DefaultAutoScalingGroup', }, ], VPCZoneIdentifier: [ @@ -88,7 +88,7 @@ export = { })); expect(stack).to(haveResource('AWS::EC2::SecurityGroup', { - GroupDescription: 'EcsCluster/DefaultAutoScalingGroup/InstanceSecurityGroup', + GroupDescription: 'Stack/EcsCluster/DefaultAutoScalingGroup/InstanceSecurityGroup', SecurityGroupEgress: [ { CidrIp: '0.0.0.0/0', @@ -99,7 +99,7 @@ export = { Tags: [ { Key: 'Name', - Value: 'EcsCluster/DefaultAutoScalingGroup', + Value: 'Stack/EcsCluster/DefaultAutoScalingGroup', }, ], VpcId: { @@ -171,7 +171,7 @@ export = { Tags: [ { Key: 'Name', - Value: 'MyVpc', + Value: 'Stack/MyVpc', }, ], })); @@ -219,7 +219,7 @@ export = { { Key: 'Name', PropagateAtLaunch: true, - Value: 'EcsCluster/DefaultAutoScalingGroup', + Value: 'Stack/EcsCluster/DefaultAutoScalingGroup', }, ], VPCZoneIdentifier: [ @@ -233,7 +233,7 @@ export = { })); expect(stack).to(haveResource('AWS::EC2::SecurityGroup', { - GroupDescription: 'EcsCluster/DefaultAutoScalingGroup/InstanceSecurityGroup', + GroupDescription: 'Stack/EcsCluster/DefaultAutoScalingGroup/InstanceSecurityGroup', SecurityGroupEgress: [ { CidrIp: '0.0.0.0/0', @@ -244,7 +244,7 @@ export = { Tags: [ { Key: 'Name', - Value: 'EcsCluster/DefaultAutoScalingGroup', + Value: 'Stack/EcsCluster/DefaultAutoScalingGroup', }, ], VpcId: { @@ -471,7 +471,7 @@ export = { Tags: [ { Key: 'Name', - Value: 'MyVpc', + Value: 'Stack/MyVpc', }, ], })); @@ -519,7 +519,7 @@ export = { { Key: 'Name', PropagateAtLaunch: true, - Value: 'EcsCluster/DefaultAutoScalingGroup', + Value: 'Stack/EcsCluster/DefaultAutoScalingGroup', }, ], VPCZoneIdentifier: [ @@ -533,7 +533,7 @@ export = { })); expect(stack).to(haveResource('AWS::EC2::SecurityGroup', { - GroupDescription: 'EcsCluster/DefaultAutoScalingGroup/InstanceSecurityGroup', + GroupDescription: 'Stack/EcsCluster/DefaultAutoScalingGroup/InstanceSecurityGroup', SecurityGroupEgress: [ { CidrIp: '0.0.0.0/0', @@ -544,7 +544,7 @@ export = { Tags: [ { Key: 'Name', - Value: 'EcsCluster/DefaultAutoScalingGroup', + Value: 'Stack/EcsCluster/DefaultAutoScalingGroup', }, ], VpcId: { @@ -1228,7 +1228,7 @@ export = { Tags: [ { Key: 'Name', - Value: 'MyPublicVpc', + Value: 'Stack/MyPublicVpc', }, ], })); @@ -1277,7 +1277,7 @@ export = { { Key: 'Name', PropagateAtLaunch: true, - Value: 'EcsCluster/DefaultAutoScalingGroup', + Value: 'Stack/EcsCluster/DefaultAutoScalingGroup', }, ], VPCZoneIdentifier: [ @@ -1291,7 +1291,7 @@ export = { })); expect(stack).to(haveResource('AWS::EC2::SecurityGroup', { - GroupDescription: 'EcsCluster/DefaultAutoScalingGroup/InstanceSecurityGroup', + GroupDescription: 'Stack/EcsCluster/DefaultAutoScalingGroup/InstanceSecurityGroup', SecurityGroupEgress: [ { CidrIp: '0.0.0.0/0', @@ -1302,7 +1302,7 @@ export = { Tags: [ { Key: 'Name', - Value: 'EcsCluster/DefaultAutoScalingGroup', + Value: 'Stack/EcsCluster/DefaultAutoScalingGroup', }, ], VpcId: { diff --git a/packages/@aws-cdk/aws-eks-legacy/lib/cluster.ts b/packages/@aws-cdk/aws-eks-legacy/lib/cluster.ts index 73fd08de5995a..89ec75819ead0 100644 --- a/packages/@aws-cdk/aws-eks-legacy/lib/cluster.ts +++ b/packages/@aws-cdk/aws-eks-legacy/lib/cluster.ts @@ -3,7 +3,7 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import * as lambda from '@aws-cdk/aws-lambda'; import * as ssm from '@aws-cdk/aws-ssm'; -import { CfnOutput, Duration, IResource, Resource, Stack, Tag, Token } from '@aws-cdk/core'; +import { CfnOutput, Duration, IResource, Logging, Resource, Stack, Tag, Token } from '@aws-cdk/core'; import { Construct } from 'constructs'; import * as path from 'path'; import { AwsAuth } from './aws-auth'; @@ -337,7 +337,7 @@ export class Cluster extends Resource implements ICluster { physicalName: props.clusterName, }); - this.node.addWarning('The @aws-cdk/aws-eks-legacy module will no longer be released as part of the AWS CDK starting March 1st, 2020. Please refer to https://github.com/aws/aws-cdk/issues/5544 for upgrade instructions'); + Logging.of(this).addWarning('The @aws-cdk/aws-eks-legacy module will no longer be released as part of the AWS CDK starting March 1st, 2020. Please refer to https://github.com/aws/aws-cdk/issues/5544 for upgrade instructions'); const stack = Stack.of(this); @@ -637,7 +637,7 @@ export class Cluster extends Resource implements ICluster { // message (if token): "could not auto-tag public/private subnet with tag..." // message (if not token): "count not auto-tag public/private subnet xxxxx with tag..." const subnetID = Token.isUnresolved(subnet.subnetId) ? '' : ` ${subnet.subnetId}`; - this.node.addWarning(`Could not auto-tag ${type} subnet${subnetID} with "${tag}=1", please remember to do this manually`); + Logging.of(this).addWarning(`Could not auto-tag ${type} subnet${subnetID} with "${tag}=1", please remember to do this manually`); continue; } diff --git a/packages/@aws-cdk/aws-eks/lib/cluster.ts b/packages/@aws-cdk/aws-eks/lib/cluster.ts index 30bb1b7737d62..57db47c66757e 100644 --- a/packages/@aws-cdk/aws-eks/lib/cluster.ts +++ b/packages/@aws-cdk/aws-eks/lib/cluster.ts @@ -2,7 +2,7 @@ import * as autoscaling from '@aws-cdk/aws-autoscaling'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import * as ssm from '@aws-cdk/aws-ssm'; -import { CfnOutput, CfnResource, IResource, Resource, Stack, Tag, Token } from '@aws-cdk/core'; +import { CfnOutput, CfnResource, IResource, Logging, Resource, Stack, Tag, Token } from '@aws-cdk/core'; import { Construct } from 'constructs'; import * as fs from 'fs'; import * as path from 'path'; @@ -954,7 +954,7 @@ export class Cluster extends Resource implements ICluster { // message (if token): "could not auto-tag public/private subnet with tag..." // message (if not token): "count not auto-tag public/private subnet xxxxx with tag..." const subnetID = Token.isUnresolved(subnet.subnetId) ? '' : ` ${subnet.subnetId}`; - this.node.addWarning(`Could not auto-tag ${type} subnet${subnetID} with "${tag}=1", please remember to do this manually`); + Logging.of(this).addWarning(`Could not auto-tag ${type} subnet${subnetID} with "${tag}=1", please remember to do this manually`); continue; } diff --git a/packages/@aws-cdk/aws-eks/test/test.fargate.ts b/packages/@aws-cdk/aws-eks/test/test.fargate.ts index 870a871f266fa..f0ee207322281 100644 --- a/packages/@aws-cdk/aws-eks/test/test.fargate.ts +++ b/packages/@aws-cdk/aws-eks/test/test.fargate.ts @@ -281,7 +281,7 @@ export = { Properties: { ServiceToken: { 'Fn::GetAtt': [ 'awscdkawseksClusterResourceProviderNestedStackawscdkawseksClusterResourceProviderNestedStackResource9827C454', - 'Outputs.awscdkawseksClusterResourceProviderframeworkonEventEA97AA31Arn', + 'Outputs.StackawscdkawseksClusterResourceProviderframeworkonEvent9D6CED48Arn', ]}, AssumeRoleArn: { 'Fn::GetAtt': [ 'MyClusterCreationRoleB5FA4FF3', 'Arn' ] }, Config: { 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 b8963aa3a3989..b8a2056e1a749 100644 --- a/packages/@aws-cdk/aws-eks/test/test.k8s-patch.ts +++ b/packages/@aws-cdk/aws-eks/test/test.k8s-patch.ts @@ -25,7 +25,7 @@ export = { ServiceToken: { 'Fn::GetAtt': [ 'awscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6B', - 'Outputs.awscdkawseksKubectlProviderframeworkonEvent0A650005Arn', + 'Outputs.StackawscdkawseksKubectlProviderframeworkonEvent8897FD9BArn', ], }, ResourceName: 'myResourceName', 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 4fc8c39270ff3..6f4159cb4308f 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 @@ -299,7 +299,7 @@ export class ApplicationListenerRule extends Construct { // Instead, signal this through a warning. // @deprecate: upon the next major version bump, replace this with a `throw` if (this.action) { - this.node.addWarning('An Action already existed on this ListenerRule and was replaced. Configure exactly one default Action.'); + cdk.Logging.of(this).addWarning('An Action already existed on this ListenerRule and was replaced. Configure exactly one default Action.'); } action.bind(this, this.listener, this); 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 b568a47f7f180..077090780b996 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 @@ -1,6 +1,6 @@ import * as cloudwatch from '@aws-cdk/aws-cloudwatch'; import * as ec2 from '@aws-cdk/aws-ec2'; -import { Duration } from '@aws-cdk/core'; +import { Duration, Logging } from '@aws-cdk/core'; import { Construct, IConstruct } from 'constructs'; import { BaseTargetGroupProps, ITargetGroup, loadBalancerNameFromListenerArn, LoadBalancerTargetProps, @@ -375,11 +375,11 @@ export interface IApplicationTargetGroup extends ITargetGroup { class ImportedApplicationTargetGroup extends ImportedTargetGroupBase implements IApplicationTargetGroup { public registerListener(_listener: IApplicationListener, _associatingConstruct?: IConstruct) { // Nothing to do, we know nothing of our members - this.node.addWarning('Cannot register listener on imported target group -- security groups might need to be updated manually'); + Logging.of(this).addWarning('Cannot register listener on imported target group -- security groups might need to be updated manually'); } public registerConnectable(_connectable: ec2.IConnectable, _portRange?: ec2.Port | undefined): void { - this.node.addWarning('Cannot register connectable on imported target group -- security groups might need to be updated manually'); + Logging.of(this).addWarning('Cannot register connectable on imported target group -- security groups might need to be updated manually'); } public addTarget(...targets: IApplicationLoadBalancerTarget[]) { 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 ac33f4610d79c..c10625b7515b2 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/base-listener.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/base-listener.ts @@ -1,4 +1,4 @@ -import { Lazy, Resource } from '@aws-cdk/core'; +import { Lazy, Logging, Resource } from '@aws-cdk/core'; import { Construct } from 'constructs'; import { CfnListener } from '../elasticloadbalancingv2.generated'; import { IListenerAction } from './listener-action'; @@ -51,7 +51,7 @@ export abstract class BaseListener extends Resource { // Instead, signal this through a warning. // @deprecate: upon the next major version bump, replace this with a `throw` if (this.defaultAction) { - this.node.addWarning('A default Action already existed on this Listener and was replaced. Configure exactly one default Action.'); + Logging.of(this).addWarning('A default Action already existed on this Listener and was replaced. Configure exactly one default Action.'); } this.defaultAction = action; 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 b471f9f958600..0160a3fbf47a0 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 @@ -314,7 +314,7 @@ export abstract class TargetGroupBase extends Construct implements ITargetGroup const ret = []; if (this.targetType === undefined && this.targetsJson.length === 0) { - this.node.addWarning("When creating an empty TargetGroup, you should specify a 'targetType' (this warning may become an error in the future)."); + cdk.Logging.of(this).addWarning("When creating an empty TargetGroup, you should specify a 'targetType' (this warning may become an error in the future)."); } if (this.targetType !== TargetType.LAMBDA && this.vpc === undefined) { 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 4565ee8b9b0f1..b5f895423536d 100644 --- a/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts +++ b/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts @@ -2,6 +2,7 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as ecs from '@aws-cdk/aws-ecs'; import * as events from '@aws-cdk/aws-events'; import * as iam from '@aws-cdk/aws-iam'; +import { Logging } from '@aws-cdk/core'; import { ContainerOverride } from './ecs-task-properties'; import { singletonEventRole } from './util'; @@ -99,7 +100,7 @@ export class EcsTask implements events.IRuleTarget { // Security groups are only configurable with the "awsvpc" network mode. if (this.taskDefinition.networkMode !== ecs.NetworkMode.AWS_VPC) { if (props.securityGroup !== undefined || props.securityGroups !== undefined) { - this.taskDefinition.node.addWarning('security groups are ignored when network mode is not awsvpc'); + Logging.of(this.taskDefinition).addWarning('security groups are ignored when network mode is not awsvpc'); } return; } diff --git a/packages/@aws-cdk/aws-iam/lib/unknown-principal.ts b/packages/@aws-cdk/aws-iam/lib/unknown-principal.ts index 31da95243aa01..24995085e3ec5 100644 --- a/packages/@aws-cdk/aws-iam/lib/unknown-principal.ts +++ b/packages/@aws-cdk/aws-iam/lib/unknown-principal.ts @@ -1,4 +1,4 @@ -import { Stack } from '@aws-cdk/core'; +import { Logging, Stack } from '@aws-cdk/core'; import { DependencyGroup, IConstruct } from 'constructs'; import { PolicyStatement } from './policy-statement'; import { AddToPrincipalPolicyResult, IPrincipal, PrincipalPolicyFragment } from './principals'; @@ -41,7 +41,7 @@ export class UnknownPrincipal implements IPrincipal { public addToPrincipalPolicy(statement: PolicyStatement): AddToPrincipalPolicyResult { const stack = Stack.of(this.resource); const repr = JSON.stringify(stack.resolve(statement)); - this.resource.node.addWarning(`Add statement to this resource's role: ${repr}`); + Logging.of(this.resource).addWarning(`Add statement to this resource's role: ${repr}`); // Pretend we did the work. The human will do it for us, eventually. return { statementAdded: true, policyDependable: new DependencyGroup() }; } diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/test.api.ts b/packages/@aws-cdk/aws-lambda-event-sources/test/test.api.ts index 63844bb072e09..4498b64a28e6d 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/test/test.api.ts +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/test.api.ts @@ -20,12 +20,12 @@ export = { // THEN expect(stack).to(haveResource('AWS::ApiGateway::Resource', { PathPart: 'foo', - ParentId: { 'Fn::GetAtt': [ 'MyFuncApiEventSourceA7A86A4FFB3F557C', 'RootResourceId' ] }, + ParentId: { 'Fn::GetAtt': [ 'StackMyFunc9605894BApiEventSourceA7A86A4FA0EF20EE', 'RootResourceId' ] }, })); expect(stack).to(haveResource('AWS::ApiGateway::Method', { HttpMethod: 'GET', - ResourceId: { Ref: 'MyFuncApiEventSourceA7A86A4FfooCA6F87E4' }, + ResourceId: { Ref: 'StackMyFunc9605894BApiEventSourceA7A86A4Ffoo036E62EF' }, })); test.done(); @@ -47,22 +47,22 @@ export = { // THEN expect(stack).to(haveResource('AWS::ApiGateway::Resource', { PathPart: 'foo', - ParentId: { 'Fn::GetAtt': [ 'MyFuncApiEventSourceA7A86A4FFB3F557C', 'RootResourceId' ] }, + ParentId: { 'Fn::GetAtt': [ 'StackMyFunc9605894BApiEventSourceA7A86A4FA0EF20EE', 'RootResourceId' ] }, })); expect(stack).to(haveResource('AWS::ApiGateway::Resource', { PathPart: 'bar', - ParentId: { 'Fn::GetAtt': [ 'MyFuncApiEventSourceA7A86A4FFB3F557C', 'RootResourceId' ] }, + ParentId: { 'Fn::GetAtt': [ 'StackMyFunc9605894BApiEventSourceA7A86A4FA0EF20EE', 'RootResourceId' ] }, })); expect(stack).to(haveResource('AWS::ApiGateway::Method', { HttpMethod: 'GET', - ResourceId: { Ref: 'MyFuncApiEventSourceA7A86A4FfooCA6F87E4' }, + ResourceId: { Ref: 'StackMyFunc9605894BApiEventSourceA7A86A4Ffoo036E62EF' }, })); expect(stack).to(haveResource('AWS::ApiGateway::Method', { HttpMethod: 'POST', - ResourceId: { Ref: 'MyFuncApiEventSourceA7A86A4FbarDFB0F21B' }, + ResourceId: { Ref: 'StackMyFunc9605894BApiEventSourceA7A86A4FbarDB723DC5' }, })); test.done(); @@ -85,22 +85,22 @@ export = { // THEN expect(stack).to(haveResource('AWS::ApiGateway::Resource', { PathPart: 'foo', - ParentId: { 'Fn::GetAtt': [ 'MyFuncApiEventSourceA7A86A4FFB3F557C', 'RootResourceId' ] }, + ParentId: { 'Fn::GetAtt': [ 'StackMyFunc9605894BApiEventSourceA7A86A4FA0EF20EE', 'RootResourceId' ] }, })); expect(stack).to(haveResource('AWS::ApiGateway::Resource', { PathPart: 'bar', - ParentId: { Ref: 'MyFuncApiEventSourceA7A86A4FfooCA6F87E4' }, + ParentId: { Ref: 'StackMyFunc9605894BApiEventSourceA7A86A4Ffoo036E62EF' }, })); expect(stack).to(haveResource('AWS::ApiGateway::Method', { HttpMethod: 'GET', - ResourceId: { Ref: 'MyFuncApiEventSourceA7A86A4FfooCA6F87E4' }, + ResourceId: { Ref: 'StackMyFunc9605894BApiEventSourceA7A86A4Ffoo036E62EF' }, })); expect(stack).to(haveResource('AWS::ApiGateway::Method', { HttpMethod: 'POST', - ResourceId: { Ref: 'MyFuncApiEventSourceA7A86A4Ffoobar028FFFDE' }, + ResourceId: { Ref: 'StackMyFunc9605894BApiEventSourceA7A86A4Ffoobar74614CB9' }, })); test.done(); diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/test.dynamo.ts b/packages/@aws-cdk/aws-lambda-event-sources/test/test.dynamo.ts index 008a820f295cf..dc9cb9e5cf5fd 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/test/test.dynamo.ts +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/test.dynamo.ts @@ -127,7 +127,7 @@ export = { test.throws(() => fn.addEventSource(new sources.DynamoEventSource(table, { batchSize: 50, startingPosition: lambda.StartingPosition.LATEST, - })), /DynamoDB Streams must be enabled on the table T/); + })), /DynamoDB Streams must be enabled on the table Stack\/T/); test.done(); }, diff --git a/packages/@aws-cdk/aws-rds/lib/cluster.ts b/packages/@aws-cdk/aws-rds/lib/cluster.ts index 1c489edcfcf6d..908df0d36cd8c 100644 --- a/packages/@aws-cdk/aws-rds/lib/cluster.ts +++ b/packages/@aws-cdk/aws-rds/lib/cluster.ts @@ -3,7 +3,7 @@ import { IRole, ManagedPolicy, Role, ServicePrincipal } from '@aws-cdk/aws-iam'; 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 { CfnDeletionPolicy, Duration, RemovalPolicy, Resource, Token } from '@aws-cdk/core'; +import { CfnDeletionPolicy, Duration, Logging, RemovalPolicy, Resource, Token } from '@aws-cdk/core'; import { Construct } from 'constructs'; import { DatabaseClusterAttributes, IDatabaseCluster } from './cluster-ref'; import { DatabaseSecret } from './database-secret'; @@ -348,7 +348,7 @@ export class DatabaseCluster extends DatabaseClusterBase { // Cannot test whether the subnets are in different AZs, but at least we can test the amount. if (subnetIds.length < 2) { - this.node.addError(`Cluster requires at least 2 subnets, got ${subnetIds.length}`); + Logging.of(this).addError(`Cluster requires at least 2 subnets, got ${subnetIds.length}`); } const subnetGroup = new CfnDBSubnetGroup(this, 'Subnets', { diff --git a/packages/@aws-cdk/aws-s3/test/test.aspect.ts b/packages/@aws-cdk/aws-s3/test/test.aspect.ts index 7777ea43fe59c..54b6fbfa012f0 100644 --- a/packages/@aws-cdk/aws-s3/test/test.aspect.ts +++ b/packages/@aws-cdk/aws-s3/test/test.aspect.ts @@ -45,7 +45,7 @@ class BucketVersioningChecker implements cdk.IAspect { if (node instanceof s3.CfnBucket) { if (!node.versioningConfiguration || (!cdk.Tokenization.isResolvable(node.versioningConfiguration) && node.versioningConfiguration.status !== 'Enabled')) { - node.node.addError('Bucket versioning is not enabled'); + cdk.Logging.of(node).addError('Bucket versioning is not enabled'); } } } diff --git a/packages/@aws-cdk/aws-ses-actions/lib/lambda.ts b/packages/@aws-cdk/aws-ses-actions/lib/lambda.ts index c345a3615d03a..e08b6d12e218b 100644 --- a/packages/@aws-cdk/aws-ses-actions/lib/lambda.ts +++ b/packages/@aws-cdk/aws-ses-actions/lib/lambda.ts @@ -71,7 +71,7 @@ export class Lambda implements ses.IReceiptRuleAction { rule.node.addDependency(permission); } else { // tslint:disable-next-line:max-line-length - rule.node.addWarning('This rule is using a Lambda action with an imported function. Ensure permission is given to SES to invoke that function.'); + cdk.Logging.of(rule).addWarning('This rule is using a Lambda action with an imported function. Ensure permission is given to SES to invoke that function.'); } return { diff --git a/packages/@aws-cdk/aws-ses-actions/lib/s3.ts b/packages/@aws-cdk/aws-ses-actions/lib/s3.ts index 24c8590511701..208076cc41281 100644 --- a/packages/@aws-cdk/aws-ses-actions/lib/s3.ts +++ b/packages/@aws-cdk/aws-ses-actions/lib/s3.ts @@ -65,7 +65,8 @@ export class S3 implements ses.IReceiptRuleAction { if (policy) { // The bucket could be imported rule.node.addDependency(policy); } else { - rule.node.addWarning('This rule is using a S3 action with an imported bucket. Ensure permission is given to SES to write to that bucket.'); + // tslint:disable-next-line: max-line-length + cdk.Logging.of(rule).addWarning('This rule is using a S3 action with an imported bucket. Ensure permission is given to SES to write to that bucket.'); } // Allow SES to use KMS master key diff --git a/packages/@aws-cdk/core/lib/app.ts b/packages/@aws-cdk/core/lib/app.ts index 0ad6bde3ef110..1546ab19ee53c 100644 --- a/packages/@aws-cdk/core/lib/app.ts +++ b/packages/@aws-cdk/core/lib/app.ts @@ -1,6 +1,4 @@ -import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import * as cxapi from '@aws-cdk/cx-api'; -import { Construct, ConstructScopeSettings } from 'constructs'; import { TreeMetadata } from './private/tree-metadata'; import { Stage } from './stage'; @@ -107,8 +105,6 @@ export class App extends Stage { this.node.setContext(cxapi.DISABLE_VERSION_REPORTING, true); } - applyLegacyConstructSettings(this); - const autoSynth = props.autoSynth !== undefined ? props.autoSynth : cxapi.OUTDIR_ENV in process.env; if (autoSynth) { // synth() guarantuees it will only execute once, so a default of 'true' @@ -138,18 +134,3 @@ export class App extends Stage { } } } - -/** - * Configures the construct scope to use legacy values for error/warning/info metadata keys - * as well as disable stack traces if needed. - */ -export function applyLegacyConstructSettings(scope: Construct) { - const settings = ConstructScopeSettings.of(scope); - if (scope.node.tryGetContext(cxapi.DISABLE_METADATA_STACK_TRACE) || process.env.CDK_DISABLE_STACK_TRACE) { - settings.disableStackTraces(); - } - - settings.errorMetadataKey = cxschema.ArtifactMetadataEntryType.ERROR; - settings.warningMetadataKey = cxschema.ArtifactMetadataEntryType.WARN; - settings.infoMetadataKey = cxschema.ArtifactMetadataEntryType.INFO; -} \ No newline at end of file diff --git a/packages/@aws-cdk/core/lib/context-provider.ts b/packages/@aws-cdk/core/lib/context-provider.ts index d0d13197405ba..017be096af68c 100644 --- a/packages/@aws-cdk/core/lib/context-provider.ts +++ b/packages/@aws-cdk/core/lib/context-provider.ts @@ -1,6 +1,7 @@ import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import * as cxapi from '@aws-cdk/cx-api'; import { Construct } from 'constructs'; +import { Logging } from './logging'; import { Stack } from './stack'; import { Token } from './token'; @@ -107,7 +108,7 @@ export class ContextProvider { }); if (providerError !== undefined) { - scope.node.addError(providerError); + Logging.of(scope).addError(providerError); } return { value: options.dummyValue }; } diff --git a/packages/@aws-cdk/core/lib/index.ts b/packages/@aws-cdk/core/lib/index.ts index ad378be2acb3f..94793819c395e 100644 --- a/packages/@aws-cdk/core/lib/index.ts +++ b/packages/@aws-cdk/core/lib/index.ts @@ -54,6 +54,8 @@ export * from './custom-resource'; export * from './nested-stack'; export * from './custom-resource-provider'; +export * from './logging'; + export * from './cfn-capabilities'; export * from './cloudformation.generated'; diff --git a/packages/@aws-cdk/core/lib/logging.ts b/packages/@aws-cdk/core/lib/logging.ts new file mode 100644 index 0000000000000..510fcd5295265 --- /dev/null +++ b/packages/@aws-cdk/core/lib/logging.ts @@ -0,0 +1,59 @@ +import * as cxschema from '@aws-cdk/cloud-assembly-schema'; +import * as cxapi from '@aws-cdk/cx-api'; +import { IConstruct } from 'constructs'; + +/** + * Logging methods for AWS CDK constructs. + */ +export class Logging { + /** + * Returns logging facilities associated with a construct. + * @param construct The construct + * + * @example + * + * Logging.of(c).addWarning('this is a warning'); + * + */ + public static of(construct: IConstruct): Logging { + return new Logging(construct); + } + + private constructor(private readonly construct: IConstruct) { } + + /** + * Adds a { "aws:cdk:warning": } metadata entry to this construct. + * The toolkit will display the warning when an app is synthesized, or fail if + * run in --strict mode. Stack trace will be included unless stack traces are + * disabled for this scope. + * @param message The warning message. + */ + public addWarning(message: string) { + this.addMessage(cxschema.ArtifactMetadataEntryType.WARN, message); + } + + /** + * Adds a { "aws:cdk:info": } metadata entry to this construct. + * The toolkit will display the info message when apps are synthesized. + * Stack trace will be included unless stack traces are disabled for this scope. + * @param message The info message. + */ + public addInfo(message: string) { + this.addMessage(cxschema.ArtifactMetadataEntryType.INFO, message); + } + + /** + * Adds an { "aws:cdk:error": } metadata entry to this construct. + * The toolkit will fail synthesis when errors are reported. + * Stack trace will be included unless stack traces are disabled for this scope. + * @param message The error message. + */ + public addError(message: string) { + this.addMessage(cxschema.ArtifactMetadataEntryType.ERROR, message); + } + + private addMessage(key: string, message: string) { + const stackTrace = this.construct.node.tryGetContext(cxapi.DISABLE_METADATA_STACK_TRACE) ? false : true; + this.construct.node.addMetadata(key, message, { stackTrace }); + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/core/lib/private/construct-settings.ts b/packages/@aws-cdk/core/lib/private/construct-settings.ts deleted file mode 100644 index 8ed7421f515fc..0000000000000 --- a/packages/@aws-cdk/core/lib/private/construct-settings.ts +++ /dev/null @@ -1,18 +0,0 @@ -import * as cxschema from '@aws-cdk/cloud-assembly-schema'; -import * as cxapi from '@aws-cdk/cx-api'; -import { Construct, ConstructScopeSettings } from 'constructs'; - -/** - * Configures the construct scope to use legacy values for error/warning/info metadata keys - * as well as disable stack traces if needed. - */ -export function applyLegacyConstructSettings(scope: Construct) { - const settings = ConstructScopeSettings.of(scope); - if (scope.node.tryGetContext(cxapi.DISABLE_METADATA_STACK_TRACE) || process.env.CDK_DISABLE_STACK_TRACE) { - settings.disableStackTraces(); - } - - settings.errorMetadataKey = cxschema.ArtifactMetadataEntryType.ERROR; - settings.warningMetadataKey = cxschema.ArtifactMetadataEntryType.WARN; - settings.infoMetadataKey = cxschema.ArtifactMetadataEntryType.INFO; -} \ No newline at end of file diff --git a/packages/@aws-cdk/core/lib/private/tree-metadata.ts b/packages/@aws-cdk/core/lib/private/tree-metadata.ts index 4ced2e5a6ae88..2413cf8c7bed7 100644 --- a/packages/@aws-cdk/core/lib/private/tree-metadata.ts +++ b/packages/@aws-cdk/core/lib/private/tree-metadata.ts @@ -3,6 +3,7 @@ import * as path from 'path'; import { ArtifactType } from '@aws-cdk/cloud-assembly-schema'; import { Construct, IConstruct } from 'constructs'; +import { Logging } from '../logging'; import { Stack } from '../stack'; import { ISynthesisSession } from '../stack-synthesizers'; import { IInspectable, TreeInspector } from '../tree'; @@ -33,7 +34,7 @@ export class TreeMetadata extends Construct { try { return visit(c); } catch (e) { - this.node.addWarning(`Failed to render tree metadata for node [${c.node.id}]. Reason: ${e}`); + Logging.of(this).addWarning(`Failed to render tree metadata for node [${c.node.id}]. Reason: ${e}`); return undefined; } }); diff --git a/packages/@aws-cdk/core/lib/stack.ts b/packages/@aws-cdk/core/lib/stack.ts index 2fecb1df9ab4e..4156651f6aa94 100644 --- a/packages/@aws-cdk/core/lib/stack.ts +++ b/packages/@aws-cdk/core/lib/stack.ts @@ -14,6 +14,7 @@ import { CfnResource, TagType } from './cfn-resource'; import { ContextProvider } from './context-provider'; import { addDependency } from './deps'; import { Environment } from './environment'; +import { Logging } from './logging'; import * as cfnlang from './private/cloudformation-lang'; import { LogicalIDs } from './private/logical-id'; import { resolve } from './private/resolve'; @@ -210,7 +211,7 @@ export class Stack extends Construct implements ITaggable { * value is an unresolved token (`Token.isUnresolved(stack.region)` returns * `true`), this implies that the user wishes that this stack will synthesize * into a **region-agnostic template**. In this case, your code should either - * fail (throw an error, emit a synth error using `node.addError`) or + * fail (throw an error, emit a synth error using `Logging.of(construct).addError()`) or * implement some other region-agnostic behavior. */ public readonly region: string; @@ -232,7 +233,7 @@ export class Stack extends Construct implements ITaggable { * value is an unresolved token (`Token.isUnresolved(stack.account)` returns * `true`), this implies that the user wishes that this stack will synthesize * into a **account-agnostic template**. In this case, your code should either - * fail (throw an error, emit a synth error using `node.addError`) or + * fail (throw an error, emit a synth error using `Logging.of(construct).addError()`) or * implement some other region-agnostic behavior. */ public readonly account: string; @@ -801,8 +802,7 @@ export class Stack extends Construct implements ITaggable { let transform: string | string[] | undefined; if (this.templateOptions.transform) { - // tslint:disable-next-line: max-line-length - this.node.addWarning('This stack is using the deprecated `templateOptions.transform` property. Consider switching to `addTransform()`.'); + Logging.of(this).addWarning('This stack is using the deprecated `templateOptions.transform` property. Consider switching to `addTransform()`.'); this.addTransform(this.templateOptions.transform); } diff --git a/packages/@aws-cdk/core/test/test.app.ts b/packages/@aws-cdk/core/test/test.app.ts index 5a7aa6152a00b..170670341da1c 100644 --- a/packages/@aws-cdk/core/test/test.app.ts +++ b/packages/@aws-cdk/core/test/test.app.ts @@ -2,7 +2,7 @@ import { ContextProvider } from '@aws-cdk/cloud-assembly-schema'; import * as cxapi from '@aws-cdk/cx-api'; import { Construct } from 'constructs'; import { Test } from 'nodeunit'; -import { CfnResource, Stack, StackProps } from '../lib'; +import { CfnResource, Logging, Stack, StackProps } from '../lib'; import { App, AppProps } from '../lib/app'; function withApp(props: AppProps, block: (app: App) => void): cxapi.CloudAssembly { @@ -29,8 +29,9 @@ function synth(context?: { [key: string]: any }): cxapi.CloudAssembly { // add some metadata stack1.node.addMetadata('meta', 111); - r2.node.addWarning('warning1'); - r2.node.addWarning('warning2'); + Logging.of(r2).addWarning('warning1'); + Logging.of(r2).addWarning('warning2'); + c1.node.addMetadata('meta', { key: 'value' }); app.node.addMetadata('applevel', 123); // apps can also have metadata }); diff --git a/packages/@aws-cdk/core/test/test.construct.ts b/packages/@aws-cdk/core/test/test.construct.ts index 418b2e844bf25..c1c71c9f078bc 100644 --- a/packages/@aws-cdk/core/test/test.construct.ts +++ b/packages/@aws-cdk/core/test/test.construct.ts @@ -1,7 +1,7 @@ import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import { Construct, ConstructOrder, IConstruct, IValidation } from 'constructs'; import { Test } from 'nodeunit'; -import { App as Root } from '../lib'; +import { App as Root, Logging } from '../lib'; import { validateTree } from '../lib/private/synthesis'; import { reEnableStackTraceCollection, restoreStackTraceColection } from './util'; @@ -274,7 +274,7 @@ export = { const previousValue = reEnableStackTraceCollection(); const root = new Root(); const con = new Construct(root, 'MyConstruct'); - con.node.addWarning('This construct is deprecated, use the other one instead'); + Logging.of(con).addWarning('This construct is deprecated, use the other one instead'); restoreStackTraceColection(previousValue); test.deepEqual(con.node.metadata[0].type, cxschema.ArtifactMetadataEntryType.WARN); @@ -287,7 +287,7 @@ export = { const previousValue = reEnableStackTraceCollection(); const root = new Root(); const con = new Construct(root, 'MyConstruct'); - con.node.addError('Stop!'); + Logging.of(con).addError('Stop!'); restoreStackTraceColection(previousValue); test.deepEqual(con.node.metadata[0].type, cxschema.ArtifactMetadataEntryType.ERROR); @@ -300,7 +300,7 @@ export = { const previousValue = reEnableStackTraceCollection(); const root = new Root(); const con = new Construct(root, 'MyConstruct'); - con.node.addInfo('Hey there, how do you do?'); + Logging.of(con).addInfo('Hey there, how do you do?'); restoreStackTraceColection(previousValue); test.deepEqual(con.node.metadata[0].type, cxschema.ArtifactMetadataEntryType.INFO); diff --git a/packages/@aws-cdk/pipelines/lib/pipeline.ts b/packages/@aws-cdk/pipelines/lib/pipeline.ts index 75fb655560c6b..080e9ddda6a73 100644 --- a/packages/@aws-cdk/pipelines/lib/pipeline.ts +++ b/packages/@aws-cdk/pipelines/lib/pipeline.ts @@ -1,5 +1,6 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; -import { App, CfnOutput, Construct, Stack, Stage } from '@aws-cdk/core'; +import { App, CfnOutput, Logging, Stack, Stage } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as path from 'path'; import { AssetType, DeployCdkStackAction, PublishAssetsAction, UpdatePipelineAction } from './actions'; import { appOf, assemblyBuilderOf } from './private/construct-internals'; @@ -200,7 +201,7 @@ export class CdkPipeline extends Construct { const depAction = stackActions.find(s => s.stackArtifactId === depId); if (depAction === undefined) { - this.node.addWarning(`Stack '${stackAction.stackName}' depends on stack ` + + Logging.of(this).addWarning(`Stack '${stackAction.stackName}' depends on stack ` + `'${depId}', but that dependency is not deployed through the pipeline!`); } else if (!(depAction.executeRunOrder < stackAction.prepareRunOrder)) { yield `Stack '${stackAction.stackName}' depends on stack ` + From 430f742aebf03057bde0f4ddb89277acfe827d3f Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Sun, 12 Jul 2020 14:56:22 +0000 Subject: [PATCH 27/39] 11 remaining --- packages/@aws-cdk/aws-batch/test/compute-environment.test.ts | 4 ++-- packages/@aws-cdk/aws-events-targets/test/batch/batch.test.ts | 2 +- .../lib/stepfunctions/invoke-activity.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/@aws-cdk/aws-batch/test/compute-environment.test.ts b/packages/@aws-cdk/aws-batch/test/compute-environment.test.ts index f09b30f0129fa..c3a0555ebcaed 100644 --- a/packages/@aws-cdk/aws-batch/test/compute-environment.test.ts +++ b/packages/@aws-cdk/aws-batch/test/compute-environment.test.ts @@ -237,10 +237,10 @@ describe('Batch Compute Evironment', () => { ], Subnets: [ { - Ref: `${vpc.node.uniqueId}PrivateSubnet1Subnet865FB50A`, + Ref: 'testvpcPrivateSubnet1Subnet865FB50A', }, { - Ref: `${vpc.node.uniqueId}PrivateSubnet2Subnet23D3396F`, + Ref: 'testvpcPrivateSubnet2Subnet23D3396F', }, ], Tags: { diff --git a/packages/@aws-cdk/aws-events-targets/test/batch/batch.test.ts b/packages/@aws-cdk/aws-events-targets/test/batch/batch.test.ts index 7d4ab3b3f685e..2ef65ed0156fc 100644 --- a/packages/@aws-cdk/aws-events-targets/test/batch/batch.test.ts +++ b/packages/@aws-cdk/aws-events-targets/test/batch/batch.test.ts @@ -48,7 +48,7 @@ test('use aws batch job as an eventrule target', () => { }, BatchParameters: { JobDefinition: { Ref: 'MyJob8719E923' }, - JobName: 'Rule', + JobName: 'StackRuleF6E31DD0', }, }, ], diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/stepfunctions/invoke-activity.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/stepfunctions/invoke-activity.ts index 829a35eb03658..0fb6007b8b7bc 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/stepfunctions/invoke-activity.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/stepfunctions/invoke-activity.ts @@ -1,6 +1,6 @@ import * as iam from '@aws-cdk/aws-iam'; import * as sfn from '@aws-cdk/aws-stepfunctions'; -import * as cdk from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Properties for invoking an Activity worker @@ -23,7 +23,7 @@ export class StepFunctionsInvokeActivity extends sfn.TaskStateBase { // No IAM permissions necessary, execution role implicitly has Activity permissions. protected readonly taskPolicies?: iam.PolicyStatement[]; - constructor(scope: cdk.Construct, id: string, private readonly props: StepFunctionsInvokeActivityProps) { + constructor(scope: Construct, id: string, private readonly props: StepFunctionsInvokeActivityProps) { super(scope, id, props); this.taskMetrics = { From dda57ae2ec651c432d973a85164476346e59bc99 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Mon, 13 Jul 2020 12:40:25 +0000 Subject: [PATCH 28/39] additional test fixes --- .../@aws-cdk/aws-ecs-patterns/test/ec2/test.l3s-v2.ts | 10 +++++----- .../test/ec2/test.queue-processing-ecs-service.ts | 4 ++-- .../fargate/test.load-balanced-fargate-service-v2.ts | 8 ++++---- .../fargate/test.queue-processing-fargate-service.ts | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.l3s-v2.ts b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.l3s-v2.ts index 745bad2c660fc..31e4c8f247543 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.l3s-v2.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.l3s-v2.ts @@ -222,7 +222,7 @@ export = { 'Arn', ], }, - Family: 'ServiceTaskDef79D79521', + Family: 'StackServiceTaskDef733E80F6', NetworkMode: 'bridge', RequiresCompatibilities: [ 'EC2', @@ -299,7 +299,7 @@ export = { ], }, ], - Family: 'Ec2TaskDef', + Family: 'StackEc2TaskDefF03698CF', NetworkMode: 'bridge', RequiresCompatibilities: [ 'EC2', @@ -916,7 +916,7 @@ export = { 'Arn', ], }, - Family: 'ServiceTaskDef79D79521', + Family: 'StackServiceTaskDef733E80F6', NetworkMode: 'bridge', RequiresCompatibilities: [ 'EC2', @@ -1087,7 +1087,7 @@ export = { 'Arn', ], }, - Family: 'ServiceTaskDef79D79521', + Family: 'StackServiceTaskDef733E80F6', NetworkMode: 'bridge', RequiresCompatibilities: [ 'EC2', @@ -1164,7 +1164,7 @@ export = { ], }, ], - Family: 'Ec2TaskDef', + Family: 'StackEc2TaskDefF03698CF', NetworkMode: 'bridge', RequiresCompatibilities: [ 'EC2', diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.queue-processing-ecs-service.ts b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.queue-processing-ecs-service.ts index 4bfa0732591cb..c0799197cff20 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.queue-processing-ecs-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.queue-processing-ecs-service.ts @@ -74,7 +74,7 @@ export = { Memory: 512, }, ], - Family: 'ServiceQueueProcessingTaskDef83DB34F1', + Family: 'StackServiceQueueProcessingTaskDef0CCF68C6', })); test.done(); @@ -149,7 +149,7 @@ export = { Memory: 512, }, ], - Family: 'ServiceQueueProcessingTaskDef83DB34F1', + Family: 'StackServiceQueueProcessingTaskDef0CCF68C6', })); test.done(); diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.load-balanced-fargate-service-v2.ts b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.load-balanced-fargate-service-v2.ts index becc38e6a9fd1..13511b0f2bc79 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.load-balanced-fargate-service-v2.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.load-balanced-fargate-service-v2.ts @@ -71,7 +71,7 @@ export = { 'Arn', ], }, - Family: 'ServiceTaskDef79D79521', + Family: 'StackServiceTaskDef733E80F6', Memory: '512', NetworkMode: 'awsvpc', RequiresCompatibilities: [ @@ -370,7 +370,7 @@ export = { 'Arn', ], }, - Family: 'ServiceTaskDef79D79521', + Family: 'StackServiceTaskDef733E80F6', Memory: '512', NetworkMode: 'awsvpc', RequiresCompatibilities: [ @@ -402,7 +402,7 @@ export = { logDriver: new ecs.AwsLogDriver({ streamPrefix: 'TestStream', }), - family: 'Ec2TaskDef', + family: 'StackServiceTaskDef733E80F6', executionRole: new Role(stack, 'ExecutionRole', { path: '/', assumedBy: new CompositePrincipal( @@ -526,7 +526,7 @@ export = { 'Arn', ], }, - Family: 'Ec2TaskDef', + Family: 'StackServiceTaskDef733E80F6', Memory: '512', NetworkMode: 'awsvpc', RequiresCompatibilities: [ diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.queue-processing-fargate-service.ts b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.queue-processing-fargate-service.ts index 4f0f434ef1f72..2ffb95f2863bd 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.queue-processing-fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.queue-processing-fargate-service.ts @@ -96,7 +96,7 @@ export = { Image: 'test', }, ], - Family: 'ServiceQueueProcessingTaskDef83DB34F1', + Family: 'StackServiceQueueProcessingTaskDef0CCF68C6', })); test.done(); @@ -193,7 +193,7 @@ export = { Image: 'test', }, ], - Family: 'ServiceQueueProcessingTaskDef83DB34F1', + Family: 'StackServiceQueueProcessingTaskDef0CCF68C6', })); test.done(); From 72dd1847fbf7efcdfe773a04fb9c8c417c2735c7 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Mon, 13 Jul 2020 13:01:20 +0000 Subject: [PATCH 29/39] full build+test pass 1st time --- packages/@aws-cdk/aws-amplify/lib/domain.ts | 7 ++++- .../@aws-cdk/aws-apigateway/lib/restapi.ts | 4 ++- .../@aws-cdk/aws-apigateway/lib/vpc-link.ts | 4 ++- packages/@aws-cdk/aws-backup/lib/plan.ts | 4 ++- .../@aws-cdk/aws-backup/test/vault.test.ts | 2 +- .../lib/dns-validated-certificate.ts | 3 +- .../@aws-cdk/aws-codebuild/lib/project.ts | 7 ++--- .../@aws-cdk/aws-codepipeline/lib/pipeline.ts | 6 ++-- .../@aws-cdk/aws-codepipeline/lib/stage.ts | 2 +- .../aws-codepipeline/test/test.artifacts.ts | 12 +++----- .../test/test.general-validation.ts | 2 +- packages/@aws-cdk/aws-dynamodb/lib/table.ts | 4 ++- .../aws-ecs/lib/base/task-definition.ts | 8 +++-- .../@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts | 8 +++-- .../lib/alb/application-listener-rule.ts | 4 ++- .../lib/alb/application-listener.ts | 4 +-- .../lib/alb/application-target-group.ts | 4 +-- .../lib/nlb/network-target-group.ts | 4 +-- .../lib/shared/base-listener.ts | 4 ++- .../lib/shared/base-target-group.ts | 4 ++- .../test/alb/test.listener.ts | 2 +- .../test/nlb/test.listener.ts | 8 ++--- packages/@aws-cdk/aws-events/lib/rule.ts | 6 ++-- .../aws-events/test/test.event-bus.ts | 2 +- .../@aws-cdk/aws-iam/lib/managed-policy.ts | 4 ++- packages/@aws-cdk/aws-iam/lib/policy.ts | 4 ++- .../aws-stepfunctions/lib/states/map.ts | 4 ++- .../aws-stepfunctions/lib/states/parallel.ts | 4 ++- .../@aws-cdk/core/lib/private/synthesis.ts | 15 ++++++++-- packages/@aws-cdk/core/test/test.app.ts | 6 ++-- packages/@aws-cdk/core/test/test.construct.ts | 30 +++++++++---------- .../lib/actions/deploy-cdk-stack-action.ts | 3 +- .../lib/actions/publish-assets-action.ts | 3 +- .../lib/actions/update-pipeline-action.ts | 2 +- packages/@aws-cdk/pipelines/lib/pipeline.ts | 15 ++++------ .../lib/private/construct-internals.ts | 3 +- packages/@aws-cdk/pipelines/lib/stage.ts | 3 +- .../lib/synths/simple-synth-action.ts | 2 +- .../pipelines/lib/validation/_files.ts | 2 +- .../lib/validation/shell-script-action.ts | 2 +- packages/@aws-cdk/pipelines/package.json | 4 +-- .../test/cross-environment-infra.test.ts | 3 +- .../@aws-cdk/pipelines/test/integ.pipeline.ts | 3 +- .../pipelines/test/pipeline-assets.test.ts | 3 +- .../@aws-cdk/pipelines/test/pipeline.test.ts | 3 +- .../pipelines/test/stack-ordering.test.ts | 3 +- packages/@aws-cdk/pipelines/test/testutil.ts | 3 +- .../pipelines/test/validation.test.ts | 3 +- 48 files changed, 146 insertions(+), 96 deletions(-) diff --git a/packages/@aws-cdk/aws-amplify/lib/domain.ts b/packages/@aws-cdk/aws-amplify/lib/domain.ts index 9a073881312f8..ac29f028f1123 100644 --- a/packages/@aws-cdk/aws-amplify/lib/domain.ts +++ b/packages/@aws-cdk/aws-amplify/lib/domain.ts @@ -92,6 +92,8 @@ export class Domain extends Resource { this.domainName = domain.attrDomainName; this.domainStatus = domain.attrDomainStatus; this.statusReason = domain.attrStatusReason; + + this.node.addValidation({ validate: () => this.validateDomain() }); } /** @@ -112,7 +114,10 @@ export class Domain extends Resource { return this.mapSubDomain(branch, ''); } - protected validate() { + /** + * IValidation implementation. + */ + private validateDomain() { if (this.subDomains.length === 0) { return ['The domain doesn\'t contain any subdomains']; } diff --git a/packages/@aws-cdk/aws-apigateway/lib/restapi.ts b/packages/@aws-cdk/aws-apigateway/lib/restapi.ts index c4f4ff108092e..4de5db061b084 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/restapi.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/restapi.ts @@ -582,6 +582,8 @@ export class RestApi extends RestApiBase { this.root = new RootResource(this, props, resource.attrRootResourceId); this.restApiRootResourceId = resource.attrRootResourceId; + + this.node.addValidation({ validate: () => this.validateApi() }); } /** @@ -638,7 +640,7 @@ export class RestApi extends RestApiBase { /** * Performs validation of the REST API. */ - protected validate() { + private validateApi() { 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 db2fee5030f3f..71f90539ff613 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/vpc-link.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/vpc-link.ts @@ -80,13 +80,15 @@ export class VpcLink extends Resource implements IVpcLink { if (props.targets) { this.addTargets(...props.targets); } + + this.node.addValidation({ validate: () => this.validateLink() }); } public addTargets(...targets: elbv2.INetworkLoadBalancer[]) { this.targets.push(...targets); } - protected validate(): string[] { + private validateLink(): string[] { if (this.targets.length === 0) { return [ 'No targets added to vpc link' ]; } diff --git a/packages/@aws-cdk/aws-backup/lib/plan.ts b/packages/@aws-cdk/aws-backup/lib/plan.ts index 3476b56817dc1..f3e4837440cc2 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/test/vault.test.ts b/packages/@aws-cdk/aws-backup/test/vault.test.ts index dd1800c5b831e..1ff956b255567 100644 --- a/packages/@aws-cdk/aws-backup/test/vault.test.ts +++ b/packages/@aws-cdk/aws-backup/test/vault.test.ts @@ -16,7 +16,7 @@ test('create a vault', () => { // THEN expect(stack).toHaveResource('AWS::Backup::BackupVault', { - BackupVaultName: 'Vault', + BackupVaultName: 'StackVault02F737C4', }); }); 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 2c03e138aed13..f0ee74ea8bd1b 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,10 @@ export class DnsValidatedCertificate extends cdk.Resource implements ICertificat }); this.certificateArn = certificate.getAtt('Arn').toString(); + this.node.addValidation({ validate: () => this.validateCert() }); } - protected validate(): string[] { + private validateCert(): 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-codebuild/lib/project.ts b/packages/@aws-cdk/aws-codebuild/lib/project.ts index 0a0a815dac45c..96702ffe84fff 100644 --- a/packages/@aws-cdk/aws-codebuild/lib/project.ts +++ b/packages/@aws-cdk/aws-codebuild/lib/project.ts @@ -797,6 +797,8 @@ export class Project extends ProjectBase { if (props.encryptionKey) { this.encryptionKey = props.encryptionKey; } + + this.node.addValidation({ validate: () => this.validateProject() }); } /** @@ -864,10 +866,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) { diff --git a/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts b/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts index fde41cf320dd8..8cd60fe26b454 100644 --- a/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts +++ b/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts @@ -286,6 +286,8 @@ export class Pipeline extends PipelineBase { for (const stage of props.stages || []) { this.addStage(stage); } + + this.node.addValidation({ validate: () => this.validatePipeline() }); } /** @@ -384,7 +386,7 @@ export class Pipeline extends PipelineBase { * 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(), @@ -742,7 +744,7 @@ export class Pipeline extends PipelineBase { private validateStages(): string[] { const ret = new Array(); for (const stage of this._stages) { - ret.push(...stage.validate()); + ret.push(...stage.validateStage()); } return ret; } diff --git a/packages/@aws-cdk/aws-codepipeline/lib/stage.ts b/packages/@aws-cdk/aws-codepipeline/lib/stage.ts index 38edcf69078b2..ec7ddf1f3ea35 100644 --- a/packages/@aws-cdk/aws-codepipeline/lib/stage.ts +++ b/packages/@aws-cdk/aws-codepipeline/lib/stage.ts @@ -106,7 +106,7 @@ export class Stage implements IStage { return rule; } - public validate(): string[] { + public validateStage(): string[] { return [ ...this.validateHasActions(), ...this.validateActions(), diff --git a/packages/@aws-cdk/aws-codepipeline/test/test.artifacts.ts b/packages/@aws-cdk/aws-codepipeline/test/test.artifacts.ts index 31d1dbe2f7f66..3a4833aa2994d 100644 --- a/packages/@aws-cdk/aws-codepipeline/test/test.artifacts.ts +++ b/packages/@aws-cdk/aws-codepipeline/test/test.artifacts.ts @@ -46,8 +46,7 @@ export = { 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(); }, @@ -82,8 +81,7 @@ export = { 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(); }, @@ -119,8 +117,7 @@ export = { 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(); }, @@ -221,8 +218,7 @@ export = { 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(); }, diff --git a/packages/@aws-cdk/aws-codepipeline/test/test.general-validation.ts b/packages/@aws-cdk/aws-codepipeline/test/test.general-validation.ts index f85fa8eeaeb51..c41acbf114f85 100644 --- a/packages/@aws-cdk/aws-codepipeline/test/test.general-validation.ts +++ b/packages/@aws-cdk/aws-codepipeline/test/test.general-validation.ts @@ -38,7 +38,7 @@ export = { 'should fail if Stage has no Actions'(test: Test) { const stage = stageForTesting(); - test.deepEqual((stage as any).validate().length, 1); + test.deepEqual((stage as any).validateStage().length, 1); test.done(); }, diff --git a/packages/@aws-cdk/aws-dynamodb/lib/table.ts b/packages/@aws-cdk/aws-dynamodb/lib/table.ts index 3d351d7570f3d..446fa1f9bba38 100644 --- a/packages/@aws-cdk/aws-dynamodb/lib/table.ts +++ b/packages/@aws-cdk/aws-dynamodb/lib/table.ts @@ -938,6 +938,8 @@ export class Table extends TableBase { if (props.replicationRegions && props.replicationRegions.length > 0) { this.createReplicaTables(props.replicationRegions); } + + this.node.addValidation({ validate: () => this.validateTable() }); } /** @@ -1093,7 +1095,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) { 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 f9fc04c555eee..3ecfdeeaffbba 100644 --- a/packages/@aws-cdk/aws-ecs/lib/base/task-definition.ts +++ b/packages/@aws-cdk/aws-ecs/lib/base/task-definition.ts @@ -1,7 +1,7 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import { IResource, Lazy, Resource } from '@aws-cdk/core'; -import { Construct, IValidation } from 'constructs'; +import { Construct } from 'constructs'; import { ContainerDefinition, ContainerDefinitionOptions, PortMapping, Protocol } from '../container-definition'; import { CfnTaskDefinition } from '../ecs.generated'; import { FirelensLogRouter, FirelensLogRouterDefinitionOptions, FirelensLogRouterType, obtainDefaultFluentBitECRImage } from '../firelens-log-router'; @@ -191,7 +191,7 @@ abstract class TaskDefinitionBase extends Resource implements ITaskDefinition { /** * The base class for all task definitions. */ -export class TaskDefinition extends TaskDefinitionBase implements IValidation { +export class TaskDefinition extends TaskDefinitionBase { /** * Imports a task definition from the specified task definition ARN. @@ -322,6 +322,8 @@ export class TaskDefinition extends TaskDefinitionBase implements IValidation { } this.taskDefinitionArn = taskDef.ref; + + this.node.addValidation({ validate: () => this.validateTaskDefinition() }); } public get executionRole(): iam.IRole | undefined { @@ -452,7 +454,7 @@ export class TaskDefinition extends TaskDefinitionBase implements IValidation { /** * Validates the task definition. */ - public validate(): string[] { + private validateTaskDefinition(): string[] { const ret = new Array(); if (isEc2Compatible(this.compatibility)) { 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 1deec680ecd1f..118881186f3d3 100644 --- a/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts +++ b/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts @@ -1,6 +1,6 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import { Lazy, Resource, Stack } from '@aws-cdk/core'; -import { Construct, IValidation } from 'constructs'; +import { Construct } from 'constructs'; import { BaseService, BaseServiceOptions, DeploymentControllerType, IBaseService, IService, LaunchType, PropagatedTagSource } from '../base/base-service'; import { fromServiceAtrributes } from '../base/from-service-attributes'; import { NetworkMode, TaskDefinition } from '../base/task-definition'; @@ -129,7 +129,7 @@ export interface Ec2ServiceAttributes { * * @resource AWS::ECS::Service */ -export class Ec2Service extends BaseService implements IEc2Service, IValidation { +export class Ec2Service extends BaseService implements IEc2Service { /** * Imports from the specified service ARN. @@ -234,6 +234,8 @@ export class Ec2Service extends BaseService implements IEc2Service, IValidation if (!this.taskDefinition.defaultContainer) { throw new Error('A TaskDefinition must have at least one essential container'); } + + this.node.addValidation({ validate: () => this.validateService() }); } /** @@ -263,7 +265,7 @@ export class Ec2Service extends BaseService implements IEc2Service, IValidation /** * Validates this Ec2Service. */ - public validate(): string[] { + private validateService(): 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-elasticloadbalancingv2/lib/alb/application-listener-rule.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener-rule.ts index 6f4159cb4308f..424a7325c0500 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 @@ -260,6 +260,8 @@ export class ApplicationListenerRule extends Construct { } this.listenerRuleArn = resource.ref; + + this.node.addValidation({ validate: () => this.validateRule() }); } /** @@ -350,7 +352,7 @@ export class ApplicationListenerRule extends Construct { /** * Validate the rule */ - protected validate() { + private validateRule() { 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 dc217eb15d932..cd40a0d6f7819 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener.ts @@ -417,8 +417,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 077090780b996..bf2a663a0d99e 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 @@ -311,8 +311,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-target-group.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-target-group.ts index 207fe911cc0b8..8a0411c34f578 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 @@ -114,8 +114,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 c10625b7515b2..0507af6b7c47c 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/base-listener.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/base-listener.ts @@ -23,12 +23,14 @@ 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 0160a3fbf47a0..762b87d6cd031 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 @@ -267,6 +267,8 @@ export abstract class TargetGroupBase extends Construct implements ITargetGroup this.loadBalancerArns = this.resource.attrLoadBalancerArns.toString(); this.targetGroupName = this.resource.attrTargetGroupName; this.defaultPort = additionalProps.port; + + this.node.addValidation({ validate: () => this.validateTargetGroup() }); } /** @@ -310,7 +312,7 @@ export abstract class TargetGroupBase extends Construct implements ITargetGroup } } - protected validate(): string[] { + protected validateTargetGroup(): string[] { const ret = []; if (this.targetType === undefined && this.targetsJson.length === 0) { diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/test.listener.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/test.listener.ts index 9ec59bde834e7..0d3e67c77ce16 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/test.listener.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/test.listener.ts @@ -426,7 +426,7 @@ export = { }); // THEN - const validationErrors: string[] = (group as any).validate(); + const validationErrors: string[] = group.node.validate(); test.deepEqual(validationErrors, ["Health check protocol 'TCP' is not supported. Must be one of [HTTP, HTTPS]"]); test.done(); diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/nlb/test.listener.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/nlb/test.listener.ts index d9f518bf25829..478c30f7e9580 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/nlb/test.listener.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/nlb/test.listener.ts @@ -200,7 +200,7 @@ export = { }, }); - 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)); test.notEqual(intervalError, undefined, 'Failed to return health check interval validation error'); @@ -225,7 +225,7 @@ export = { }); // THEN - const validationErrors: string[] = (targetGroup as any).validate(); + const validationErrors: string[] = targetGroup.node.validate(); test.deepEqual(validationErrors, ["Health check protocol 'UDP' is not supported. Must be one of [HTTP, HTTPS, TCP]"]); test.done(); @@ -250,7 +250,7 @@ export = { }); // THEN - const validationErrors: string[] = (targetGroup as any).validate(); + const validationErrors: string[] = targetGroup.node.validate(); test.deepEqual(validationErrors, [ "'TCP' health checks do not support the path property. Must be one of [HTTP, HTTPS]", ]); @@ -277,7 +277,7 @@ export = { }); // THEN - const validationErrors: string[] = (targetGroup as any).validate(); + const validationErrors: string[] = targetGroup.node.validate(); test.deepEqual(validationErrors, [ '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-events/lib/rule.ts b/packages/@aws-cdk/aws-events/lib/rule.ts index a938f1f6fb66d..bedd2097bd6c2 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() }); } /** @@ -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 []; } } @@ -370,7 +372,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/test/test.event-bus.ts b/packages/@aws-cdk/aws-events/test/test.event-bus.ts index ef5b08c1c429e..f68b2b3551386 100644 --- a/packages/@aws-cdk/aws-events/test/test.event-bus.ts +++ b/packages/@aws-cdk/aws-events/test/test.event-bus.ts @@ -14,7 +14,7 @@ export = { // THEN expect(stack).to(haveResource('AWS::Events::EventBus', { - Name: 'stackBus7803A768', + Name: 'StackBusAA0A1E4B', })); test.done(); diff --git a/packages/@aws-cdk/aws-iam/lib/managed-policy.ts b/packages/@aws-cdk/aws-iam/lib/managed-policy.ts index 5a48177ff3401..837da7570895c 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.validatePolicy() }); } /** @@ -287,7 +289,7 @@ export class ManagedPolicy extends Resource implements IManagedPolicy { this.groups.push(group); } - 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/policy.ts b/packages/@aws-cdk/aws-iam/lib/policy.ts index 4fcdf2b062934..91c4f0f541f5c 100644 --- a/packages/@aws-cdk/aws-iam/lib/policy.ts +++ b/packages/@aws-cdk/aws-iam/lib/policy.ts @@ -170,6 +170,8 @@ export class Policy extends Resource implements IPolicy { if (props.statements) { props.statements.forEach(p => this.addStatements(p)); } + + this.node.addValidation({ validate: () => this.validatePolicy() }); } /** @@ -216,7 +218,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-stepfunctions/lib/states/map.ts b/packages/@aws-cdk/aws-stepfunctions/lib/states/map.ts index 1f2763e3f99f7..3f841deb9509d 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/states/map.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/states/map.ts @@ -105,6 +105,8 @@ export class Map extends State implements INextable { this.endStates = [this]; this.maxConcurrency = props.maxConcurrency; this.itemsPath = props.itemsPath; + + this.node.addValidation({ validate: () => this.validateMap() }); } /** @@ -166,7 +168,7 @@ export class Map extends State implements INextable { /** * Validate this state */ - protected validate(): string[] { + private validateMap(): 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..05bb37724e6c4 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/states/parallel.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/states/parallel.ts @@ -62,6 +62,8 @@ export class Parallel extends State implements INextable { super(scope, id, props); this.endStates = [this]; + + this.node.addValidation({ validate: () => this.validateParallel() }); } /** @@ -123,7 +125,7 @@ export class Parallel extends State implements INextable { /** * Validate this state */ - protected validate(): string[] { + private validateParallel(): string[] { if (this.branches.length === 0) { return ['Parallel must have at least one branch']; } diff --git a/packages/@aws-cdk/core/lib/private/synthesis.ts b/packages/@aws-cdk/core/lib/private/synthesis.ts index 4e844c44695f6..98b41c9ad0afa 100644 --- a/packages/@aws-cdk/core/lib/private/synthesis.ts +++ b/packages/@aws-cdk/core/lib/private/synthesis.ts @@ -1,5 +1,5 @@ import * as cxapi from '@aws-cdk/cx-api'; -import { IConstruct, ValidationError } from 'constructs'; +import { IConstruct } from 'constructs'; import { Aspects, IAspect } from '../aspect'; import { Stack } from '../stack'; import { Stage, StageSynthesisOptions } from '../stage'; @@ -118,7 +118,7 @@ function synthesizeTree(root: IConstruct, builder: cxapi.CloudAssemblyBuilder) { export function validateTree(root: IConstruct) { const errors = new Array(); - visit(root, 'pre', construct => errors.push(...construct.node.validate())); + visit(root, 'pre', source => errors.push(...source.node.validate().map(message => ({ source, message })))); if (errors.length > 0) { const errorList = errors.map(e => `[${e.source.node.path}] ${e.message}`).join('\n '); @@ -143,3 +143,14 @@ function visit(root: IConstruct, order: 'pre' | 'post', cb: (x: IConstruct) => v cb(root); } } + +interface ValidationError { + /** + * The construct which emitted the error. + */ + readonly source: IConstruct; + /** + * The error message. + */ + readonly message: string; +} diff --git a/packages/@aws-cdk/core/test/test.app.ts b/packages/@aws-cdk/core/test/test.app.ts index 170670341da1c..eb656dd87eb35 100644 --- a/packages/@aws-cdk/core/test/test.app.ts +++ b/packages/@aws-cdk/core/test/test.app.ts @@ -165,8 +165,10 @@ export = { '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/test.construct.ts b/packages/@aws-cdk/core/test/test.construct.ts index c1c71c9f078bc..1799bec3c3b0c 100644 --- a/packages/@aws-cdk/core/test/test.construct.ts +++ b/packages/@aws-cdk/core/test/test.construct.ts @@ -1,5 +1,5 @@ import * as cxschema from '@aws-cdk/cloud-assembly-schema'; -import { Construct, ConstructOrder, IConstruct, IValidation } from 'constructs'; +import { Construct, ConstructOrder, IConstruct } from 'constructs'; import { Test } from 'nodeunit'; import { App as Root, Logging } from '../lib'; import { validateTree } from '../lib/private/synthesis'; @@ -322,40 +322,40 @@ export = { // tslint:disable-next-line:max-line-length '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 implements IValidation { - public validate() { - return [ 'my-error1', 'my-error2' ]; + class MyConstruct extends Construct { + constructor(scope: Construct, id: string) { + super(scope, id); + + this.node.addValidation({ validate: () => [ 'my-error1', 'my-error2' ] }); } } - class YourConstruct extends Construct implements IValidation { - public validate() { - return [ 'your-error1' ]; + class YourConstruct extends Construct { + constructor(scope: Construct, id: string) { + super(scope, id); + + this.node.addValidation({ validate: () => [ 'your-error1' ] }); } } - class TheirConstruct extends Construct implements IValidation { + class TheirConstruct extends Construct { constructor(scope: Construct, id: string) { super(scope, id); new YourConstruct(this, 'YourConstruct'); - } - public validate() { - return [ 'their-error' ]; + this.node.addValidation({ validate: () => [ 'their-error' ]} ); } } - class TestStack extends Root implements IValidation { + class TestStack extends Root { constructor() { super(); new MyConstruct(this, 'MyConstruct'); new TheirConstruct(this, 'TheirConstruct'); - } - public validate() { - return [ 'stack-error' ]; + this.node.addValidation({ validate: () => [ 'stack-error' ] }); } } 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 7517a02f35891..87fb09b42debf 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 @@ -3,8 +3,9 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as cpactions from '@aws-cdk/aws-codepipeline-actions'; import * as events from '@aws-cdk/aws-events'; import * as iam from '@aws-cdk/aws-iam'; -import { Arn, Construct, Fn, Stack } from '@aws-cdk/core'; +import { Arn, Fn, Stack } from '@aws-cdk/core'; import * as cxapi from '@aws-cdk/cx-api'; +import { Construct } from 'constructs'; import * as path from 'path'; import { appOf, assemblyBuilderOf } from '../private/construct-internals'; 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 668d8f831b548..bd3ab3c2fa5d7 100644 --- a/packages/@aws-cdk/pipelines/lib/actions/publish-assets-action.ts +++ b/packages/@aws-cdk/pipelines/lib/actions/publish-assets-action.ts @@ -3,7 +3,8 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as codepipeline_actions from '@aws-cdk/aws-codepipeline-actions'; import * as events from '@aws-cdk/aws-events'; import * as iam from '@aws-cdk/aws-iam'; -import { Construct, Lazy } from '@aws-cdk/core'; +import { Lazy } from '@aws-cdk/core'; +import { Construct } from 'constructs'; /** * Type of the asset that is being published 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 e7b19ac860102..61665660ce835 100644 --- a/packages/@aws-cdk/pipelines/lib/actions/update-pipeline-action.ts +++ b/packages/@aws-cdk/pipelines/lib/actions/update-pipeline-action.ts @@ -3,7 +3,7 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as cpactions from '@aws-cdk/aws-codepipeline-actions'; import * as events from '@aws-cdk/aws-events'; import * as iam from '@aws-cdk/aws-iam'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { embeddedAsmPath } from '../private/construct-internals'; /** diff --git a/packages/@aws-cdk/pipelines/lib/pipeline.ts b/packages/@aws-cdk/pipelines/lib/pipeline.ts index 080e9ddda6a73..7fe245c32b80e 100644 --- a/packages/@aws-cdk/pipelines/lib/pipeline.ts +++ b/packages/@aws-cdk/pipelines/lib/pipeline.ts @@ -1,5 +1,5 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; -import { App, CfnOutput, Logging, Stack, Stage } from '@aws-cdk/core'; +import { App, Aspects, CfnOutput, Logging, Stack, Stage } from '@aws-cdk/core'; import { Construct } from 'constructs'; import * as path from 'path'; import { AssetType, DeployCdkStackAction, PublishAssetsAction, UpdatePipelineAction } from './actions'; @@ -102,6 +102,9 @@ export class CdkPipeline extends Construct { pipeline: this._pipeline, projectName: maybeSuffix(props.pipelineName, '-publish'), }); + + this.node.addValidation({ validate: () => this.validatePipeline() }); + Aspects.of(this).apply({ visit: () => this._assets.removeAssetsStageIfEmpty() }); } /** @@ -169,7 +172,7 @@ export class CdkPipeline extends Construct { * 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()); @@ -178,14 +181,6 @@ export class CdkPipeline extends Construct { return ret; } - protected onPrepare() { - super.onPrepare(); - - // TODO: Support this in a proper way in the upstream library. For now, we - // "un-add" the Assets stage if it turns out to be empty. - this._assets.removeAssetsStageIfEmpty(); - } - /** * Return all StackDeployActions in an ordered list */ diff --git a/packages/@aws-cdk/pipelines/lib/private/construct-internals.ts b/packages/@aws-cdk/pipelines/lib/private/construct-internals.ts index 13b1ac7c1dd0c..34ad7dd656569 100644 --- a/packages/@aws-cdk/pipelines/lib/private/construct-internals.ts +++ b/packages/@aws-cdk/pipelines/lib/private/construct-internals.ts @@ -1,8 +1,9 @@ /** * Get access to construct internals that we need but got removed from the Stages PR. */ -import { App, IConstruct, Stage } from '@aws-cdk/core'; +import { App, Stage } from '@aws-cdk/core'; import * as cxapi from '@aws-cdk/cx-api'; +import { IConstruct } from 'constructs'; import * as path from 'path'; export function appOf(construct: IConstruct): App { diff --git a/packages/@aws-cdk/pipelines/lib/stage.ts b/packages/@aws-cdk/pipelines/lib/stage.ts index 2441da072cede..98ec3fe50182b 100644 --- a/packages/@aws-cdk/pipelines/lib/stage.ts +++ b/packages/@aws-cdk/pipelines/lib/stage.ts @@ -1,7 +1,8 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as cpactions from '@aws-cdk/aws-codepipeline-actions'; -import { Construct, Stage } from '@aws-cdk/core'; +import { Stage } from '@aws-cdk/core'; import * as cxapi from '@aws-cdk/cx-api'; +import { Construct } from 'constructs'; import { AssetType, DeployCdkStackAction } from './actions'; import { AssetManifestReader, DockerImageManifestEntry, FileManifestEntry } from './private/asset-manifest'; import { topologicalSort } from './private/toposort'; 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 bebbed0f9f44d..bbf2a5e6de213 100644 --- a/packages/@aws-cdk/pipelines/lib/synths/simple-synth-action.ts +++ b/packages/@aws-cdk/pipelines/lib/synths/simple-synth-action.ts @@ -2,7 +2,7 @@ import * as codebuild from '@aws-cdk/aws-codebuild'; import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as codepipeline_actions from '@aws-cdk/aws-codepipeline-actions'; import * as events from '@aws-cdk/aws-events'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as path from 'path'; import { cloudAssemblyBuildSpecDir } from '../private/construct-internals'; import { copyEnvironmentVariables, filterEmpty } from './_util'; 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 301e641cb15fa..b507c59480e04 100644 --- a/packages/@aws-cdk/pipelines/lib/validation/shell-script-action.ts +++ b/packages/@aws-cdk/pipelines/lib/validation/shell-script-action.ts @@ -2,7 +2,7 @@ import * as codebuild from '@aws-cdk/aws-codebuild'; import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as codepipeline_actions from '@aws-cdk/aws-codepipeline-actions'; import * as events from '@aws-cdk/aws-events'; -import { Construct } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { StackOutput } from '../stage'; /** diff --git a/packages/@aws-cdk/pipelines/package.json b/packages/@aws-cdk/pipelines/package.json index b6a5f4a51acfa..b623b86786112 100644 --- a/packages/@aws-cdk/pipelines/package.json +++ b/packages/@aws-cdk/pipelines/package.json @@ -40,7 +40,7 @@ "@aws-cdk/aws-ecr-assets": "0.0.0" }, "peerDependencies": { - "constructs": "^3.0.2", + "constructs": "4.1.1-pre.1", "@aws-cdk/core": "0.0.0", "@aws-cdk/aws-codebuild": "0.0.0", "@aws-cdk/aws-codepipeline": "0.0.0", @@ -53,7 +53,7 @@ "@aws-cdk/aws-cloudformation": "0.0.0" }, "dependencies": { - "constructs": "^3.0.2", + "constructs": "4.1.1-pre.1", "@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/pipelines/test/cross-environment-infra.test.ts b/packages/@aws-cdk/pipelines/test/cross-environment-infra.test.ts index b891574d6e3a6..79f8f70677467 100644 --- a/packages/@aws-cdk/pipelines/test/cross-environment-infra.test.ts +++ b/packages/@aws-cdk/pipelines/test/cross-environment-infra.test.ts @@ -1,6 +1,7 @@ import { arrayWith, objectLike } from '@aws-cdk/assert'; import '@aws-cdk/assert/jest'; -import { Construct, Stack, Stage, StageProps } from '@aws-cdk/core'; +import { Stack, Stage, StageProps } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as cdkp from '../lib'; import { stringLike } from './testmatchers'; import { BucketStack, PIPELINE_ENV, TestApp, TestGitHubNpmPipeline } from './testutil'; diff --git a/packages/@aws-cdk/pipelines/test/integ.pipeline.ts b/packages/@aws-cdk/pipelines/test/integ.pipeline.ts index f0a4da9dde073..c2685c84c13ca 100644 --- a/packages/@aws-cdk/pipelines/test/integ.pipeline.ts +++ b/packages/@aws-cdk/pipelines/test/integ.pipeline.ts @@ -1,7 +1,8 @@ /// !cdk-integ PipelineStack import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as codepipeline_actions from '@aws-cdk/aws-codepipeline-actions'; -import { App, CfnResource, Construct, SecretValue, Stack, StackProps, Stage, StageProps } from '@aws-cdk/core'; +import { App, CfnResource, SecretValue, Stack, StackProps, Stage, StageProps } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as cdkp from '../lib'; class MyStage extends Stage { diff --git a/packages/@aws-cdk/pipelines/test/pipeline-assets.test.ts b/packages/@aws-cdk/pipelines/test/pipeline-assets.test.ts index c1fb0b79b13f9..e527c7c9a0885 100644 --- a/packages/@aws-cdk/pipelines/test/pipeline-assets.test.ts +++ b/packages/@aws-cdk/pipelines/test/pipeline-assets.test.ts @@ -2,7 +2,8 @@ import { arrayWith, deepObjectLike, objectLike } from '@aws-cdk/assert'; import '@aws-cdk/assert/jest'; import * as ecr_assets from '@aws-cdk/aws-ecr-assets'; import * as s3_assets from '@aws-cdk/aws-s3-assets'; -import { Construct, Stack, Stage, StageProps } from '@aws-cdk/core'; +import { Stack, Stage, StageProps } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as path from 'path'; import * as cdkp from '../lib'; import { encodedJson, notMatching, stringLike } from './testmatchers'; diff --git a/packages/@aws-cdk/pipelines/test/pipeline.test.ts b/packages/@aws-cdk/pipelines/test/pipeline.test.ts index 2196726c91180..589cb88465c0c 100644 --- a/packages/@aws-cdk/pipelines/test/pipeline.test.ts +++ b/packages/@aws-cdk/pipelines/test/pipeline.test.ts @@ -1,6 +1,7 @@ import { arrayWith, deepObjectLike, objectLike } from '@aws-cdk/assert'; import '@aws-cdk/assert/jest'; -import { Construct, Stack, Stage, StageProps } from '@aws-cdk/core'; +import { Stack, Stage, StageProps } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as cdkp from '../lib'; import { anything, encodedJson, stringLike } from './testmatchers'; import { BucketStack, PIPELINE_ENV, stackTemplate, TestApp, TestGitHubNpmPipeline } from './testutil'; diff --git a/packages/@aws-cdk/pipelines/test/stack-ordering.test.ts b/packages/@aws-cdk/pipelines/test/stack-ordering.test.ts index e755572c78544..c50f78ff1106c 100644 --- a/packages/@aws-cdk/pipelines/test/stack-ordering.test.ts +++ b/packages/@aws-cdk/pipelines/test/stack-ordering.test.ts @@ -1,6 +1,7 @@ import { arrayWith, objectLike } from '@aws-cdk/assert'; import '@aws-cdk/assert/jest'; -import { App, Construct, Stack, Stage, StageProps } from '@aws-cdk/core'; +import { App, Stack, Stage, StageProps } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as cdkp from '../lib'; import { sortedByRunOrder } from './testmatchers'; import { BucketStack, PIPELINE_ENV, TestApp, TestGitHubNpmPipeline } from './testutil'; diff --git a/packages/@aws-cdk/pipelines/test/testutil.ts b/packages/@aws-cdk/pipelines/test/testutil.ts index 9c87e64c502b7..0f5b9697e247a 100644 --- a/packages/@aws-cdk/pipelines/test/testutil.ts +++ b/packages/@aws-cdk/pipelines/test/testutil.ts @@ -1,7 +1,8 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as codepipeline_actions from '@aws-cdk/aws-codepipeline-actions'; import * as s3 from '@aws-cdk/aws-s3'; -import { App, AppProps, Construct, Environment, SecretValue, Stack, StackProps, Stage } from '@aws-cdk/core'; +import { App, AppProps, Environment, SecretValue, Stack, StackProps, Stage } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as fs from 'fs'; import * as path from 'path'; import * as cdkp from '../lib'; diff --git a/packages/@aws-cdk/pipelines/test/validation.test.ts b/packages/@aws-cdk/pipelines/test/validation.test.ts index e2c16e8e67bfc..bfbd729abf5f6 100644 --- a/packages/@aws-cdk/pipelines/test/validation.test.ts +++ b/packages/@aws-cdk/pipelines/test/validation.test.ts @@ -1,7 +1,8 @@ import { _objectContaining, arrayWith, deepObjectLike } from '@aws-cdk/assert'; import '@aws-cdk/assert/jest'; import * as codepipeline from '@aws-cdk/aws-codepipeline'; -import { CfnOutput, Construct, Stack, Stage, StageProps } from '@aws-cdk/core'; +import { CfnOutput, Stack, Stage, StageProps } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as cdkp from '../lib'; import { anything, encodedJson } from './testmatchers'; import { BucketStack, PIPELINE_ENV, TestApp, TestGitHubNpmPipeline } from './testutil'; From b2054238e402b4e58049f83abe725e2321360949 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Mon, 13 Jul 2020 13:27:29 +0000 Subject: [PATCH 30/39] upgrade to pre.4 --- packages/@aws-cdk/alexa-ask/package.json | 4 ++-- packages/@aws-cdk/app-delivery/package.json | 4 ++-- packages/@aws-cdk/assert/package.json | 4 ++-- packages/@aws-cdk/assets/package.json | 4 ++-- packages/@aws-cdk/aws-accessanalyzer/package.json | 4 ++-- packages/@aws-cdk/aws-acmpca/package.json | 4 ++-- packages/@aws-cdk/aws-amazonmq/package.json | 4 ++-- packages/@aws-cdk/aws-amplify/package.json | 4 ++-- packages/@aws-cdk/aws-apigateway/package.json | 4 ++-- packages/@aws-cdk/aws-apigatewayv2/package.json | 4 ++-- packages/@aws-cdk/aws-appconfig/package.json | 4 ++-- packages/@aws-cdk/aws-applicationautoscaling/package.json | 4 ++-- packages/@aws-cdk/aws-appmesh/package.json | 4 ++-- packages/@aws-cdk/aws-appstream/package.json | 4 ++-- packages/@aws-cdk/aws-appsync/package.json | 4 ++-- packages/@aws-cdk/aws-athena/package.json | 4 ++-- packages/@aws-cdk/aws-autoscaling-common/package.json | 4 ++-- .../@aws-cdk/aws-autoscaling-hooktargets/package.json | 4 ++-- packages/@aws-cdk/aws-autoscaling/package.json | 4 ++-- packages/@aws-cdk/aws-autoscalingplans/package.json | 4 ++-- packages/@aws-cdk/aws-backup/package.json | 4 ++-- packages/@aws-cdk/aws-batch/package.json | 4 ++-- packages/@aws-cdk/aws-budgets/package.json | 4 ++-- packages/@aws-cdk/aws-certificatemanager/package.json | 4 ++-- packages/@aws-cdk/aws-cloud9/package.json | 4 ++-- packages/@aws-cdk/aws-cloudformation/package.json | 4 ++-- packages/@aws-cdk/aws-cloudfront/package.json | 4 ++-- packages/@aws-cdk/aws-cloudtrail/package.json | 4 ++-- packages/@aws-cdk/aws-cloudwatch-actions/package.json | 4 ++-- packages/@aws-cdk/aws-cloudwatch/package.json | 4 ++-- packages/@aws-cdk/aws-codebuild/package.json | 4 ++-- packages/@aws-cdk/aws-codecommit/package.json | 4 ++-- packages/@aws-cdk/aws-codedeploy/package.json | 4 ++-- packages/@aws-cdk/aws-codeguruprofiler/package.json | 4 ++-- packages/@aws-cdk/aws-codepipeline-actions/package.json | 4 ++-- packages/@aws-cdk/aws-codepipeline/package.json | 4 ++-- packages/@aws-cdk/aws-codestar/package.json | 4 ++-- packages/@aws-cdk/aws-codestarnotifications/package.json | 4 ++-- packages/@aws-cdk/aws-cognito/package.json | 4 ++-- packages/@aws-cdk/aws-config/package.json | 4 ++-- packages/@aws-cdk/aws-datapipeline/package.json | 4 ++-- packages/@aws-cdk/aws-dax/package.json | 4 ++-- packages/@aws-cdk/aws-directoryservice/package.json | 4 ++-- packages/@aws-cdk/aws-dlm/package.json | 4 ++-- packages/@aws-cdk/aws-dms/package.json | 4 ++-- packages/@aws-cdk/aws-docdb/package.json | 4 ++-- packages/@aws-cdk/aws-dynamodb-global/package.json | 4 ++-- packages/@aws-cdk/aws-dynamodb/package.json | 4 ++-- packages/@aws-cdk/aws-ec2/package.json | 4 ++-- packages/@aws-cdk/aws-ecr-assets/package.json | 4 ++-- packages/@aws-cdk/aws-ecr/package.json | 4 ++-- packages/@aws-cdk/aws-ecs-patterns/package.json | 4 ++-- packages/@aws-cdk/aws-ecs/package.json | 4 ++-- packages/@aws-cdk/aws-efs/package.json | 4 ++-- packages/@aws-cdk/aws-eks-legacy/package.json | 4 ++-- packages/@aws-cdk/aws-eks/package.json | 4 ++-- packages/@aws-cdk/aws-elasticache/package.json | 4 ++-- packages/@aws-cdk/aws-elasticbeanstalk/package.json | 4 ++-- packages/@aws-cdk/aws-elasticloadbalancing/package.json | 4 ++-- .../aws-elasticloadbalancingv2-actions/package.json | 4 ++-- .../aws-elasticloadbalancingv2-targets/package.json | 4 ++-- packages/@aws-cdk/aws-elasticloadbalancingv2/package.json | 4 ++-- packages/@aws-cdk/aws-elasticsearch/package.json | 4 ++-- packages/@aws-cdk/aws-emr/package.json | 4 ++-- packages/@aws-cdk/aws-events-targets/package.json | 4 ++-- packages/@aws-cdk/aws-events/package.json | 4 ++-- packages/@aws-cdk/aws-eventschemas/package.json | 4 ++-- packages/@aws-cdk/aws-fms/package.json | 4 ++-- packages/@aws-cdk/aws-fsx/package.json | 4 ++-- packages/@aws-cdk/aws-gamelift/package.json | 4 ++-- packages/@aws-cdk/aws-globalaccelerator/package.json | 4 ++-- packages/@aws-cdk/aws-glue/package.json | 4 ++-- packages/@aws-cdk/aws-greengrass/package.json | 4 ++-- packages/@aws-cdk/aws-guardduty/package.json | 4 ++-- packages/@aws-cdk/aws-iam/package.json | 4 ++-- packages/@aws-cdk/aws-inspector/package.json | 4 ++-- packages/@aws-cdk/aws-iot/package.json | 4 ++-- packages/@aws-cdk/aws-iot1click/package.json | 4 ++-- packages/@aws-cdk/aws-iotanalytics/package.json | 4 ++-- packages/@aws-cdk/aws-iotevents/package.json | 4 ++-- packages/@aws-cdk/aws-iotthingsgraph/package.json | 4 ++-- packages/@aws-cdk/aws-kinesis/package.json | 4 ++-- packages/@aws-cdk/aws-kinesisanalytics/package.json | 4 ++-- packages/@aws-cdk/aws-kinesisfirehose/package.json | 4 ++-- packages/@aws-cdk/aws-kms/package.json | 4 ++-- packages/@aws-cdk/aws-lakeformation/package.json | 4 ++-- packages/@aws-cdk/aws-lambda-destinations/package.json | 4 ++-- packages/@aws-cdk/aws-lambda-event-sources/package.json | 4 ++-- packages/@aws-cdk/aws-lambda-nodejs/package.json | 4 ++-- packages/@aws-cdk/aws-lambda/package.json | 4 ++-- packages/@aws-cdk/aws-logs-destinations/package.json | 4 ++-- packages/@aws-cdk/aws-logs/package.json | 4 ++-- packages/@aws-cdk/aws-managedblockchain/package.json | 4 ++-- packages/@aws-cdk/aws-mediaconvert/package.json | 4 ++-- packages/@aws-cdk/aws-medialive/package.json | 4 ++-- packages/@aws-cdk/aws-mediastore/package.json | 4 ++-- packages/@aws-cdk/aws-msk/package.json | 4 ++-- packages/@aws-cdk/aws-neptune/package.json | 4 ++-- packages/@aws-cdk/aws-opsworks/package.json | 4 ++-- packages/@aws-cdk/aws-opsworkscm/package.json | 4 ++-- packages/@aws-cdk/aws-pinpoint/package.json | 4 ++-- packages/@aws-cdk/aws-pinpointemail/package.json | 4 ++-- packages/@aws-cdk/aws-qldb/package.json | 4 ++-- packages/@aws-cdk/aws-ram/package.json | 4 ++-- packages/@aws-cdk/aws-rds/package.json | 4 ++-- packages/@aws-cdk/aws-redshift/package.json | 4 ++-- packages/@aws-cdk/aws-robomaker/package.json | 4 ++-- packages/@aws-cdk/aws-route53-patterns/package.json | 4 ++-- packages/@aws-cdk/aws-route53-targets/package.json | 4 ++-- packages/@aws-cdk/aws-route53/package.json | 4 ++-- packages/@aws-cdk/aws-route53resolver/package.json | 4 ++-- packages/@aws-cdk/aws-s3-assets/package.json | 4 ++-- packages/@aws-cdk/aws-s3-deployment/package.json | 4 ++-- packages/@aws-cdk/aws-s3-notifications/package.json | 4 ++-- packages/@aws-cdk/aws-s3/package.json | 4 ++-- packages/@aws-cdk/aws-sagemaker/package.json | 4 ++-- packages/@aws-cdk/aws-sam/package.json | 4 ++-- packages/@aws-cdk/aws-sdb/package.json | 4 ++-- packages/@aws-cdk/aws-secretsmanager/package.json | 4 ++-- packages/@aws-cdk/aws-securityhub/package.json | 4 ++-- packages/@aws-cdk/aws-servicecatalog/package.json | 4 ++-- packages/@aws-cdk/aws-servicediscovery/package.json | 4 ++-- packages/@aws-cdk/aws-ses-actions/package.json | 4 ++-- packages/@aws-cdk/aws-ses/package.json | 4 ++-- packages/@aws-cdk/aws-sns-subscriptions/package.json | 4 ++-- packages/@aws-cdk/aws-sns/package.json | 4 ++-- packages/@aws-cdk/aws-sqs/package.json | 4 ++-- packages/@aws-cdk/aws-ssm/package.json | 4 ++-- packages/@aws-cdk/aws-stepfunctions-tasks/package.json | 4 ++-- packages/@aws-cdk/aws-stepfunctions/package.json | 4 ++-- packages/@aws-cdk/aws-transfer/package.json | 4 ++-- packages/@aws-cdk/aws-waf/package.json | 4 ++-- packages/@aws-cdk/aws-wafregional/package.json | 4 ++-- packages/@aws-cdk/aws-wafv2/package.json | 4 ++-- packages/@aws-cdk/aws-workspaces/package.json | 4 ++-- packages/@aws-cdk/cloudformation-include/package.json | 4 ++-- packages/@aws-cdk/core/package.json | 4 ++-- packages/@aws-cdk/custom-resources/package.json | 4 ++-- packages/@aws-cdk/example-construct-library/package.json | 4 ++-- packages/@aws-cdk/pipelines/package.json | 4 ++-- packages/@monocdk-experiment/assert/package.json | 4 ++-- packages/decdk/package.json | 2 +- packages/monocdk-experiment/package.json | 4 ++-- tools/pkglint/lib/rules.ts | 2 +- yarn.lock | 8 ++++---- 145 files changed, 290 insertions(+), 290 deletions(-) diff --git a/packages/@aws-cdk/alexa-ask/package.json b/packages/@aws-cdk/alexa-ask/package.json index d2b6a289ae1a9..921c5eb83979f 100644 --- a/packages/@aws-cdk/alexa-ask/package.json +++ b/packages/@aws-cdk/alexa-ask/package.json @@ -71,11 +71,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/app-delivery/package.json b/packages/@aws-cdk/app-delivery/package.json index 308d4e78cd4da..e166899534058 100644 --- a/packages/@aws-cdk/app-delivery/package.json +++ b/packages/@aws-cdk/app-delivery/package.json @@ -49,7 +49,7 @@ "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "devDependencies": { "@aws-cdk/assert": "0.0.0", @@ -87,7 +87,7 @@ "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/assert/package.json b/packages/@aws-cdk/assert/package.json index c6a696a73c445..5d9785846100e 100644 --- a/packages/@aws-cdk/assert/package.json +++ b/packages/@aws-cdk/assert/package.json @@ -32,12 +32,12 @@ "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", "jest": "^25.5.4", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "repository": { "url": "https://github.com/aws/aws-cdk.git", diff --git a/packages/@aws-cdk/assets/package.json b/packages/@aws-cdk/assets/package.json index 4315b9bc7a362..82f8177534835 100644 --- a/packages/@aws-cdk/assets/package.json +++ b/packages/@aws-cdk/assets/package.json @@ -77,13 +77,13 @@ "dependencies": { "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 ddb5bd4e09f78..c3c1d9726b53a 100644 --- a/packages/@aws-cdk/aws-accessanalyzer/package.json +++ b/packages/@aws-cdk/aws-accessanalyzer/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 8b3b044697a30..942198b6013fb 100644 --- a/packages/@aws-cdk/aws-acmpca/package.json +++ b/packages/@aws-cdk/aws-acmpca/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 04e0469d03c8d..7fdf4ad9f9e6c 100644 --- a/packages/@aws-cdk/aws-amazonmq/package.json +++ b/packages/@aws-cdk/aws-amazonmq/package.json @@ -71,11 +71,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-amplify/package.json b/packages/@aws-cdk/aws-amplify/package.json index 0e9a34634ebc2..9a38d60467169 100644 --- a/packages/@aws-cdk/aws-amplify/package.json +++ b/packages/@aws-cdk/aws-amplify/package.json @@ -78,7 +78,7 @@ "@aws-cdk/aws-codecommit": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/aws-iam": "0.0.0", @@ -87,7 +87,7 @@ "@aws-cdk/aws-codecommit": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-apigateway/package.json b/packages/@aws-cdk/aws-apigateway/package.json index 861869751a3c2..c37e06e6e77ce 100644 --- a/packages/@aws-cdk/aws-apigateway/package.json +++ b/packages/@aws-cdk/aws-apigateway/package.json @@ -82,7 +82,7 @@ "@aws-cdk/aws-s3-assets": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -97,7 +97,7 @@ "@aws-cdk/aws-s3-assets": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-apigatewayv2/package.json b/packages/@aws-cdk/aws-apigatewayv2/package.json index ba1e910795b58..f8ddb4a6d9c13 100644 --- a/packages/@aws-cdk/aws-apigatewayv2/package.json +++ b/packages/@aws-cdk/aws-apigatewayv2/package.json @@ -75,14 +75,14 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-certificatemanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 0c64d8c34334c..98f78195f7ddd 100644 --- a/packages/@aws-cdk/aws-appconfig/package.json +++ b/packages/@aws-cdk/aws-appconfig/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-applicationautoscaling/package.json b/packages/@aws-cdk/aws-applicationautoscaling/package.json index e0c4314ae081a..b6b02028c82ed 100644 --- a/packages/@aws-cdk/aws-applicationautoscaling/package.json +++ b/packages/@aws-cdk/aws-applicationautoscaling/package.json @@ -75,7 +75,7 @@ "@aws-cdk/aws-cloudwatch": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -83,7 +83,7 @@ "@aws-cdk/aws-cloudwatch": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-appmesh/package.json b/packages/@aws-cdk/aws-appmesh/package.json index ae71f3ed6306b..03e349975ef92 100644 --- a/packages/@aws-cdk/aws-appmesh/package.json +++ b/packages/@aws-cdk/aws-appmesh/package.json @@ -80,14 +80,14 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-servicediscovery": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/aws-ec2": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-servicediscovery": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 a7e309d33a09b..86546a944bdf5 100644 --- a/packages/@aws-cdk/aws-appstream/package.json +++ b/packages/@aws-cdk/aws-appstream/package.json @@ -71,11 +71,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-appsync/package.json b/packages/@aws-cdk/aws-appsync/package.json index 39868be68cb3e..4815db6a0f61d 100644 --- a/packages/@aws-cdk/aws-appsync/package.json +++ b/packages/@aws-cdk/aws-appsync/package.json @@ -76,7 +76,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -85,7 +85,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 5d69cd1791fe0..a132b3ed9faa9 100644 --- a/packages/@aws-cdk/aws-athena/package.json +++ b/packages/@aws-cdk/aws-athena/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-autoscaling-common/package.json b/packages/@aws-cdk/aws-autoscaling-common/package.json index dc77f3f9c21e6..d35052b2dc853 100644 --- a/packages/@aws-cdk/aws-autoscaling-common/package.json +++ b/packages/@aws-cdk/aws-autoscaling-common/package.json @@ -69,13 +69,13 @@ "dependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "awslint": { "exclude": [ diff --git a/packages/@aws-cdk/aws-autoscaling-hooktargets/package.json b/packages/@aws-cdk/aws-autoscaling-hooktargets/package.json index b653638fc8f82..e4f464cb763f7 100644 --- a/packages/@aws-cdk/aws-autoscaling-hooktargets/package.json +++ b/packages/@aws-cdk/aws-autoscaling-hooktargets/package.json @@ -74,7 +74,7 @@ "@aws-cdk/aws-sns-subscriptions": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -85,7 +85,7 @@ "@aws-cdk/aws-sns-subscriptions": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-autoscaling/package.json b/packages/@aws-cdk/aws-autoscaling/package.json index 27404307c2fbc..3f0b89155e56f 100644 --- a/packages/@aws-cdk/aws-autoscaling/package.json +++ b/packages/@aws-cdk/aws-autoscaling/package.json @@ -81,7 +81,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -93,7 +93,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-autoscalingplans/package.json b/packages/@aws-cdk/aws-autoscalingplans/package.json index d55e4b5938f31..aae7708860c26 100644 --- a/packages/@aws-cdk/aws-autoscalingplans/package.json +++ b/packages/@aws-cdk/aws-autoscalingplans/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-backup/package.json b/packages/@aws-cdk/aws-backup/package.json index 768e886856481..9a78181d6aedd 100644 --- a/packages/@aws-cdk/aws-backup/package.json +++ b/packages/@aws-cdk/aws-backup/package.json @@ -81,7 +81,7 @@ "@aws-cdk/aws-rds": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/aws-dynamodb": "0.0.0", @@ -93,7 +93,7 @@ "@aws-cdk/aws-rds": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-batch/package.json b/packages/@aws-cdk/aws-batch/package.json index a52ce330911e3..0ac8d1a7c3f0f 100644 --- a/packages/@aws-cdk/aws-batch/package.json +++ b/packages/@aws-cdk/aws-batch/package.json @@ -76,7 +76,7 @@ "@aws-cdk/aws-ecr": "0.0.0", "@aws-cdk/aws-ecs": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -85,7 +85,7 @@ "@aws-cdk/aws-ecr": "0.0.0", "@aws-cdk/aws-ecs": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 b9b4c34076b3c..b94aab4739323 100644 --- a/packages/@aws-cdk/aws-budgets/package.json +++ b/packages/@aws-cdk/aws-budgets/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-certificatemanager/package.json b/packages/@aws-cdk/aws-certificatemanager/package.json index a5cfdc1cd0b48..9429fd0c6b7d6 100644 --- a/packages/@aws-cdk/aws-certificatemanager/package.json +++ b/packages/@aws-cdk/aws-certificatemanager/package.json @@ -74,7 +74,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-route53": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -82,7 +82,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-route53": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 6f7fe42437bba..bbcfdebff4f66 100644 --- a/packages/@aws-cdk/aws-cloud9/package.json +++ b/packages/@aws-cdk/aws-cloud9/package.json @@ -74,14 +74,14 @@ "@aws-cdk/core": "0.0.0", "@aws-cdk/aws-codecommit": "0.0.0", "@aws-cdk/aws-ec2": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-cloudformation/package.json b/packages/@aws-cdk/aws-cloudformation/package.json index 80adc8012e02d..6259f77cf43d1 100644 --- a/packages/@aws-cdk/aws-cloudformation/package.json +++ b/packages/@aws-cdk/aws-cloudformation/package.json @@ -83,7 +83,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -93,7 +93,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-cloudfront/package.json b/packages/@aws-cdk/aws-cloudfront/package.json index 84c5710b3385b..43de98f01e17e 100644 --- a/packages/@aws-cdk/aws-cloudfront/package.json +++ b/packages/@aws-cdk/aws-cloudfront/package.json @@ -78,7 +78,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -88,7 +88,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-cloudtrail/package.json b/packages/@aws-cdk/aws-cloudtrail/package.json index a847d702ec4cf..c05cee6e636eb 100644 --- a/packages/@aws-cdk/aws-cloudtrail/package.json +++ b/packages/@aws-cdk/aws-cloudtrail/package.json @@ -81,7 +81,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -93,7 +93,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "awslint": { "exclude": [ diff --git a/packages/@aws-cdk/aws-cloudwatch-actions/package.json b/packages/@aws-cdk/aws-cloudwatch-actions/package.json index 2449f0a0c0eca..0a89b8724eb0d 100644 --- a/packages/@aws-cdk/aws-cloudwatch-actions/package.json +++ b/packages/@aws-cdk/aws-cloudwatch-actions/package.json @@ -73,7 +73,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -83,7 +83,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-cloudwatch/package.json b/packages/@aws-cdk/aws-cloudwatch/package.json index 80d7f52ec6ad4..23cc46fd7dbda 100644 --- a/packages/@aws-cdk/aws-cloudwatch/package.json +++ b/packages/@aws-cdk/aws-cloudwatch/package.json @@ -73,13 +73,13 @@ "dependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "awslint": { "exclude": [ diff --git a/packages/@aws-cdk/aws-codebuild/package.json b/packages/@aws-cdk/aws-codebuild/package.json index 4d0cd60607251..d694f45e10744 100644 --- a/packages/@aws-cdk/aws-codebuild/package.json +++ b/packages/@aws-cdk/aws-codebuild/package.json @@ -91,7 +91,7 @@ "@aws-cdk/aws-s3-assets": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -108,7 +108,7 @@ "@aws-cdk/aws-s3-assets": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 8704b07040574..3a4db899e1932 100644 --- a/packages/@aws-cdk/aws-codecommit/package.json +++ b/packages/@aws-cdk/aws-codecommit/package.json @@ -81,14 +81,14 @@ "@aws-cdk/aws-events": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-codedeploy/package.json b/packages/@aws-cdk/aws-codedeploy/package.json index 523d79122f1d3..0375fab00973d 100644 --- a/packages/@aws-cdk/aws-codedeploy/package.json +++ b/packages/@aws-cdk/aws-codedeploy/package.json @@ -83,7 +83,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -96,7 +96,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 57d6f531055f2..5bf69a92afb32 100644 --- a/packages/@aws-cdk/aws-codeguruprofiler/package.json +++ b/packages/@aws-cdk/aws-codeguruprofiler/package.json @@ -74,12 +74,12 @@ "dependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-codepipeline-actions/package.json b/packages/@aws-cdk/aws-codepipeline-actions/package.json index 978e8d7fd0f2a..caed555f75a59 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/package.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/package.json @@ -90,7 +90,7 @@ "@aws-cdk/aws-sns-subscriptions": "0.0.0", "@aws-cdk/core": "0.0.0", "case": "1.6.3", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -110,7 +110,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/aws-sns-subscriptions": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "bundledDependencies": [ "case" diff --git a/packages/@aws-cdk/aws-codepipeline/package.json b/packages/@aws-cdk/aws-codepipeline/package.json index 6c585f52e28c4..aa636ef022ad2 100644 --- a/packages/@aws-cdk/aws-codepipeline/package.json +++ b/packages/@aws-cdk/aws-codepipeline/package.json @@ -82,7 +82,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -91,7 +91,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-codestar/package.json b/packages/@aws-cdk/aws-codestar/package.json index 1e381cad2a86d..1ec2afda61a2d 100644 --- a/packages/@aws-cdk/aws-codestar/package.json +++ b/packages/@aws-cdk/aws-codestar/package.json @@ -74,12 +74,12 @@ "dependencies": { "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 28e4200bd5435..87b37a37f8772 100644 --- a/packages/@aws-cdk/aws-codestarnotifications/package.json +++ b/packages/@aws-cdk/aws-codestarnotifications/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 ca6e2601ec878..2e130604046e6 100644 --- a/packages/@aws-cdk/aws-cognito/package.json +++ b/packages/@aws-cdk/aws-cognito/package.json @@ -78,7 +78,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -87,7 +87,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-config/package.json b/packages/@aws-cdk/aws-config/package.json index 72cafd42c72bb..c184599381a3a 100644 --- a/packages/@aws-cdk/aws-config/package.json +++ b/packages/@aws-cdk/aws-config/package.json @@ -77,7 +77,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -86,7 +86,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-datapipeline/package.json b/packages/@aws-cdk/aws-datapipeline/package.json index 167aa469b2708..d4f10a4941d63 100644 --- a/packages/@aws-cdk/aws-datapipeline/package.json +++ b/packages/@aws-cdk/aws-datapipeline/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-dax/package.json b/packages/@aws-cdk/aws-dax/package.json index f754ca0917b15..80127e550c6b6 100644 --- a/packages/@aws-cdk/aws-dax/package.json +++ b/packages/@aws-cdk/aws-dax/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-directoryservice/package.json b/packages/@aws-cdk/aws-directoryservice/package.json index 0851c7647387f..95e85ce164a2f 100644 --- a/packages/@aws-cdk/aws-directoryservice/package.json +++ b/packages/@aws-cdk/aws-directoryservice/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 e7cd34bb37cac..88c09b73036d6 100644 --- a/packages/@aws-cdk/aws-dlm/package.json +++ b/packages/@aws-cdk/aws-dlm/package.json @@ -71,11 +71,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 46da0f6bd2cd2..e80c51f2ce8ed 100644 --- a/packages/@aws-cdk/aws-dms/package.json +++ b/packages/@aws-cdk/aws-dms/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 988c7f1702138..7fbe4439e90cf 100644 --- a/packages/@aws-cdk/aws-docdb/package.json +++ b/packages/@aws-cdk/aws-docdb/package.json @@ -77,7 +77,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/aws-efs": "0.0.0", @@ -85,7 +85,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-dynamodb-global/package.json b/packages/@aws-cdk/aws-dynamodb-global/package.json index 2c0c0f88245f8..e2e4cf2c5e53c 100644 --- a/packages/@aws-cdk/aws-dynamodb-global/package.json +++ b/packages/@aws-cdk/aws-dynamodb-global/package.json @@ -50,7 +50,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "devDependencies": { "@aws-cdk/assert": "0.0.0", @@ -65,7 +65,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "scripts": { "build": "cdk-build", diff --git a/packages/@aws-cdk/aws-dynamodb/package.json b/packages/@aws-cdk/aws-dynamodb/package.json index 438b752d860b4..ebe701a279948 100644 --- a/packages/@aws-cdk/aws-dynamodb/package.json +++ b/packages/@aws-cdk/aws-dynamodb/package.json @@ -83,7 +83,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -94,7 +94,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-ec2/package.json b/packages/@aws-cdk/aws-ec2/package.json index f9917f0523906..4fcff361dfa51 100644 --- a/packages/@aws-cdk/aws-ec2/package.json +++ b/packages/@aws-cdk/aws-ec2/package.json @@ -82,7 +82,7 @@ "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -96,7 +96,7 @@ "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-ecr-assets/package.json b/packages/@aws-cdk/aws-ecr-assets/package.json index d27c871b9deb4..6af145b90c288 100644 --- a/packages/@aws-cdk/aws-ecr-assets/package.json +++ b/packages/@aws-cdk/aws-ecr-assets/package.json @@ -79,7 +79,7 @@ "@aws-cdk/assets": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "minimatch": "^3.0.4", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -90,7 +90,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "nyc": { "statements": 70 diff --git a/packages/@aws-cdk/aws-ecr/package.json b/packages/@aws-cdk/aws-ecr/package.json index 8526590dd58d0..46f12d79edb7b 100644 --- a/packages/@aws-cdk/aws-ecr/package.json +++ b/packages/@aws-cdk/aws-ecr/package.json @@ -79,7 +79,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -87,7 +87,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-ecs-patterns/package.json b/packages/@aws-cdk/aws-ecs-patterns/package.json index 6fb679c788796..007c2a201b22e 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/package.json +++ b/packages/@aws-cdk/aws-ecs-patterns/package.json @@ -82,7 +82,7 @@ "@aws-cdk/aws-servicediscovery": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -99,7 +99,7 @@ "@aws-cdk/aws-servicediscovery": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-ecs/package.json b/packages/@aws-cdk/aws-ecs/package.json index c46cc6eb6796b..3eaf218f53187 100644 --- a/packages/@aws-cdk/aws-ecs/package.json +++ b/packages/@aws-cdk/aws-ecs/package.json @@ -96,7 +96,7 @@ "@aws-cdk/aws-ssm": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -122,7 +122,7 @@ "@aws-cdk/aws-ssm": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 a183b64ba2b9a..a1645998247fd 100644 --- a/packages/@aws-cdk/aws-efs/package.json +++ b/packages/@aws-cdk/aws-efs/package.json @@ -75,7 +75,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -84,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": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-eks-legacy/package.json b/packages/@aws-cdk/aws-eks-legacy/package.json index 9933002a29f8c..ea26c8cfcfacb 100644 --- a/packages/@aws-cdk/aws-eks-legacy/package.json +++ b/packages/@aws-cdk/aws-eks-legacy/package.json @@ -78,7 +78,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-ssm": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -89,7 +89,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-ssm": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-eks/package.json b/packages/@aws-cdk/aws-eks/package.json index 4fd39ce8ea08e..a3a3b7ab3bdaa 100644 --- a/packages/@aws-cdk/aws-eks/package.json +++ b/packages/@aws-cdk/aws-eks/package.json @@ -81,7 +81,7 @@ "@aws-cdk/aws-ssm": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", - "constructs": "4.1.1-pre.1", + "constructs": "4.1.1-pre.4", "yaml": "1.10.0" }, "bundledDependencies": [ @@ -96,7 +96,7 @@ "@aws-cdk/aws-ssm": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/custom-resources": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-elasticache/package.json b/packages/@aws-cdk/aws-elasticache/package.json index 573a6b8afc863..03e109541bdf1 100644 --- a/packages/@aws-cdk/aws-elasticache/package.json +++ b/packages/@aws-cdk/aws-elasticache/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 07477737b2e20..3421b1c971802 100644 --- a/packages/@aws-cdk/aws-elasticbeanstalk/package.json +++ b/packages/@aws-cdk/aws-elasticbeanstalk/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 906864a818449..49c191c180bc6 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancing/package.json +++ b/packages/@aws-cdk/aws-elasticloadbalancing/package.json @@ -73,13 +73,13 @@ "dependencies": { "@aws-cdk/aws-ec2": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-ec2": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 bbde2d891ff44..686ac505d6c67 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2-actions/package.json +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2-actions/package.json @@ -71,7 +71,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-cognito": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -80,7 +80,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-cognito": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 e61048bf778ca..a6d95581aab5b 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2-targets/package.json +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2-targets/package.json @@ -71,7 +71,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -80,7 +80,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/package.json b/packages/@aws-cdk/aws-elasticloadbalancingv2/package.json index ca05d06b226ed..b0b3247cc3e44 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/package.json +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/package.json @@ -79,7 +79,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -90,7 +90,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1", + "constructs": "4.1.1-pre.4", "@aws-cdk/region-info": "0.0.0" }, "engines": { diff --git a/packages/@aws-cdk/aws-elasticsearch/package.json b/packages/@aws-cdk/aws-elasticsearch/package.json index 8693077873b74..6aa6771543fdf 100644 --- a/packages/@aws-cdk/aws-elasticsearch/package.json +++ b/packages/@aws-cdk/aws-elasticsearch/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 b9b1d03e70d45..452183f8cc4d1 100644 --- a/packages/@aws-cdk/aws-emr/package.json +++ b/packages/@aws-cdk/aws-emr/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-events-targets/package.json b/packages/@aws-cdk/aws-events-targets/package.json index 0dc6f96ba0468..cfa57addc629b 100644 --- a/packages/@aws-cdk/aws-events-targets/package.json +++ b/packages/@aws-cdk/aws-events-targets/package.json @@ -90,7 +90,7 @@ "@aws-cdk/aws-batch": "0.0.0", "@aws-cdk/aws-kinesis": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -107,7 +107,7 @@ "@aws-cdk/aws-stepfunctions": "0.0.0", "@aws-cdk/aws-batch": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1", + "constructs": "4.1.1-pre.4", "@aws-cdk/aws-kinesis": "0.0.0" }, "engines": { diff --git a/packages/@aws-cdk/aws-events/package.json b/packages/@aws-cdk/aws-events/package.json index 4972e58a70741..cbd356da5ef57 100644 --- a/packages/@aws-cdk/aws-events/package.json +++ b/packages/@aws-cdk/aws-events/package.json @@ -74,13 +74,13 @@ "dependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-eventschemas/package.json b/packages/@aws-cdk/aws-eventschemas/package.json index 78aab4e4521cc..7e6a53ac581e2 100644 --- a/packages/@aws-cdk/aws-eventschemas/package.json +++ b/packages/@aws-cdk/aws-eventschemas/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 393a779392297..ef47a3a33aecc 100644 --- a/packages/@aws-cdk/aws-fms/package.json +++ b/packages/@aws-cdk/aws-fms/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 444c6e50c1157..02309c43af536 100644 --- a/packages/@aws-cdk/aws-fsx/package.json +++ b/packages/@aws-cdk/aws-fsx/package.json @@ -76,14 +76,14 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 b40bca636f4b5..ddb00d59a5fbf 100644 --- a/packages/@aws-cdk/aws-gamelift/package.json +++ b/packages/@aws-cdk/aws-gamelift/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-globalaccelerator/package.json b/packages/@aws-cdk/aws-globalaccelerator/package.json index 024d1dafaabcb..4220ee1c5249d 100644 --- a/packages/@aws-cdk/aws-globalaccelerator/package.json +++ b/packages/@aws-cdk/aws-globalaccelerator/package.json @@ -75,11 +75,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-glue/package.json b/packages/@aws-cdk/aws-glue/package.json index 2755cccea8ccd..ae2548abfff63 100644 --- a/packages/@aws-cdk/aws-glue/package.json +++ b/packages/@aws-cdk/aws-glue/package.json @@ -76,7 +76,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -84,7 +84,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 89aaf56c7c506..f31fa1c402074 100644 --- a/packages/@aws-cdk/aws-greengrass/package.json +++ b/packages/@aws-cdk/aws-greengrass/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-guardduty/package.json b/packages/@aws-cdk/aws-guardduty/package.json index bcf5d9826dcd8..5db48aa49f8c5 100644 --- a/packages/@aws-cdk/aws-guardduty/package.json +++ b/packages/@aws-cdk/aws-guardduty/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-iam/package.json b/packages/@aws-cdk/aws-iam/package.json index bf141427925a9..71f7dc4d6e21b 100644 --- a/packages/@aws-cdk/aws-iam/package.json +++ b/packages/@aws-cdk/aws-iam/package.json @@ -74,12 +74,12 @@ "dependencies": { "@aws-cdk/core": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "engines": { diff --git a/packages/@aws-cdk/aws-inspector/package.json b/packages/@aws-cdk/aws-inspector/package.json index 16738350690e1..e7e2c3a2031bd 100644 --- a/packages/@aws-cdk/aws-inspector/package.json +++ b/packages/@aws-cdk/aws-inspector/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 f65b143053033..a0b6719c89995 100644 --- a/packages/@aws-cdk/aws-iot/package.json +++ b/packages/@aws-cdk/aws-iot/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 e726b3f27df6b..6c140e40c82ae 100644 --- a/packages/@aws-cdk/aws-iot1click/package.json +++ b/packages/@aws-cdk/aws-iot1click/package.json @@ -71,11 +71,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 14678a3bb24d3..c7aa690c7e5bb 100644 --- a/packages/@aws-cdk/aws-iotanalytics/package.json +++ b/packages/@aws-cdk/aws-iotanalytics/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 7f557b4095856..551e1bb8a1144 100644 --- a/packages/@aws-cdk/aws-iotevents/package.json +++ b/packages/@aws-cdk/aws-iotevents/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 79d2f3c13fb6e..c1fdd05217fcb 100644 --- a/packages/@aws-cdk/aws-iotthingsgraph/package.json +++ b/packages/@aws-cdk/aws-iotthingsgraph/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 011878ccb82ca..7766c3ffbbe90 100644 --- a/packages/@aws-cdk/aws-kinesis/package.json +++ b/packages/@aws-cdk/aws-kinesis/package.json @@ -74,7 +74,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -82,7 +82,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-kinesisanalytics/package.json b/packages/@aws-cdk/aws-kinesisanalytics/package.json index 6a008294eebbf..56e15717b92f2 100644 --- a/packages/@aws-cdk/aws-kinesisanalytics/package.json +++ b/packages/@aws-cdk/aws-kinesisanalytics/package.json @@ -73,12 +73,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 aa82be52f8608..4f540ce372ba6 100644 --- a/packages/@aws-cdk/aws-kinesisfirehose/package.json +++ b/packages/@aws-cdk/aws-kinesisfirehose/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-kms/package.json b/packages/@aws-cdk/aws-kms/package.json index bf9770c5cef31..210ab72df46cf 100644 --- a/packages/@aws-cdk/aws-kms/package.json +++ b/packages/@aws-cdk/aws-kms/package.json @@ -73,13 +73,13 @@ "dependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-lakeformation/package.json b/packages/@aws-cdk/aws-lakeformation/package.json index e80245be8a092..4ad6f680d0806 100644 --- a/packages/@aws-cdk/aws-lakeformation/package.json +++ b/packages/@aws-cdk/aws-lakeformation/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-lambda-destinations/package.json b/packages/@aws-cdk/aws-lambda-destinations/package.json index 5fe4854700553..0c08deb5cca7c 100644 --- a/packages/@aws-cdk/aws-lambda-destinations/package.json +++ b/packages/@aws-cdk/aws-lambda-destinations/package.json @@ -72,7 +72,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -82,7 +82,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-lambda-event-sources/package.json b/packages/@aws-cdk/aws-lambda-event-sources/package.json index 16bd0cf34c12e..0c1ea750e7b1c 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/package.json +++ b/packages/@aws-cdk/aws-lambda-event-sources/package.json @@ -78,7 +78,7 @@ "@aws-cdk/aws-sns-subscriptions": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -94,7 +94,7 @@ "@aws-cdk/aws-sns-subscriptions": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-lambda-nodejs/package.json b/packages/@aws-cdk/aws-lambda-nodejs/package.json index a52e6c320b890..0cb2ad3e63d8b 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/package.json +++ b/packages/@aws-cdk/aws-lambda-nodejs/package.json @@ -67,13 +67,13 @@ "dependencies": { "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-lambda/package.json b/packages/@aws-cdk/aws-lambda/package.json index a8b1adc640c74..adb3166b58cdc 100644 --- a/packages/@aws-cdk/aws-lambda/package.json +++ b/packages/@aws-cdk/aws-lambda/package.json @@ -94,7 +94,7 @@ "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -109,7 +109,7 @@ "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-logs-destinations/package.json b/packages/@aws-cdk/aws-logs-destinations/package.json index a53bbb712e2f0..cf91f757f2e5c 100644 --- a/packages/@aws-cdk/aws-logs-destinations/package.json +++ b/packages/@aws-cdk/aws-logs-destinations/package.json @@ -71,7 +71,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -80,7 +80,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-logs/package.json b/packages/@aws-cdk/aws-logs/package.json index 06769c67137f4..e19cd39818bec 100644 --- a/packages/@aws-cdk/aws-logs/package.json +++ b/packages/@aws-cdk/aws-logs/package.json @@ -74,14 +74,14 @@ "@aws-cdk/aws-cloudwatch": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/aws-cloudwatch": "0.0.0", "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 1509ac832b5de..044232f66d688 100644 --- a/packages/@aws-cdk/aws-managedblockchain/package.json +++ b/packages/@aws-cdk/aws-managedblockchain/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-mediaconvert/package.json b/packages/@aws-cdk/aws-mediaconvert/package.json index 3b9f223890ee1..07e36c54b5ddb 100644 --- a/packages/@aws-cdk/aws-mediaconvert/package.json +++ b/packages/@aws-cdk/aws-mediaconvert/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 db3d6ef5e3971..e48b7954bade2 100644 --- a/packages/@aws-cdk/aws-medialive/package.json +++ b/packages/@aws-cdk/aws-medialive/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 5c1d514f30c76..417ac779f057c 100644 --- a/packages/@aws-cdk/aws-mediastore/package.json +++ b/packages/@aws-cdk/aws-mediastore/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 44c3224b64d02..a567da243a3de 100644 --- a/packages/@aws-cdk/aws-msk/package.json +++ b/packages/@aws-cdk/aws-msk/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-neptune/package.json b/packages/@aws-cdk/aws-neptune/package.json index a16b0c1380807..6ab9a1c1b6b50 100644 --- a/packages/@aws-cdk/aws-neptune/package.json +++ b/packages/@aws-cdk/aws-neptune/package.json @@ -71,11 +71,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 69612612becea..90fa800d4dc05 100644 --- a/packages/@aws-cdk/aws-opsworks/package.json +++ b/packages/@aws-cdk/aws-opsworks/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 867b24735dc6f..8b003896979c7 100644 --- a/packages/@aws-cdk/aws-opsworkscm/package.json +++ b/packages/@aws-cdk/aws-opsworkscm/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 663df1362e42c..ff6420f7d9666 100644 --- a/packages/@aws-cdk/aws-pinpoint/package.json +++ b/packages/@aws-cdk/aws-pinpoint/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 63d3703656478..1173a4fd1e4ab 100644 --- a/packages/@aws-cdk/aws-pinpointemail/package.json +++ b/packages/@aws-cdk/aws-pinpointemail/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 dd08e33d72b1c..57945665f49f1 100644 --- a/packages/@aws-cdk/aws-qldb/package.json +++ b/packages/@aws-cdk/aws-qldb/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-ram/package.json b/packages/@aws-cdk/aws-ram/package.json index 3d4840154a793..3148c30703b2d 100644 --- a/packages/@aws-cdk/aws-ram/package.json +++ b/packages/@aws-cdk/aws-ram/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-rds/package.json b/packages/@aws-cdk/aws-rds/package.json index ee70453dba1e1..ca8774ea1bc75 100644 --- a/packages/@aws-cdk/aws-rds/package.json +++ b/packages/@aws-cdk/aws-rds/package.json @@ -82,7 +82,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -96,7 +96,7 @@ "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 830e5285cad98..637996ff78a59 100644 --- a/packages/@aws-cdk/aws-redshift/package.json +++ b/packages/@aws-cdk/aws-redshift/package.json @@ -76,7 +76,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -86,7 +86,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-secretsmanager": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 3d6fc09c761fb..d66f71f54467a 100644 --- a/packages/@aws-cdk/aws-robomaker/package.json +++ b/packages/@aws-cdk/aws-robomaker/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-route53-patterns/package.json b/packages/@aws-cdk/aws-route53-patterns/package.json index 8ed8530de318f..a74fa67bd7314 100644 --- a/packages/@aws-cdk/aws-route53-patterns/package.json +++ b/packages/@aws-cdk/aws-route53-patterns/package.json @@ -74,7 +74,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -86,7 +86,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-route53-targets/package.json b/packages/@aws-cdk/aws-route53-targets/package.json index bb6c58d653053..827e846f29e9c 100644 --- a/packages/@aws-cdk/aws-route53-targets/package.json +++ b/packages/@aws-cdk/aws-route53-targets/package.json @@ -79,7 +79,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -94,7 +94,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-route53/package.json b/packages/@aws-cdk/aws-route53/package.json index 73644ceb9b1a7..6bf1fc445de51 100644 --- a/packages/@aws-cdk/aws-route53/package.json +++ b/packages/@aws-cdk/aws-route53/package.json @@ -76,7 +76,7 @@ "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -84,7 +84,7 @@ "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 99d1adefb2b62..3c3a47acc3390 100644 --- a/packages/@aws-cdk/aws-route53resolver/package.json +++ b/packages/@aws-cdk/aws-route53resolver/package.json @@ -71,11 +71,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-s3-assets/package.json b/packages/@aws-cdk/aws-s3-assets/package.json index ac93b49a58537..67ffc6cb1c4e5 100644 --- a/packages/@aws-cdk/aws-s3-assets/package.json +++ b/packages/@aws-cdk/aws-s3-assets/package.json @@ -75,7 +75,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -85,7 +85,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-s3-deployment/package.json b/packages/@aws-cdk/aws-s3-deployment/package.json index a40710b617fa7..b47b44fcd0874 100644 --- a/packages/@aws-cdk/aws-s3-deployment/package.json +++ b/packages/@aws-cdk/aws-s3-deployment/package.json @@ -91,7 +91,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-s3-assets": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -101,7 +101,7 @@ "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-s3-assets": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-s3-notifications/package.json b/packages/@aws-cdk/aws-s3-notifications/package.json index 2a02103e6ac9e..6e3933f987365 100644 --- a/packages/@aws-cdk/aws-s3-notifications/package.json +++ b/packages/@aws-cdk/aws-s3-notifications/package.json @@ -71,7 +71,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -81,7 +81,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-s3/package.json b/packages/@aws-cdk/aws-s3/package.json index e4201f53ebc29..7a121ea119eff 100644 --- a/packages/@aws-cdk/aws-s3/package.json +++ b/packages/@aws-cdk/aws-s3/package.json @@ -75,7 +75,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -83,7 +83,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-sagemaker/package.json b/packages/@aws-cdk/aws-sagemaker/package.json index 5ab714947e67a..de12c19a10ae4 100644 --- a/packages/@aws-cdk/aws-sagemaker/package.json +++ b/packages/@aws-cdk/aws-sagemaker/package.json @@ -71,11 +71,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 f8727b4f07a23..ea63f543d8179 100644 --- a/packages/@aws-cdk/aws-sam/package.json +++ b/packages/@aws-cdk/aws-sam/package.json @@ -74,11 +74,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 9909752355fbb..83f4046439cec 100644 --- a/packages/@aws-cdk/aws-sdb/package.json +++ b/packages/@aws-cdk/aws-sdb/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-secretsmanager/package.json b/packages/@aws-cdk/aws-secretsmanager/package.json index 7e802ea3e5bcc..54f68c4fd10a2 100644 --- a/packages/@aws-cdk/aws-secretsmanager/package.json +++ b/packages/@aws-cdk/aws-secretsmanager/package.json @@ -78,7 +78,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-sam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/aws-ec2": "0.0.0", @@ -87,7 +87,7 @@ "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/aws-sam": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 9af9d5e7e83f6..a84209a5be57c 100644 --- a/packages/@aws-cdk/aws-securityhub/package.json +++ b/packages/@aws-cdk/aws-securityhub/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 1c65c3bfeb2c0..8b2362109e466 100644 --- a/packages/@aws-cdk/aws-servicecatalog/package.json +++ b/packages/@aws-cdk/aws-servicecatalog/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-servicediscovery/package.json b/packages/@aws-cdk/aws-servicediscovery/package.json index 51a3ed7aa4fa0..e9a0925ce8202 100644 --- a/packages/@aws-cdk/aws-servicediscovery/package.json +++ b/packages/@aws-cdk/aws-servicediscovery/package.json @@ -78,7 +78,7 @@ "@aws-cdk/aws-elasticloadbalancingv2": "0.0.0", "@aws-cdk/aws-route53": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -86,7 +86,7 @@ "@aws-cdk/aws-elasticloadbalancingv2": "0.0.0", "@aws-cdk/aws-route53": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 460f408ae430e..8075687287c3f 100644 --- a/packages/@aws-cdk/aws-ses-actions/package.json +++ b/packages/@aws-cdk/aws-ses-actions/package.json @@ -74,7 +74,7 @@ "@aws-cdk/aws-ses": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -85,7 +85,7 @@ "@aws-cdk/aws-ses": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-ses/package.json b/packages/@aws-cdk/aws-ses/package.json index af0a9192bb426..7e376d88370e7 100644 --- a/packages/@aws-cdk/aws-ses/package.json +++ b/packages/@aws-cdk/aws-ses/package.json @@ -74,14 +74,14 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-lambda": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-sns-subscriptions/package.json b/packages/@aws-cdk/aws-sns-subscriptions/package.json index c82174f46a719..58dec87015011 100644 --- a/packages/@aws-cdk/aws-sns-subscriptions/package.json +++ b/packages/@aws-cdk/aws-sns-subscriptions/package.json @@ -71,7 +71,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -80,7 +80,7 @@ "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-sns/package.json b/packages/@aws-cdk/aws-sns/package.json index 0bbc501f4cf20..6e353057221e0 100644 --- a/packages/@aws-cdk/aws-sns/package.json +++ b/packages/@aws-cdk/aws-sns/package.json @@ -81,7 +81,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -91,7 +91,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-sqs/package.json b/packages/@aws-cdk/aws-sqs/package.json index 7f67e59ff81f2..3f58aaa2cf60d 100644 --- a/packages/@aws-cdk/aws-sqs/package.json +++ b/packages/@aws-cdk/aws-sqs/package.json @@ -77,7 +77,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -85,7 +85,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-ssm/package.json b/packages/@aws-cdk/aws-ssm/package.json index 81806315562e6..b944471230ac8 100644 --- a/packages/@aws-cdk/aws-ssm/package.json +++ b/packages/@aws-cdk/aws-ssm/package.json @@ -75,7 +75,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -83,7 +83,7 @@ "@aws-cdk/aws-kms": "0.0.0", "@aws-cdk/core": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 a6ce890ec12e4..ba6932912c77a 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/package.json +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/package.json @@ -85,7 +85,7 @@ "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/aws-stepfunctions": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -106,7 +106,7 @@ "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/aws-stepfunctions": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/aws-stepfunctions/package.json b/packages/@aws-cdk/aws-stepfunctions/package.json index b7a3ee95d0a95..22c4537f25696 100644 --- a/packages/@aws-cdk/aws-stepfunctions/package.json +++ b/packages/@aws-cdk/aws-stepfunctions/package.json @@ -75,7 +75,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -84,7 +84,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 f5ed9ad18c797..2f08233c8efb1 100644 --- a/packages/@aws-cdk/aws-transfer/package.json +++ b/packages/@aws-cdk/aws-transfer/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 4175023da3f2f..aa8fcf9d035f3 100644 --- a/packages/@aws-cdk/aws-waf/package.json +++ b/packages/@aws-cdk/aws-waf/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 fb10179198d3a..916f3a2c5049a 100644 --- a/packages/@aws-cdk/aws-wafregional/package.json +++ b/packages/@aws-cdk/aws-wafregional/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 b857c23370186..117680a4efb75 100644 --- a/packages/@aws-cdk/aws-wafv2/package.json +++ b/packages/@aws-cdk/aws-wafv2/package.json @@ -72,11 +72,11 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "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 85787cf19d2b1..0708a54a3e72b 100644 --- a/packages/@aws-cdk/aws-workspaces/package.json +++ b/packages/@aws-cdk/aws-workspaces/package.json @@ -70,12 +70,12 @@ }, "dependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/cloudformation-include/package.json b/packages/@aws-cdk/cloudformation-include/package.json index a883e0ae8fc87..b95444dccf6e9 100644 --- a/packages/@aws-cdk/cloudformation-include/package.json +++ b/packages/@aws-cdk/cloudformation-include/package.json @@ -176,7 +176,7 @@ "@aws-cdk/aws-wafv2": "0.0.0", "@aws-cdk/aws-workspaces": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1", + "constructs": "4.1.1-pre.4", "yaml": "1.10.0" }, "peerDependencies": { @@ -299,7 +299,7 @@ "@aws-cdk/aws-wafv2": "0.0.0", "@aws-cdk/aws-workspaces": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "devDependencies": { "@aws-cdk/assert": "0.0.0", diff --git a/packages/@aws-cdk/core/package.json b/packages/@aws-cdk/core/package.json index aeaba60069ed4..5f3e57bc38d64 100644 --- a/packages/@aws-cdk/core/package.json +++ b/packages/@aws-cdk/core/package.json @@ -170,7 +170,7 @@ "minimatch": "^3.0.4", "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/cloud-assembly-schema": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "bundledDependencies": [ "fs-extra", @@ -180,7 +180,7 @@ "peerDependencies": { "@aws-cdk/cloud-assembly-schema": "0.0.0", "@aws-cdk/cx-api": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/custom-resources/package.json b/packages/@aws-cdk/custom-resources/package.json index f5a524e3843c1..e8959d24855aa 100644 --- a/packages/@aws-cdk/custom-resources/package.json +++ b/packages/@aws-cdk/custom-resources/package.json @@ -90,7 +90,7 @@ "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -100,7 +100,7 @@ "@aws-cdk/aws-logs": "0.0.0", "@aws-cdk/aws-sns": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/example-construct-library/package.json b/packages/@aws-cdk/example-construct-library/package.json index 8b0a4f052597e..d4d24a44bf402 100644 --- a/packages/@aws-cdk/example-construct-library/package.json +++ b/packages/@aws-cdk/example-construct-library/package.json @@ -73,7 +73,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "peerDependencies": { @@ -83,7 +83,7 @@ "@aws-cdk/aws-iam": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/core": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "engines": { "node": ">= 10.13.0 <13 || >=13.7.0" diff --git a/packages/@aws-cdk/pipelines/package.json b/packages/@aws-cdk/pipelines/package.json index 3347945180fc4..5c4d29bb28f56 100644 --- a/packages/@aws-cdk/pipelines/package.json +++ b/packages/@aws-cdk/pipelines/package.json @@ -40,7 +40,7 @@ "@aws-cdk/aws-ecr-assets": "0.0.0" }, "peerDependencies": { - "constructs": "4.1.1-pre.1", + "constructs": "4.1.1-pre.4", "@aws-cdk/core": "0.0.0", "@aws-cdk/aws-codebuild": "0.0.0", "@aws-cdk/aws-codepipeline": "0.0.0", @@ -53,7 +53,7 @@ "@aws-cdk/aws-cloudformation": "0.0.0" }, "dependencies": { - "constructs": "4.1.1-pre.1", + "constructs": "4.1.1-pre.4", "@aws-cdk/core": "0.0.0", "@aws-cdk/aws-codebuild": "0.0.0", "@aws-cdk/aws-codepipeline": "0.0.0", diff --git a/packages/@monocdk-experiment/assert/package.json b/packages/@monocdk-experiment/assert/package.json index b0960b7f49f0d..3618a8195df66 100644 --- a/packages/@monocdk-experiment/assert/package.json +++ b/packages/@monocdk-experiment/assert/package.json @@ -44,7 +44,7 @@ "ts-jest": "^26.1.1", "@monocdk-experiment/rewrite-imports": "0.0.0", "monocdk-experiment": "0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "dependencies": { "@aws-cdk/cloudformation-diff": "0.0.0" @@ -52,7 +52,7 @@ "peerDependencies": { "jest": "^25.5.4", "monocdk-experiment": "^0.0.0", - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "repository": { "url": "https://github.com/aws/aws-cdk.git", diff --git a/packages/decdk/package.json b/packages/decdk/package.json index 2695577f6f98a..5557eb4fbf2b6 100644 --- a/packages/decdk/package.json +++ b/packages/decdk/package.json @@ -177,7 +177,7 @@ "@aws-cdk/custom-resources": "0.0.0", "@aws-cdk/cx-api": "0.0.0", "@aws-cdk/region-info": "0.0.0", - "constructs": "4.1.1-pre.1", + "constructs": "4.1.1-pre.4", "fs-extra": "^9.0.1", "jsii-reflect": "^1.8.0", "jsonschema": "^1.2.6", diff --git a/packages/monocdk-experiment/package.json b/packages/monocdk-experiment/package.json index fe39d9425c767..fab5ea5161e33 100644 --- a/packages/monocdk-experiment/package.json +++ b/packages/monocdk-experiment/package.json @@ -91,7 +91,7 @@ ], "dependencies": { "case": "1.6.3", - "constructs": "4.1.1-pre.1", + "constructs": "4.1.1-pre.4", "fs-extra": "^9.0.1", "jsonschema": "^1.2.5", "minimatch": "^3.0.4", @@ -258,7 +258,7 @@ "typescript": "~3.8.3" }, "peerDependencies": { - "constructs": "4.1.1-pre.1" + "constructs": "4.1.1-pre.4" }, "homepage": "https://github.com/aws/aws-cdk", "engines": { diff --git a/tools/pkglint/lib/rules.ts b/tools/pkglint/lib/rules.ts index 01843fd7bb9ed..6ff6505fbd5be 100644 --- a/tools/pkglint/lib/rules.ts +++ b/tools/pkglint/lib/rules.ts @@ -1228,7 +1228,7 @@ export class ConstructsDependency extends ValidationRule { public readonly name = 'constructs/dependency'; public validate(pkg: PackageJson) { - const REQUIRED_VERSION = '4.1.1-pre.1'; + const REQUIRED_VERSION = '4.1.1-pre.4'; if (pkg.devDependencies?.constructs && pkg.devDependencies?.constructs !== REQUIRED_VERSION) { pkg.report({ diff --git a/yarn.lock b/yarn.lock index c014e8a13783c..63bca80386d1e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2877,10 +2877,10 @@ console-control-strings@^1.0.0, console-control-strings@~1.1.0: resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= -constructs@4.1.1-pre.1: - version "4.1.1-pre.1" - resolved "https://registry.yarnpkg.com/constructs/-/constructs-4.1.1-pre.1.tgz#a1133a4a04136b90e8d32c2a965a11114f6e405e" - integrity sha512-CxM4IGnB0Uwj0FULVW1hgbUabC2UgW22UDR/3hBK3gF7IAiZtqQKGNmV3NvhdXiMJf8GC6peeC6iCqAYufLoNA== +constructs@4.1.1-pre.4: + version "4.1.1-pre.4" + resolved "https://registry.yarnpkg.com/constructs/-/constructs-4.1.1-pre.4.tgz#0de956d23cd6a712946d206dc94f84a53376e16d" + integrity sha512-GxwtpnpmL6PYiXu4lg859uMZ5sNX4xBt8B6J8BXhCfvPM8R+0+5Zbb8y29WdECLXdr32sA6Bce1VjOJDGXm2JA== contains-path@^0.1.0: version "0.1.0" From c418fc998e4976ea48afa0275cf533f5b11daef2 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Mon, 13 Jul 2020 16:36:25 +0300 Subject: [PATCH 31/39] Revert "chore(core): allow the bundler to re-use pre-existing bundler output (#8916)" This reverts commit 31d6e6596cde03daa7de48aab8aaae1277fd405e. --- .../aws-lambda/test/integ.bundling.ts | 1 - .../test/integ.assets.bundling.lit.ts | 1 - packages/@aws-cdk/core/lib/asset-staging.ts | 102 +++------- packages/@aws-cdk/core/test/docker-stub.sh | 1 - packages/@aws-cdk/core/test/test.staging.ts | 183 ++---------------- 5 files changed, 37 insertions(+), 251 deletions(-) diff --git a/packages/@aws-cdk/aws-lambda/test/integ.bundling.ts b/packages/@aws-cdk/aws-lambda/test/integ.bundling.ts index 56c92cfbefbf6..200ca72f204b6 100644 --- a/packages/@aws-cdk/aws-lambda/test/integ.bundling.ts +++ b/packages/@aws-cdk/aws-lambda/test/integ.bundling.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import * as path from 'path'; import { App, CfnOutput, Construct, Stack, StackProps } from '@aws-cdk/core'; import * as lambda from '../lib'; diff --git a/packages/@aws-cdk/aws-s3-assets/test/integ.assets.bundling.lit.ts b/packages/@aws-cdk/aws-s3-assets/test/integ.assets.bundling.lit.ts index abcf8c9598e2a..1ba1ad26deee2 100644 --- a/packages/@aws-cdk/aws-s3-assets/test/integ.assets.bundling.lit.ts +++ b/packages/@aws-cdk/aws-s3-assets/test/integ.assets.bundling.lit.ts @@ -1,4 +1,3 @@ -/// !cdk-integ pragma:ignore-assets import * as path from 'path'; import * as iam from '@aws-cdk/aws-iam'; import { App, BundlingDockerImage, Construct, Stack, StackProps } from '@aws-cdk/core'; diff --git a/packages/@aws-cdk/core/lib/asset-staging.ts b/packages/@aws-cdk/core/lib/asset-staging.ts index 17a26e1b058ca..92a2b6b9bdf97 100644 --- a/packages/@aws-cdk/core/lib/asset-staging.ts +++ b/packages/@aws-cdk/core/lib/asset-staging.ts @@ -88,23 +88,12 @@ export class AssetStaging extends Construct { this.sourcePath = props.sourcePath; this.fingerprintOptions = props; - // Determine the hash type based on the props as props.assetHashType is - // optional from a caller perspective. - const hashType = this.determineHashType(props.assetHashType, props.assetHash); - if (props.bundling) { - // Determine the source hash in advance of bundling if the asset hash type - // is source so that the bundler can opt to re-use its bundle dir. - const sourceHash = hashType === AssetHashType.SOURCE - ? this.calculateHash(hashType, props.assetHash, props.bundling) - : undefined; - - this.bundleDir = this.bundle(props.bundling, sourceHash); - this.assetHash = sourceHash ?? this.calculateHash(hashType, props.assetHash, props.bundling); - } else { - this.assetHash = this.calculateHash(hashType, props.assetHash); + this.bundleDir = this.bundle(props.bundling); } + this.assetHash = this.calculateHash(props); + const stagingDisabled = this.node.tryGetContext(cxapi.DISABLE_ASSET_STAGING_CONTEXT); if (stagingDisabled) { this.stagedPath = this.bundleDir ?? this.sourcePath; @@ -148,37 +137,15 @@ export class AssetStaging extends Construct { } } - /** - * @Property sourceHash The source hash of the asset. If specified, the bundler - * will attempt to re-use the bundling directory, which is based on a hash of - * both the sourceHash and options. If bundling finds a pre-existing directory, - * the bundler will return it as-is and won't regenerate the bundle. - */ - private bundle(options: BundlingOptions, sourceHash?: string): string { + private bundle(options: BundlingOptions): string { // Temp staging directory in the working directory const stagingTmp = path.join('.', STAGING_TMP); fs.ensureDirSync(stagingTmp); - let bundleDir: string; - if (sourceHash) { - // When an asset hash is known in advance of bundling, bundling is done into a dedicated staging directory. - bundleDir = path.resolve(path.join(stagingTmp, 'asset-bundle-hash-' + sourceHash)); - - if (fs.existsSync(bundleDir)) { - // Pre-existing bundle directory. The bundle has already been generated once before, so lets provide it - // as-is to the caller. - return bundleDir; - } - - fs.ensureDirSync(bundleDir); - } else { - // When the asset hash isn't known in advance, bundling is done into a temporary staging directory. - - // Create temp directory for bundling inside the temp staging directory - bundleDir = path.resolve(fs.mkdtempSync(path.join(stagingTmp, 'asset-bundle-temp-'))); - // Chmod the bundleDir to full access. - fs.chmodSync(bundleDir, 0o777); - } + // Create temp directory for bundling inside the temp staging directory + const bundleDir = path.resolve(fs.mkdtempSync(path.join(stagingTmp, 'asset-bundle-'))); + // Chmod the bundleDir to full access. + fs.chmodSync(bundleDir, 0o777); let user: string; if (options.user) { @@ -214,18 +181,7 @@ export class AssetStaging extends Construct { workingDirectory: options.workingDirectory ?? AssetStaging.BUNDLING_INPUT_DIR, }); } catch (err) { - // When bundling fails, keep the bundle output for diagnosability, but - // rename it out of the way so that the next run doesn't assume it has a - // valid bundleDir. - - const bundleErrorDir = bundleDir + '-error'; - if (fs.existsSync(bundleErrorDir)) { - // Remove the last bundleErrorDir. - fs.removeSync(bundleErrorDir); - } - - fs.renameSync(bundleDir, bundleErrorDir); - throw new Error(`Failed to run bundling Docker image for asset ${this.node.path}, bundle output is located at ${bundleErrorDir}: ${err}`); + throw new Error(`Failed to run bundling Docker image for asset ${this.node.path}: ${err}`); } if (FileSystem.isEmpty(bundleDir)) { @@ -235,49 +191,35 @@ export class AssetStaging extends Construct { return bundleDir; } - /** - * Determines the hash type from user-given prop values. - * - * @param assetHashType Asset hash type construct prop - * @param assetHash Asset hash given in the construct props - */ - private determineHashType(assetHashType?: AssetHashType, assetHash?: string) { - if (assetHash) { - if (assetHashType && assetHashType !== AssetHashType.CUSTOM) { - throw new Error(`Cannot specify \`${assetHashType}\` for \`assetHashType\` when \`assetHash\` is specified. Use \`CUSTOM\` or leave \`undefined\`.`); + private calculateHash(props: AssetStagingProps): string { + let hashType: AssetHashType; + + if (props.assetHash) { + if (props.assetHashType && props.assetHashType !== AssetHashType.CUSTOM) { + throw new Error(`Cannot specify \`${props.assetHashType}\` for \`assetHashType\` when \`assetHash\` is specified. Use \`CUSTOM\` or leave \`undefined\`.`); } - return AssetHashType.CUSTOM; - } else if (assetHashType) { - return assetHashType; + hashType = AssetHashType.CUSTOM; + } else if (props.assetHashType) { + hashType = props.assetHashType; } else { - return AssetHashType.SOURCE; + hashType = AssetHashType.SOURCE; } - } - private calculateHash(hashType: AssetHashType, assetHash?: string, bundling?: BundlingOptions): string { switch (hashType) { case AssetHashType.SOURCE: - const sourceHash = FileSystem.fingerprint(this.sourcePath, this.fingerprintOptions); - if (bundling) { - return crypto.createHash('sha256') - .update(JSON.stringify(bundling)) - .update(sourceHash) - .digest('hex'); - } else { - return sourceHash; - } + return FileSystem.fingerprint(this.sourcePath, this.fingerprintOptions); case AssetHashType.BUNDLE: if (!this.bundleDir) { throw new Error('Cannot use `AssetHashType.BUNDLE` when `bundling` is not specified.'); } return FileSystem.fingerprint(this.bundleDir, this.fingerprintOptions); case AssetHashType.CUSTOM: - if (!assetHash) { + if (!props.assetHash) { throw new Error('`assetHash` must be specified when `assetHashType` is set to `AssetHashType.CUSTOM`.'); } // Hash the hash to make sure we can use it in a file/directory name. // The resulting hash will also have the same length as for the other hash types. - return crypto.createHash('sha256').update(assetHash).digest('hex'); + return crypto.createHash('sha256').update(props.assetHash).digest('hex'); default: throw new Error('Unknown asset hash type.'); } diff --git a/packages/@aws-cdk/core/test/docker-stub.sh b/packages/@aws-cdk/core/test/docker-stub.sh index fe48e93d4a207..45a78ef881ebd 100755 --- a/packages/@aws-cdk/core/test/docker-stub.sh +++ b/packages/@aws-cdk/core/test/docker-stub.sh @@ -6,7 +6,6 @@ set -euo pipefail # `/tmp/docker-stub.input` and accepts one of 3 commands that impact it's # behavior. -echo "$@" >> /tmp/docker-stub.input.concat echo "$@" > /tmp/docker-stub.input if echo "$@" | grep "DOCKER_STUB_SUCCESS_NO_OUTPUT"; then diff --git a/packages/@aws-cdk/core/test/test.staging.ts b/packages/@aws-cdk/core/test/test.staging.ts index f0553ba7b5944..bff677342bf7f 100644 --- a/packages/@aws-cdk/core/test/test.staging.ts +++ b/packages/@aws-cdk/core/test/test.staging.ts @@ -7,8 +7,6 @@ import * as sinon from 'sinon'; import { App, AssetHashType, AssetStaging, BundlingDockerImage, Stack } from '../lib'; const STUB_INPUT_FILE = '/tmp/docker-stub.input'; -const STUB_INPUT_CONCAT_FILE = '/tmp/docker-stub.input.concat'; -const STAGING_TMP_DIRECTORY = path.join('.', '.cdk.staging'); enum DockerStubCommand { SUCCESS = 'DOCKER_STUB_SUCCESS', @@ -28,12 +26,6 @@ export = { if (fs.existsSync(STUB_INPUT_FILE)) { fs.unlinkSync(STUB_INPUT_FILE); } - if (fs.existsSync(STUB_INPUT_CONCAT_FILE)) { - fs.unlinkSync(STUB_INPUT_CONCAT_FILE); - } - if (fs.existsSync(STAGING_TMP_DIRECTORY)) { - fs.removeSync(STAGING_TMP_DIRECTORY); - } cb(); sinon.restore(); }, @@ -114,6 +106,8 @@ export = { const stack = new Stack(app, 'stack'); const directory = path.join(__dirname, 'fs', 'fixtures', 'test1'); const ensureDirSyncSpy = sinon.spy(fs, 'ensureDirSync'); + const mkdtempSyncSpy = sinon.spy(fs, 'mkdtempSync'); + const chmodSyncSpy = sinon.spy(fs, 'chmodSync'); const consoleErrorSpy = sinon.spy(console, 'error'); // WHEN @@ -132,7 +126,7 @@ export = { `run --rm ${USER_ARG} -v /input:/asset-input:delegated -v /output:/asset-output:delegated -w /asset-input alpine DOCKER_STUB_SUCCESS`, ); test.deepEqual(fs.readdirSync(assembly.directory), [ - 'asset.dec215520dfd57a87aa1362e9e15131938583cd6e5a2bd9a45d38fe5dc5ab3d7', + 'asset.2f37f937c51e2c191af66acf9b09f548926008ec68c575bd2ee54b6e997c0e00', 'cdk.out', 'manifest.json', 'stack.template.json', @@ -140,8 +134,10 @@ export = { ]); // asset is bundled in a directory inside .cdk.staging - test.ok(ensureDirSyncSpy.calledWith(STAGING_TMP_DIRECTORY)); - test.ok(ensureDirSyncSpy.calledWith(path.resolve(path.join(STAGING_TMP_DIRECTORY, 'asset-bundle-hash-dec215520dfd57a87aa1362e9e15131938583cd6e5a2bd9a45d38fe5dc5ab3d7')))); + const stagingTmp = path.join('.', '.cdk.staging'); + test.ok(ensureDirSyncSpy.calledWith(stagingTmp)); + test.ok(mkdtempSyncSpy.calledWith(sinon.match(path.join(stagingTmp, 'asset-bundle-')))); + test.ok(chmodSyncSpy.calledWith(sinon.match(path.join(stagingTmp, 'asset-bundle-')), 0o777)); // shows a message before bundling test.ok(consoleErrorSpy.calledWith('Bundling asset stack/Asset...')); @@ -149,148 +145,6 @@ export = { test.done(); }, - 'bundler reuses its output when it can'(test: Test) { - // GIVEN - const app = new App(); - const stack = new Stack(app, 'stack'); - const directory = path.join(__dirname, 'fs', 'fixtures', 'test1'); - const ensureDirSyncSpy = sinon.spy(fs, 'ensureDirSync'); - - // WHEN - new AssetStaging(stack, 'Asset', { - sourcePath: directory, - bundling: { - image: BundlingDockerImage.fromRegistry('alpine'), - command: [ DockerStubCommand.SUCCESS ], - }, - }); - - new AssetStaging(stack, 'AssetDuplicate', { - sourcePath: directory, - bundling: { - image: BundlingDockerImage.fromRegistry('alpine'), - command: [ DockerStubCommand.SUCCESS ], - }, - }); - - // THEN - app.synth(); - - // We're testing that docker was run exactly once even though there are two bundling assets. - test.deepEqual( - readDockerStubInputConcat(), - `run --rm ${USER_ARG} -v /input:/asset-input:delegated -v /output:/asset-output:delegated -w /asset-input alpine DOCKER_STUB_SUCCESS`, - ); - - // asset is bundled in a directory inside .cdk.staging - test.ok(ensureDirSyncSpy.calledWith(STAGING_TMP_DIRECTORY)); - test.ok(ensureDirSyncSpy.calledWith(path.resolve(path.join(STAGING_TMP_DIRECTORY, 'asset-bundle-hash-dec215520dfd57a87aa1362e9e15131938583cd6e5a2bd9a45d38fe5dc5ab3d7')))); - - test.done(); - }, - - 'bundler considers its options when reusing bundle output'(test: Test) { - // GIVEN - const app = new App(); - const stack = new Stack(app, 'stack'); - const directory = path.join(__dirname, 'fs', 'fixtures', 'test1'); - const ensureDirSyncSpy = sinon.spy(fs, 'ensureDirSync'); - - // WHEN - new AssetStaging(stack, 'Asset', { - sourcePath: directory, - bundling: { - image: BundlingDockerImage.fromRegistry('alpine'), - command: [ DockerStubCommand.SUCCESS ], - }, - }); - - new AssetStaging(stack, 'AssetWithDifferentBundlingOptions', { - sourcePath: directory, - bundling: { - image: BundlingDockerImage.fromRegistry('alpine'), - command: [ DockerStubCommand.SUCCESS ], - environment: { - UNIQUE_ENV_VAR: 'SOMEVALUE', - }, - }, - }); - - // THEN - const assembly = app.synth(); - - // We're testing that docker was run twice - once for each set of bundler options - // operating on the same source asset. - test.deepEqual( - readDockerStubInputConcat(), - `run --rm ${USER_ARG} -v /input:/asset-input:delegated -v /output:/asset-output:delegated -w /asset-input alpine DOCKER_STUB_SUCCESS\n` + - `run --rm ${USER_ARG} -v /input:/asset-input:delegated -v /output:/asset-output:delegated --env UNIQUE_ENV_VAR=SOMEVALUE -w /asset-input alpine DOCKER_STUB_SUCCESS`, - ); - - // asset is bundled in a directory inside .cdk.staging - test.ok(ensureDirSyncSpy.calledWith(STAGING_TMP_DIRECTORY)); - - test.deepEqual(fs.readdirSync(assembly.directory), [ - 'asset.a33245f0209379d58d125d89906c2b47d38382ae745375f25697760a8c475c6b', // 'Asset' - 'asset.dec215520dfd57a87aa1362e9e15131938583cd6e5a2bd9a45d38fe5dc5ab3d7', // 'AssetWithDifferentBundlingOptions' - 'cdk.out', - 'manifest.json', - 'stack.template.json', - 'tree.json', - ]); - - test.done(); - }, - - 'bundler outputs to a temp dir when using bundle asset type'(test: Test) { - // GIVEN - const app = new App(); - const stack = new Stack(app, 'stack'); - const directory = path.join(__dirname, 'fs', 'fixtures', 'test1'); - const mkdtempSyncSpy = sinon.spy(fs, 'mkdtempSync'); - const chmodSyncSpy = sinon.spy(fs, 'chmodSync'); - - // WHEN - new AssetStaging(stack, 'Asset', { - sourcePath: directory, - assetHashType: AssetHashType.BUNDLE, - bundling: { - image: BundlingDockerImage.fromRegistry('alpine'), - command: [ DockerStubCommand.SUCCESS ], - }, - }); - - // THEN - test.ok(mkdtempSyncSpy.calledWith(sinon.match(path.join(STAGING_TMP_DIRECTORY, 'asset-bundle-temp-')))); - test.ok(chmodSyncSpy.calledWith(sinon.match(path.join(STAGING_TMP_DIRECTORY, 'asset-bundle-temp-')), 0o777)); - - test.done(); - }, - - 'bundling failure preserves the bundleDir for diagnosability'(test: Test) { - // GIVEN - const app = new App(); - const stack = new Stack(app, 'stack'); - const directory = path.join(__dirname, 'fs', 'fixtures', 'test1'); - - // WHEN - test.throws(() => new AssetStaging(stack, 'Asset', { - sourcePath: directory, - bundling: { - image: BundlingDockerImage.fromRegistry('alpine'), - command: [ DockerStubCommand.FAIL ], - }, - }), /Failed to run bundling.*asset-bundle-hash.*-error/); - - // THEN - test.ok(!fs.existsSync(path.resolve(path.join(STAGING_TMP_DIRECTORY, - 'asset-bundle-hash-e40b2b1537234d458e9e524494dc0a7a364079d457a2886a44b1f3c28a956469')))); - test.ok(fs.existsSync(path.join(STAGING_TMP_DIRECTORY, - 'asset-bundle-hash-e40b2b1537234d458e9e524494dc0a7a364079d457a2886a44b1f3c28a956469-error'))); - - test.done(); - }, - 'bundling throws when /asset-ouput is empty'(test: Test) { // GIVEN const app = new App(); @@ -374,6 +228,10 @@ export = { assetHash: 'my-custom-hash', assetHashType: AssetHashType.BUNDLE, }), /Cannot specify `bundle` for `assetHashType`/); + test.equal( + readDockerStubInput(), + `run --rm ${USER_ARG} -v /input:/asset-input:delegated -v /output:/asset-output:delegated -w /asset-input alpine DOCKER_STUB_SUCCESS`, + ); test.done(); }, @@ -433,20 +291,9 @@ export = { }, }; -// Reads a docker stub and cleans the volume paths out of the stub. -function readAndCleanDockerStubInput(file: string) { - return fs - .readFileSync(file, 'utf-8') - .trim() - .replace(/-v ([^:]+):\/asset-input/g, '-v /input:/asset-input') - .replace(/-v ([^:]+):\/asset-output/g, '-v /output:/asset-output'); -} - -// Last docker input since last teardown function readDockerStubInput() { - return readAndCleanDockerStubInput(STUB_INPUT_FILE); -} -// Concatenated docker inputs since last teardown -function readDockerStubInputConcat() { - return readAndCleanDockerStubInput(STUB_INPUT_CONCAT_FILE); + const out = fs.readFileSync(STUB_INPUT_FILE, 'utf-8').trim(); + return out + .replace(/-v ([^:]+):\/asset-input/, '-v /input:/asset-input') + .replace(/-v ([^:]+):\/asset-output/, '-v /output:/asset-output'); } From 174f80d31e1349032a9ded22430eb0ddb1c74069 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Mon, 13 Jul 2020 14:41:07 +0000 Subject: [PATCH 32/39] fixes --- packages/@aws-cdk/core/lib/cfn-element.ts | 2 +- .../lib/custom-resource-provider/custom-resource-provider.ts | 2 +- packages/@aws-cdk/core/lib/nested-stack.ts | 2 +- packages/@aws-cdk/core/lib/stack.ts | 2 +- packages/@aws-cdk/core/test/private/test.tree-metadata.ts | 2 +- packages/@aws-cdk/core/test/test.synthesis.ts | 3 --- 6 files changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/@aws-cdk/core/lib/cfn-element.ts b/packages/@aws-cdk/core/lib/cfn-element.ts index 011cf281a7044..f7f2db439ee96 100644 --- a/packages/@aws-cdk/core/lib/cfn-element.ts +++ b/packages/@aws-cdk/core/lib/cfn-element.ts @@ -2,7 +2,6 @@ import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import * as cxapi from '@aws-cdk/cx-api'; import { Construct } from 'constructs'; import { Lazy } from './lazy'; -import { Token } from './token'; const CFN_ELEMENT_SYMBOL = Symbol.for('@aws-cdk/core.CfnElement'); @@ -167,3 +166,4 @@ function notTooLong(x: string) { import { CfnReference } from './private/cfn-reference'; import { Stack } from './stack'; +import { Token } from './token'; 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 470ba19412080..c590fd64e3e89 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 @@ -1,6 +1,6 @@ -import { Construct } from 'constructs'; import * as fs from 'fs'; import * as path from 'path'; +import { Construct } from 'constructs'; import { AssetStaging } from '../asset-staging'; import { FileAssetPackaging } from '../assets'; import { CfnResource } from '../cfn-resource'; diff --git a/packages/@aws-cdk/core/lib/nested-stack.ts b/packages/@aws-cdk/core/lib/nested-stack.ts index 46f7d0a1bd8f8..402ef57f2e346 100644 --- a/packages/@aws-cdk/core/lib/nested-stack.ts +++ b/packages/@aws-cdk/core/lib/nested-stack.ts @@ -1,5 +1,5 @@ -import { Construct } from 'constructs'; import * as crypto from 'crypto'; +import { Construct } from 'constructs'; import { FileAssetPackaging } from './assets'; import { Fn } from './cfn-fn'; import { Aws } from './cfn-pseudo'; diff --git a/packages/@aws-cdk/core/lib/stack.ts b/packages/@aws-cdk/core/lib/stack.ts index 25038bc7c9eec..009d126803010 100644 --- a/packages/@aws-cdk/core/lib/stack.ts +++ b/packages/@aws-cdk/core/lib/stack.ts @@ -3,6 +3,7 @@ import * as path from 'path'; import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import * as cxapi from '@aws-cdk/cx-api'; import { Construct, IConstruct } from 'constructs'; +import { App } from './app'; import { Arn, ArnComponents } from './arn'; import { DockerImageAssetLocation, DockerImageAssetSource, FileAssetLocation, FileAssetSource } from './assets'; import { CfnElement } from './cfn-element'; @@ -1083,7 +1084,6 @@ import { DefaultStackSynthesizer, IStackSynthesizer, LegacyStackSynthesizer, ISy import { Stage } from './stage'; import { ITaggable, TagManager } from './tag-manager'; import { Token } from './token'; -import { App } from './app'; interface StackDependency { stack: Stack; diff --git a/packages/@aws-cdk/core/test/private/test.tree-metadata.ts b/packages/@aws-cdk/core/test/private/test.tree-metadata.ts index cfb8cecca0782..bf89f914a8b2a 100644 --- a/packages/@aws-cdk/core/test/private/test.tree-metadata.ts +++ b/packages/@aws-cdk/core/test/private/test.tree-metadata.ts @@ -1,9 +1,9 @@ import * as fs from 'fs'; import * as path from 'path'; import * as cxschema from '@aws-cdk/cloud-assembly-schema'; +import { Construct } from 'constructs'; import { Test } from 'nodeunit'; import { App, CfnParameter, CfnResource, Lazy, Stack, TreeInspector } from '../../lib'; -import { Construct } from 'constructs'; abstract class AbstractCfnResource extends CfnResource { constructor(scope: Construct, id: string) { diff --git a/packages/@aws-cdk/core/test/test.synthesis.ts b/packages/@aws-cdk/core/test/test.synthesis.ts index 8348476dbd0b5..446a2b396c34c 100644 --- a/packages/@aws-cdk/core/test/test.synthesis.ts +++ b/packages/@aws-cdk/core/test/test.synthesis.ts @@ -1,9 +1,6 @@ import * as fs from 'fs'; -import * as os from 'os'; import * as path from 'path'; -import * as cxschema from '@aws-cdk/cloud-assembly-schema'; import * as cxapi from '@aws-cdk/cx-api'; -import { Construct } from 'constructs'; import { Test } from 'nodeunit'; import * as cdk from '../lib'; From cacd4e7776d266443daf495dc0a40b1adf71f686 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Mon, 13 Jul 2020 15:12:08 +0000 Subject: [PATCH 33/39] a couple of fixes --- packages/@aws-cdk/aws-cloudwatch/test/test.composite-alarm.ts | 2 +- .../aws-codeguruprofiler/test/profiling-group.test.ts | 4 ++-- packages/@aws-cdk/aws-s3/test/test.bucket.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/@aws-cdk/aws-cloudwatch/test/test.composite-alarm.ts b/packages/@aws-cdk/aws-cloudwatch/test/test.composite-alarm.ts index 91443995d8dc1..1fb234f761b6e 100644 --- a/packages/@aws-cdk/aws-cloudwatch/test/test.composite-alarm.ts +++ b/packages/@aws-cdk/aws-cloudwatch/test/test.composite-alarm.ts @@ -53,7 +53,7 @@ export = { }); expect(stack).to(haveResource('AWS::CloudWatch::CompositeAlarm', { - AlarmName: 'stackCompositeAlarm5626DF56', + AlarmName: 'StackCompositeAlarm71F88779', AlarmRule: { 'Fn::Join': [ '', diff --git a/packages/@aws-cdk/aws-codeguruprofiler/test/profiling-group.test.ts b/packages/@aws-cdk/aws-codeguruprofiler/test/profiling-group.test.ts index 7bf69a8eb9945..d4e068a906f3a 100644 --- a/packages/@aws-cdk/aws-codeguruprofiler/test/profiling-group.test.ts +++ b/packages/@aws-cdk/aws-codeguruprofiler/test/profiling-group.test.ts @@ -197,7 +197,7 @@ describe('profiling group', () => { 'MyProfilingGroup829F0507': { 'Type': 'AWS::CodeGuruProfiler::ProfilingGroup', 'Properties': { - 'ProfilingGroupName': 'stackMyProfilingGroupFF8661FB', + 'ProfilingGroupName': 'StackMyProfilingGroup664763A5', }, }, }, @@ -214,7 +214,7 @@ describe('profiling group', () => { 'MyProfilingGroupWithAReallyLongProfilingGroupNameThatExceedsTheLimitOfProfilingGroupNameSizeInOrderToDoSoTheNameMustBeGreaterThanTwoHundredAndFiftyFiveCharactersInSuchCasesWePickUpTheFirstOneTwentyCharactersFromTheBeginningAndTheEndAndConca4B39908C': { 'Type': 'AWS::CodeGuruProfiler::ProfilingGroup', 'Properties': { - 'ProfilingGroupName': 'stackMyProfilingGroupWithAReallyLongProfilingGroupNameThatExceedsTheLimitOfProfilingGroupNameSizeInOrderToDoSoTheNameMuserThanTwoHundredAndFiftyFiveCharactersInSuchCasesWePickUpTheFirstOneTwentyCharactersFromTheBeginningAndTheEndAndE6003CC8', + 'ProfilingGroupName': 'StackMyProfilingGroupWithAReallyLongProfilingGroupNameThatExceedsTheLimitOfProfilingGroupNameSizeInOrderToDoSoTheNameMuserThanTwoHundredAndFiftyFiveCharactersInSuchCasesWePickUpTheFirstOneTwentyCharactersFromTheBeginningAndTheEndAndB7D9636D', }, }, }, diff --git a/packages/@aws-cdk/aws-s3/test/test.bucket.ts b/packages/@aws-cdk/aws-s3/test/test.bucket.ts index 1efd3b7813f28..4560c3d0d1a86 100644 --- a/packages/@aws-cdk/aws-s3/test/test.bucket.ts +++ b/packages/@aws-cdk/aws-s3/test/test.bucket.ts @@ -874,7 +874,7 @@ export = { 'MyBucketKeyC17130CF': { 'Type': 'AWS::KMS::Key', 'Properties': { - 'Description': 'Created by stack/MyBucket', + 'Description': 'Created by Stack/MyBucket', 'KeyPolicy': { 'Statement': [ { From 234a3951fe72d1aca79fb4298b1579dcf3f619a3 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Mon, 13 Jul 2020 15:25:49 +0000 Subject: [PATCH 34/39] fix --- packages/@aws-cdk/aws-glue/test/table.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-glue/test/table.test.ts b/packages/@aws-cdk/aws-glue/test/table.test.ts index 592fadf650165..8ed5fb3e7baec 100644 --- a/packages/@aws-cdk/aws-glue/test/table.test.ts +++ b/packages/@aws-cdk/aws-glue/test/table.test.ts @@ -385,7 +385,7 @@ test('encrypted table: SSE-KMS (implicitly created key)', () => { ], Version: '2012-10-17', }, - Description: 'Created by Table/Bucket', + Description: 'Created by Stack/Table/Bucket', })); cdkExpect(stack).to(haveResource('AWS::S3::Bucket', { From ee40f617c2377206410eb912c0f8701d7a602d0b Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Mon, 13 Jul 2020 15:49:44 +0000 Subject: [PATCH 35/39] fix a bunch of other tests --- packages/@aws-cdk/aws-certificatemanager/lib/certificate.ts | 1 + .../@aws-cdk/aws-certificatemanager/test/example.dns.lit.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-certificatemanager/lib/certificate.ts b/packages/@aws-cdk/aws-certificatemanager/lib/certificate.ts index 0a63519b1963f..df6f15f76248c 100644 --- a/packages/@aws-cdk/aws-certificatemanager/lib/certificate.ts +++ b/packages/@aws-cdk/aws-certificatemanager/lib/certificate.ts @@ -1,3 +1,4 @@ +import * as route53 from '@aws-cdk/aws-route53'; import { IResource, Resource, Token } from '@aws-cdk/core'; import { Construct } from 'constructs'; import { CfnCertificate } from './certificatemanager.generated'; diff --git a/packages/@aws-cdk/aws-certificatemanager/test/example.dns.lit.ts b/packages/@aws-cdk/aws-certificatemanager/test/example.dns.lit.ts index c2cfd41ff0e15..11a49c91ca5a5 100644 --- a/packages/@aws-cdk/aws-certificatemanager/test/example.dns.lit.ts +++ b/packages/@aws-cdk/aws-certificatemanager/test/example.dns.lit.ts @@ -1,5 +1,6 @@ import * as route53 from '@aws-cdk/aws-route53'; -import { App, CfnOutput, Construct, Stack } from '@aws-cdk/core'; +import { App, CfnOutput, Stack } from '@aws-cdk/core'; +import { Construct } from 'constructs'; import * as acm from '../lib'; class AcmStack extends Stack { From d28e49b5d9e80638881b44dcef08bf51622d88f6 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Mon, 13 Jul 2020 19:02:58 +0000 Subject: [PATCH 36/39] test fixes --- .../@aws-cdk/aws-dynamodb/test/dynamodb.test.ts | 4 +--- packages/@aws-cdk/aws-rds/lib/cluster-engine.ts | 16 ++++++++-------- packages/@aws-cdk/aws-rds/lib/instance-engine.ts | 8 ++++---- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/packages/@aws-cdk/aws-dynamodb/test/dynamodb.test.ts b/packages/@aws-cdk/aws-dynamodb/test/dynamodb.test.ts index 543d41be0b9fd..9ef8a8017cf6a 100644 --- a/packages/@aws-cdk/aws-dynamodb/test/dynamodb.test.ts +++ b/packages/@aws-cdk/aws-dynamodb/test/dynamodb.test.ts @@ -1409,9 +1409,7 @@ test('error when validating construct if a local secondary index exists without }); 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-rds/lib/cluster-engine.ts b/packages/@aws-cdk/aws-rds/lib/cluster-engine.ts index 7b5ec932e52cd..a49f99cf5b2c4 100644 --- a/packages/@aws-cdk/aws-rds/lib/cluster-engine.ts +++ b/packages/@aws-cdk/aws-rds/lib/cluster-engine.ts @@ -1,6 +1,6 @@ import * as iam from '@aws-cdk/aws-iam'; import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; -import * as core from '@aws-cdk/core'; +import { Construct } from 'constructs'; import { ClusterParameterGroup, IParameterGroup, ParameterGroup } from './parameter-group'; import { ParameterGroupFamilyMapping } from './private/parameter-group-family-mapping'; import { compare } from './private/version'; @@ -82,7 +82,7 @@ export interface IClusterEngine { /** * Method called when the engine is used to create a new cluster. */ - bindToCluster(scope: core.Construct, options: ClusterEngineBindOptions): ClusterEngineConfig; + bindToCluster(scope: Construct, options: ClusterEngineBindOptions): ClusterEngineConfig; } interface ClusterEngineBaseProps { @@ -114,7 +114,7 @@ abstract class ClusterEngineBase implements IClusterEngine { this.parameterGroupFamily = this.establishParameterGroupFamily(); } - public bindToCluster(scope: core.Construct, options: ClusterEngineBindOptions): ClusterEngineConfig { + public bindToCluster(scope: Construct, options: ClusterEngineBindOptions): ClusterEngineConfig { const parameterGroup = options.parameterGroup ?? this.defaultParameterGroup(scope); return { parameterGroup, @@ -127,7 +127,7 @@ abstract class ClusterEngineBase implements IClusterEngine { * possibly an imported one, * if one wasn't provided by the customer explicitly. */ - protected abstract defaultParameterGroup(scope: core.Construct): IParameterGroup | undefined; + protected abstract defaultParameterGroup(scope: Construct): IParameterGroup | undefined; private establishParameterGroupFamily(): string { const ret = this.calculateParameterGroupFamily(); @@ -163,7 +163,7 @@ abstract class ClusterEngineBase implements IClusterEngine { } abstract class MySqlClusterEngineBase extends ClusterEngineBase { - public bindToCluster(scope: core.Construct, options: ClusterEngineBindOptions): ClusterEngineConfig { + public bindToCluster(scope: Construct, options: ClusterEngineBindOptions): ClusterEngineConfig { const config = super.bindToCluster(scope, options); const parameterGroup = options.parameterGroup ?? (options.s3ImportRole || options.s3ExportRole ? new ClusterParameterGroup(scope, 'ClusterParameterGroup', { @@ -217,7 +217,7 @@ class AuroraClusterEngine extends MySqlClusterEngineBase { }); } - protected defaultParameterGroup(_scope: core.Construct): IParameterGroup | undefined { + protected defaultParameterGroup(_scope: Construct): IParameterGroup | undefined { // the default.aurora5.6 ParameterGroup is actually the default, // so just return undefined in this case return undefined; @@ -244,7 +244,7 @@ class AuroraMysqlClusterEngine extends MySqlClusterEngineBase { }); } - protected defaultParameterGroup(scope: core.Construct): IParameterGroup | undefined { + protected defaultParameterGroup(scope: Construct): IParameterGroup | undefined { return ParameterGroup.fromParameterGroupName(scope, 'AuroraMySqlDatabaseClusterEngineDefaultParameterGroup', `default.${this.parameterGroupFamily}`); } @@ -273,7 +273,7 @@ class AuroraPostgresClusterEngine extends ClusterEngineBase { }); } - protected defaultParameterGroup(scope: core.Construct): IParameterGroup | undefined { + protected defaultParameterGroup(scope: Construct): IParameterGroup | undefined { return ParameterGroup.fromParameterGroupName(scope, 'AuroraPostgreSqlDatabaseClusterEngineDefaultParameterGroup', `default.${this.parameterGroupFamily}`); } diff --git a/packages/@aws-cdk/aws-rds/lib/instance-engine.ts b/packages/@aws-cdk/aws-rds/lib/instance-engine.ts index 6cd17df3e52ba..3ead1c8858a35 100644 --- a/packages/@aws-cdk/aws-rds/lib/instance-engine.ts +++ b/packages/@aws-cdk/aws-rds/lib/instance-engine.ts @@ -1,7 +1,7 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; -import * as core from '@aws-cdk/core'; import { ParameterGroupFamilyMapping } from './private/parameter-group-family-mapping'; +import { Construct } from 'constructs'; /** * The options passed to {@link IInstanceEngine.bind}. @@ -47,7 +47,7 @@ export interface IInstanceEngine { /** * Method called when the engine is used to create a new instance. */ - bindToInstance(scope: core.Construct, options: InstanceEngineBindOptions): InstanceEngineConfig; + bindToInstance(scope: Construct, options: InstanceEngineBindOptions): InstanceEngineConfig; } interface InstanceEngineBaseProps { @@ -71,7 +71,7 @@ abstract class InstanceEngineBase implements IInstanceEngine { this.engineVersion = props.version; } - public bindToInstance(_scope: core.Construct, options: InstanceEngineBindOptions): InstanceEngineConfig { + public bindToInstance(_scope: Construct, options: InstanceEngineBindOptions): InstanceEngineConfig { if (options.timezone) { throw new Error(`timezone property can be configured only for Microsoft SQL Server, not ${this.engineType}`); } @@ -279,7 +279,7 @@ abstract class SqlServerInstanceEngine extends InstanceEngineBase { }); } - public bindToInstance(_scope: core.Construct, _options: InstanceEngineBindOptions): InstanceEngineConfig { + public bindToInstance(_scope: Construct, _options: InstanceEngineBindOptions): InstanceEngineConfig { return { }; } From 325cc6df9e0d31167b30576454883c5d0eb3b79a Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Mon, 13 Jul 2020 19:03:41 +0000 Subject: [PATCH 37/39] app for root stack must never "autoSynth" and use a temp directory --- packages/@aws-cdk/core/lib/stack.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/@aws-cdk/core/lib/stack.ts b/packages/@aws-cdk/core/lib/stack.ts index 009d126803010..db2c58838b772 100644 --- a/packages/@aws-cdk/core/lib/stack.ts +++ b/packages/@aws-cdk/core/lib/stack.ts @@ -309,7 +309,11 @@ export class Stack extends Construct implements ITaggable { public constructor(scope?: Construct, id?: string, props: StackProps = {}) { // For unit test scope and id are optional for stacks, but we still want an App // as the parent because apps implement much of the synthesis logic. - scope = scope ?? new App(); + scope = scope ?? new App({ + autoSynth: false, + outdir: FileSystem.mkdtemp('cdk-test-app-'), + }); + id = id ?? 'Stack'; // this will also be the default stack name super(scope, id); @@ -1084,6 +1088,7 @@ import { DefaultStackSynthesizer, IStackSynthesizer, LegacyStackSynthesizer, ISy import { Stage } from './stage'; import { ITaggable, TagManager } from './tag-manager'; import { Token } from './token'; +import { FileSystem } from './fs'; interface StackDependency { stack: Stack; From 358d177c3fe55e3e741b722be856214df75cd556 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Mon, 13 Jul 2020 19:03:54 +0000 Subject: [PATCH 38/39] implement "prepare" using aspects --- packages/@aws-cdk/pipelines/lib/stage.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/pipelines/lib/stage.ts b/packages/@aws-cdk/pipelines/lib/stage.ts index 98ec3fe50182b..6119da97669a1 100644 --- a/packages/@aws-cdk/pipelines/lib/stage.ts +++ b/packages/@aws-cdk/pipelines/lib/stage.ts @@ -1,6 +1,6 @@ import * as codepipeline from '@aws-cdk/aws-codepipeline'; import * as cpactions from '@aws-cdk/aws-codepipeline-actions'; -import { Stage } from '@aws-cdk/core'; +import { Stage, Aspects } from '@aws-cdk/core'; import * as cxapi from '@aws-cdk/cx-api'; import { Construct } from 'constructs'; import { AssetType, DeployCdkStackAction } from './actions'; @@ -55,6 +55,8 @@ export class CdkStage extends Construct { this.pipelineStage = props.pipelineStage; this.cloudAssemblyArtifact = props.cloudAssemblyArtifact; this.host = props.host; + + Aspects.of(this).apply({ visit: () => this.prepare() }); } /** @@ -176,7 +178,7 @@ export class CdkStage extends Construct { * after creation, nor is there a way to specify relative priorities, which * is a limitation that we should take away in the base library. */ - protected prepare() { + private prepare() { // FIXME: Make sure this only gets run once. There seems to be an issue in the reconciliation // loop that may trigger this more than once if it throws an error somewhere, and the exception // that gets thrown here will then override the actual failure. From 8ed24374ffb0598cf1b07eaffa5ab35a725985bb Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Tue, 14 Jul 2020 06:15:02 +0000 Subject: [PATCH 39/39] disable API compat check --- build.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 6a90f93fbbcbe..6160fe23e1c39 100755 --- a/build.sh +++ b/build.sh @@ -60,6 +60,9 @@ echo "========================================================================== echo "building..." time lerna run $bail --stream $runtarget || fail -/bin/bash scripts/check-api-compatibility.sh +echo "***************************************************************************************************" +echo " API compatibility check is disabled since this is a major version branch" +echo "***************************************************************************************************" +#/bin/bash scripts/check-api-compatibility.sh touch $BUILD_INDICATOR