cdkd deploy: wait mode details
cdkd deploy has three wait modes: the default, --no-wait and
--full-wait. This page describes, resource by resource, what a mode leaves
unfinished when the deploy returns, and what happens when a wait runs out.
cdkd deploy explains the modes and
has the table of affected resource types.
cdkd deploy MyStack --no-wait # return as early as possible
cdkd deploy MyStack --full-wait # wait as long as CloudFormation would
What --no-wait leaves unfinished
Under --no-wait, cdkd returns as soon as AWS accepts the create call. AWS
finishes the resource in the background, and the resource is fully functional
once that work is done. Until then, the cases below need care.
When the deploy needs a resource it did not wait for
A skipped wait still runs, later in the same deploy, in three cases:
A value. A
Fn::GetAttof an attribute that exists only once the resource is ready waits for it, then reads the resource again. Examples are theEndpoint.Addressof an RDS, DocumentDB or Neptune cluster or instance, an ElastiCache endpoint, and an EC2 instance'sPrivateIp. An attribute that exists at once, such as an ARN, does not wait.Code that runs during the deploy. Before cdkd invokes a custom resource's handler, it waits for every such resource upstream of the custom resource and of its handler function, through
DependsOn,RefandFn::GetAtt, transitively. That covers a handler in a VPC that reaches the internet through a NAT gateway, which the CDK expresses only through the subnet's default route.A call AWS refuses until the resource is ready. This case is added per type, only where AWS was measured to refuse the call:
- associating an Elastic IP with an instance this deploy launched or
restarted (an update that stopped and started it) waits for the instance
to be
running; - creating or updating an
AWS::BedrockAgentCore::RuntimeEndpointwaits for its runtime to beREADY. AWS refuses it before then:Agent version 1 must be in READY status. Current status: CREATING.
Measured and not waited for, because AWS accepts the call or no resource makes it:
- an
AWS::RDS::DBProxyTargetGroupregisters a DB instance or Aurora cluster that is stillcreating(its target readsREGISTERING); - no CloudFormation resource uses an
AWS::Lambda::MicrovmImage; a microVM is started from it withRunMicrovm, outside the template, and a custom resource that starts one waits for the image as above; - an
AWS::CertificateManager::CertificatestillPENDING_VALIDATIONis not waited for, even by the CloudFront distribution or listener that uses it. That is deliberate:--no-waitexists to keep such a certificate while you add its DNS validation records, and waiting forISSUEDwould remove that.
- associating an Elastic IP with an instance this deploy launched or
restarted (an update that stopped and started it) waits for the instance
to be
A resource that only depends on a skipped-wait resource, through DependsOn
or a reference, does not wait for it. A resource that nothing needs this way
costs nothing.
Each resource's wait runs once, however many references or custom resources
need it, and is the same wait the default mode runs, bounded by that type's
--resource-timeout. A resource that ends failed fails the deploy, as it does
in the default mode. The resource that needed it is not created, and the
rollback deletes the failed resource. Ctrl-C stops the wait.
The resource types that take part are the ones in the
wait table: ECS services
(steady state), ACM certificates, RDS, DocumentDB and Neptune clusters and
instances, ElastiCache cache clusters, NAT gateways, EC2 instances (also after
an update's stop and start), load balancers (active), Lambda MicroVM images,
Bedrock AgentCore runtimes, EventBridge archives, Connect instances, GameLift
game server groups and VPC endpoints, on create and, where the update skips the wait, on update. These waits stay
skipped:
- an RDS, DocumentDB or Neptune update's waits for a changed setting to apply
or read back: the database stays available while the change applies. The
exception is a value the change moves: an update that changes an RDS DB
instance's
Port,CACertificateIdentifierorMultiAZrecords the attribute it moves (Endpoint.Port,CertificateDetails,SecondaryAvailabilityZone) only once AWS reports the change applied. A CA certificate rotated withoutCertificateRotationRestart: trueis waited for only when the engine version rotates certificates without a restart (the instance switches within seconds). Otherwise nothing waits for it, as in CloudFormation, and the certificate the instance reports (the one in use) is recorded, as CloudFormation returns it. Otherwise, until the change applies, aFn::GetAttof it waits for the change, then reads the resource again, so it never gets the old value, and a custom resource downstream of the resource waits for the change before its handler runs; - a load balancer's capacity reservation: the load balancer serves at once;
- an Auto Scaling group's instance refresh: the group keeps serving while it replaces instances.
NAT gateway
Routes that need only the gateway's ID are created while the gateway is still
pending. A custom resource whose handler runs in a subnet routed through
the gateway waits for it to become available before the handler is invoked
(see above), so a
handler that calls an external service reaches it.
A NAT gateway's RouteTableId and EniId exist only once it is available.
A Fn::GetAtt of either, or of AutoProvisionZones / AutoScalingIps, on a
gateway still pending waits for it to become available, up to 10 minutes,
and then reads the value from AWS. Only a gateway that something references
pays for that wait. When no value comes, the reference is refused with the
cause rather than answered with the gateway's ID: the gateway stayed
pending, it failed, or AWS reports none, as for a regional gateway's EniId.
VPC endpoint
An Interface endpoint is pending for 30 to 50 seconds after the create call
returns. Resources that need only its ID, its DNS names or its network
interfaces are created at once: all three are in the create call's answer. A
custom resource the endpoint is upstream of, such as one in the VPC that
reads a secret through it, waits for it to be available before its handler
is invoked (see
above). Another
resource that calls the service through the endpoint during the deploy can
still fail until it is available.
An update that changes the subnets, security groups, policy, private DNS,
DNS options or IP address type returns the endpoint to pending. A
Fn::GetAtt of DnsEntries or NetworkInterfaceIds after such an update
waits for it to become available, through the same shared wait, and then
reads the value from AWS. An endpoint an earlier --no-wait deploy left
pending is waited for directly, up to 10 minutes.
EC2 instance
cdkd normally checks that the instance's IamInstanceProfile was attached.
Under --no-wait it skips that check and prints a warning that names the
instance. An instance that declares Volumes or SsmAssociations is the
exception: attaching a volume needs a running instance, and an SSM
association needs the instance profile this check confirms, so it waits for
running and gets the check too. The association itself is not waited on:
the deploy returns while it is still Pending, as CloudFormation does.
The check exists because RunInstances attaches an instance profile
asynchronously, and can finish with none attached when the profile was created
moments earlier. AWS rejects the association on a pending instance, so cdkd
cannot verify it without waiting. To verify it yourself afterwards:
aws ec2 describe-iam-instance-profile-associations \
--filters Name=instance-id,Values=<instance-id>
A public address that AWS has not assigned yet is left out of state. cdkd
reads it from AWS again when something refers to it, and a Fn::GetAtt of an
address on an instance this deploy launched waits for it to be running
first.
Elastic IP attached to an instance of the same deploy
This case is an Elastic IP whose InstanceId is an instance that the same
deploy creates. AWS refuses to associate an address with an instance that is
not running, so under --no-wait the association waits for the instance's
skipped running wait (see
below), then
associates. Only an instance whose wait was not skipped in this deploy keeps
the earlier behavior:
- On create, cdkd allocates the address and skips the association.
- On update, cdkd attempts the association and warns if AWS rejects it.
Both warnings print the exact aws ec2 associate-address command to run once
the instance is up. Repointing an Elastic IP at an instance that is already
running still works.
Load balancer
cdkd returns while the load balancer is provisioning. Its DNSName answers
with HTTP 503 until the load balancer is active.
A load balancer with a capacity reservation has a second wait, and
--no-wait skips that one too. The reservation applies when the template sets
MinimumLoadBalancerCapacity with
EnableCapacityReservationProvisionStabilize: true. In the default mode cdkd
polls DescribeCapacityReservation until every zone reports provisioned,
for about ten minutes at most. If the poll times out, cdkd warns and
continues. A zone that reports failed is an error.
ACM certificate
cdkd returns while the certificate is PENDING_VALIDATION. A certificate that
is not issued makes a CloudFront distribution or a load balancer that uses it
fail to create, which is why the default mode waits for ISSUED.
In the default mode, when that wait runs out, cdkd deletes the certificate it
requested, so that repeated attempts do not pile up certificates. ACM reuses a
domain's validation CNAME across certificates, so DNS records you add after
the failure still validate the next attempt. Use --no-wait to keep a
PENDING_VALIDATION certificate instead. See
Troubleshooting.
AWS::Lambda::MicrovmImage
cdkd returns while the image is CREATING. The image's ARN is available
first, so stack outputs that use it still work.
AWS::BedrockAgentCore::Runtime
cdkd returns while the runtime is CREATING or UPDATING, so a runtime that
ends in CREATE_FAILED or UPDATE_FAILED does not fail the deploy. Its id
and ARN are available first. A later delete of the runtime, by cdkd destroy
or a replacement, waits for it to leave CREATING / UPDATING first, in
every mode. A runtime endpoint created or updated on it in the same deploy
waits for it to be READY, which AWS requires (see
above).
AWS::Events::Archive
cdkd returns while the archive is CREATING or UPDATING, so an archive
that ends in CREATE_FAILED or UPDATE_FAILED does not fail the deploy, and
events sent before it is ENABLED are not archived. Its name and ARN are
available first.
AWS::Connect::Instance
cdkd returns while the instance is still CREATION_IN_PROGRESS: once it
accepts dependent calls, about 20 s after CreateInstance, and cdkd has
written the declared Attributes. One case waits longer: when the template
declares false for one of the members the instance turns on by itself
(ContactLens, EarlyMedia, AutoResolveBestVoices, MultiPartyConference,
MultiPartyChatConference, EnhancedContactMonitoring,
EnhancedChatMonitoring, MessageStreaming). cdkd then waits until those
defaults have landed (about 40 s), because a false written earlier would be
overwritten by them. A true, or any other member, is written at once.
Storage configs, contact flows, Lambda associations and the other resources
that reference the instance are created then, and they stay in place when
the instance turns ACTIVE. The instance can still end CREATION_FAILED
after the deploy returns, and that does not fail the deploy. Its ID and ARN
are available first. A Fn::GetAtt of ServiceRole still waits for
ACTIVE, up to 10 minutes, because the role exists only then. Only an instance whose ServiceRole something references
pays for that wait.
AWS::GameLift::GameServerGroup
cdkd returns once GameLift accepts the group, while it is NEW or
ACTIVATING and GameLift is still building its Auto Scaling group. A group
that ends in ERROR does not fail the deploy. Its name and ARN are available
first. A Fn::GetAtt of AutoScalingGroupArn still waits for ACTIVE
(about 35 s), because the Auto Scaling group exists only then.
Auto Scaling group instance refresh
With --update-policy, an Auto Scaling group whose AutoScalingRollingUpdate
or AutoScalingInstanceRefresh policy applies to the update starts an
instance refresh. Under --no-wait, cdkd returns once AWS accepts
StartInstanceRefresh. The refresh keeps replacing instances in the
background, and a refresh that fails does not fail the deploy. To wait
manually:
aws autoscaling describe-instance-refreshes --auto-scaling-group-name <group>
An AutoScalingReplacingUpdate still waits under --no-wait: cdkd deletes
the old group only once the new group's instances are in service, since
deleting it earlier would leave the group's capacity at zero.
Lambda alias CodeDeploy deployment
With --update-policy, a Lambda alias whose CodeDeployLambdaAliasUpdate
policy applies to the update shifts its traffic to the new version through a
CodeDeploy deployment. cdkd waits for that deployment under --no-wait too:
the alias serves the previous version until the shift ends, and the same
deploy can delete that version (a CDK currentVersion without a RETAIN
removal policy is a new resource on every code change), which would cut off
the traffic still routed to it.
ECS service
cdkd returns once CreateService or UpdateService is accepted, and prints
the command to wait manually:
aws ecs wait services-stable --cluster <cluster> --services <service>
The service's Name and ServiceArn are valid at once, so the rest of the
deploy is unaffected. What the deploy no longer tells you is whether the
rollout succeeded: a service whose tasks crash or whose image cannot be pulled
deploys with exit 0. Use this for a first deploy before the image is pushed,
a fast iteration loop, or a pipeline that runs its own health check.
The waits --no-wait never skips
A custom resource's handler function in a VPC keeps CDK's ordering in every
mode: it is created only once the private subnet's default route exists. cdkd
normally drops that DependsOn for speed (see
--no-aggressive-vpc-parallel),
but not for a function upstream of a custom resource or a nested stack,
because the handler runs during the deploy and may reach the internet through
the route.
An AWS::EC2::Subnet with Ipv6CidrBlock or Ipv6IpamPoolId waits in every
mode. On create, cdkd waits for the IPv6 association to be associated before
the ModifySubnetAttribute wiring (DNS64, AssignIpv6AddressOnCreation,
PrivateDnsNameOptionsOnLaunch) and observed-state capture. For a block
allocated from an IPAM pool, when the create response names no association,
cdkd first reads the subnet for it, up to 10 times about 2 seconds apart. In-place CIDR changes wait for both
disassociation and association. Each wait polls at most 30 times and honors
interrupts and resource deadlines. A failed create wait enters the cleanup for
the newly created subnet.
A Lambda-backed custom resource is one wait that every mode keeps. Just before
cdkd invokes the Lambda function behind an
AWS::CloudFormation::CustomResource, it waits for the function to be
Active with LastUpdateStatus: Successful. Without that wait the invoke
fails with The function is currently in the following state: Pending.
The same invoke also waits for IAM to propagate the permissions this deploy
wrote upstream of the custom resource: an AWS::IAM::Role, AWS::IAM::Policy
or AWS::IAM::ManagedPolicy created or updated in the deploy holds the invoke
until 10 seconds after its write, and only for what remains of that time. IAM
accepts a write at once but applies it later, and a handler that runs before
then is denied. Under the CDK Provider framework that denial costs up to five
minutes, because its onEvent waits for the user handler before giving up.
Nothing else waits for
an IAM write: a function using the role, or a Fn::GetAtt of its Arn,
proceeds at once. The custom resource that starts a wait with time still left
prints one Waiting for IAM to propagate line naming those writes; a write
whose 10 seconds have already passed holds nothing and is not named.
The wait belongs to that invoke only. An ordinary Lambda create or update
returns as soon as the API call returns. When a deploy updates a function that
is still Pending from its create, AWS refuses the change, so cdkd then waits
for the function to be Active and sends the change again. The wait takes at
most 10 minutes and happens only after that refusal. A Lambda Managed Instances function is
the other wait every mode keeps, on create, update and delete: the version it
publishes launches its capacity, and AWS refuses the next call until that
settles.
A resource whose properties name a function the deploy created and left
Pending waits for the function to be Active before cdkd creates or
updates it, as CloudFormation does: AWS refuses some such calls until then,
for example publishing an AWS::Lambda::Version or creating an
AWS::Logs::SubscriptionFilter that delivers to the function. Only the types
known to accept a Pending function skip that wait:
Accepts a Pending function |
Types |
|---|---|
| Lambda | Permission, Url, EventInvokeConfig, EventSourceMapping |
| Event sources and APIs | AWS::Events::Rule, AWS::SNS::Subscription, AWS::ApiGateway::Method, AWS::ApiGatewayV2::Integration, AWS::Cognito::UserPool, AWS::StepFunctions::StateMachine |
| Other | AWS::CloudWatch::Alarm, AWS::IAM::Policy, AWS::IAM::ManagedPolicy, AWS::IAM::Role |
So a Lambda function in a VPC whose dependents are all of those types does not hold the deploy for the 5 to 10 minutes its network interface takes to attach.
An AWS::RDS::DBProxy and an AWS::RDS::DBProxyEndpoint wait in every mode
too. A create returns only once the proxy or endpoint is available, and so
does an update that calls ModifyDBProxy or ModifyDBProxyEndpoint; a
tag-only change returns at once. RDS refuses the next modify or delete
of a proxy or endpoint that is still modifying. That includes the call a
rollback replays, so returning early would only move the failure later.
An AWS::AppSync::GraphQLSchema waits in every mode as well. AppSync applies
a schema asynchronously, so a create or a schema change returns only once
GetSchemaCreationStatus leaves PROCESSING; the rollback of a schema change
and a cdkd drift --revert wait the same way. This is the resource's own
completion, not a readiness wait: until then the API still serves the previous
schema, which the drift baseline would record, and a schema AppSync refuses
reads FAILED, which fails the resource as CloudFormation does (AWS's reason
is in the --verbose output). The wait polls up to 15 minutes (an explicit
--resource-timeout below 30 minutes lowers it to half of that value), and
honors Ctrl-C.
AWS::Lambda::NetworkConnector
A Lambda network connector also waits in every mode. Its create returns only
once the connector leaves PENDING for ACTIVE, which takes about four
minutes. AWS rejects any AWS::Lambda::WebFunctionRevision whose
ServiceConfig.EgressNetworkConnectorArn names a connector that is not
ACTIVE yet:
The egress network connector arn:aws:lambda:...:network-connector:<id>:1 is in
PENDING state. Only network connectors in ACTIVE state can be used.
Returning early would therefore not shorten a deploy:
| Layout | Effect of returning early |
|---|---|
| Connector and revisions in one stack | The revision create fails with the error above. |
| Connector in its own stack, revisions in a dependent stack | The dependent stack deploys next and fails the same way. |
| Connector stack deployed alone | Only the terminal frees up sooner; the next deploy that uses the connector still waits. |
The four-minute wait belongs to the connector's create. A deploy that leaves
the connector unchanged does not touch it, so adding or updating web functions
that use an existing connector does not wait for it. Keeping the wait also
means a connector that ends in FAILED fails the deploy that created it,
rather than surfacing later as a revision error.
ECS service steady state
The default waits for an ECS service, on create and on update, because
accepting CreateService or UpdateService says nothing about whether the
rollout will succeed. --full-wait waits the same way, and --no-wait skips
it (see ECS service above).
The service is done when it is stable and its rollout has completed:
| Step | Limit | When it ends badly |
|---|---|---|
| Wait for steady state | 600 seconds | The deploy fails. |
The deployment this deploy started turns FAILED |
Checked on every poll | The deploy fails at once. |
| The service settles on a different deployment | Checked once stable | The deploy fails. |
Poll the primary deployment's rolloutState until COMPLETED |
About two minutes | cdkd warns and continues. |
With a deployment circuit breaker,
the wait ends as soon as ECS gives a verdict. The breaker marks a failing
deployment FAILED, and with Rollback: true it returns the service to its
last completed deployment. Either way the deploy fails with a message naming
the circuit breaker. Without a breaker, a service that never stabilizes fails
at the wait limit.
A service can need longer than 600 seconds because of a large task count, a slow image pull or a long health-check grace period. Raise the limit for that type; the timeout message names the flag:
cdkd deploy MyStack --resource-timeout AWS::ECS::Service=20m
--resource-timeout can only
raise this limit. It never lowers it.
Every failure message carries the aws ecs list-tasks --desired-status STOPPED
and describe-tasks commands that show why the tasks stopped. Stopped tasks
stay visible for about an hour.
| Operation | What cdkd does when the wait fails |
|---|---|
| Create | Deletes the new service, so the next deploy does not collide on the name, then fails the deploy. |
| Update | Fails the deploy and leaves the service in place; the automatic rollback re-applies its previous configuration. |
Automatic rollback, cdkd rollback |
Warns and continues, so a rollout that does not settle never leaves the stack unable to roll back. |
cdkd drift --revert does not wait for an ECS service at all, and no mode
waits for a service whose DeploymentController is CODE_DEPLOY or
EXTERNAL, because ECS has no deployment of its own to settle for those.
What --full-wait adds
--full-wait adds four waits that CloudFormation performs and cdkd skips by
default: a CloudFront distribution reaching Deployed, a Multi-AZ RDS DB
cluster reaching available after an instance class or storage change, an RDS
DB instance reaching available before and after its parameter group reboot,
and a Route 53 change reaching INSYNC.
cdkd deploy MyStack --full-wait
AWS::CloudFront::Distribution: Deployed
By default cdkd returns after the create or update call, and prints the command to wait manually:
aws cloudfront wait distribution-deployed --id <distribution-id>
The default does not wait because the outcome is settled once the call is
accepted: AWS refuses a configuration error in the call itself. The wait
changes only when the edge locations serve the distribution, never whether
they will, and its Id and DomainName are final in the create or update
response.
Under --full-wait, cdkd waits about 20 minutes. To wait longer, raise the
limit for the type:
cdkd deploy MyStack --full-wait \
--resource-timeout AWS::CloudFront::Distribution=40m
As with ECS, the flag can only raise the limit.
A CloudFront wait that runs out does not fail the deploy. A distribution that
is still InProgress is slow and not broken, and failing would make the
automatic rollback disable and delete a healthy distribution. cdkd warns,
prints the manual wait command, and continues.
AWS::RDS::DBCluster (Multi-AZ): available after a class or storage change
After an update changes a Multi-AZ DB cluster's DBClusterInstanceClass,
AllocatedStorage, Iops or StorageType, the default waits until the new
class and storage read back with no storage change pending. The cluster can be
available or storage-optimization at that point. RDS can keep a cluster in
storage-optimization for hours after the change is in place, and the cluster
serves on its new class and storage meanwhile.
RDS rolls a class change across the cluster's three instances one at a time,
with a failover, which can take longer than 30 minutes. So a DB cluster update
gets the larger of 90 minutes and a bare --resource-timeout. A
TYPE=DURATION value for AWS::RDS::DBCluster replaces that limit, so
AWS::RDS::DBCluster=20m gives 20 minutes.
--full-wait also waits for available, as CloudFormation does. A storage
optimization can run past 90 minutes, so raise the limit for the type when you
use --full-wait on such an update:
cdkd deploy MyStack --full-wait \
--resource-timeout AWS::RDS::DBCluster=6h
A wait that runs out fails the update.
AWS::RDS::DBInstance: parameter group settle and reboot
When an instance's parameter group reads applying or pending-reboot after
an update, cdkd waits for the group to settle. A group left pending-reboot
is then rebooted, and cdkd waits for it to read in-sync. Both waits accept
an instance in storage-optimization as well as available. A storage change
in the same update can hold the instance in storage-optimization for hours
after the new size is in place, and the instance serves meanwhile. The same
waits after a read replica's or restored instance's create still require
available.
--full-wait waits for available, as CloudFormation does. Raise the limit
for the type when a storage change rides the same update:
cdkd deploy MyStack --full-wait \
--resource-timeout AWS::RDS::DBInstance=6h
An AWS::DynamoDB::GlobalTable update that changes a Kinesis streaming
destination's ApproximateCreationDateTimePrecision first waits, in every
mode, while that destination reads UPDATING or ENABLING: a --no-wait
deploy can leave it so, and AWS refuses the update until it is ACTIVE
(Updates are only allowed in ACTIVE state). A wait that runs out fails the
update without sending it, and the deploy may retry it.
The waits after a delete, such as a Bedrock AgentCore runtime's, are listed under Destroy always waits; a deploy that deletes or replaces a resource runs them too.
Route 53: INSYNC
Every hosted zone create and delete, record set and record set group change,
and private-zone VPC association or disassociation returns a change that is
PENDING until every Route 53 DNS server has it. By default cdkd returns while
it is PENDING:
| What | Usable at once | Time to INSYNC |
|---|---|---|
| Hosted zone create | Yes: records can be added at once | 24-30 s (CloudFormation 42-51 s) |
| Hosted zone delete | Yes: the zone is gone at once | 24-28 s (CloudFormation about 42 s) |
| Record change | Yes: drift and later calls read it at once | 26-37 s (CloudFormation 32-43 s) |
| Record delete | Yes | About 26 s (CloudFormation about 32 s) |
| VPC association or disassociation | Yes | 78-81 s (CloudFormation's update about 103 s) |
Route 53 has no failure state for a PENDING change, so the wait changes only
when DNS resolvers see the change. Use --full-wait when a step right after
the deploy resolves the name. Under --full-wait, a wait that runs out warns
and the deploy continues, with the command to wait manually:
aws route53 wait resource-record-sets-changed --id <change-id>
Destroy always waits
cdkd destroy has no wait flags. These waits run on every destroy:
| Resource | Wait |
|---|---|
| NAT gateway | Until deleted |
| VPC endpoint | Until it is gone (an Interface endpoint about 2 minutes) |
| CloudFront distribution | Disable, then wait |
| Kinesis stream, Firehose delivery stream | Until the stream is gone |
| Kinesis stream consumer | Until the consumer is gone (3-4 s) |
| Step Functions state machine with a running execution | Until it is gone, up to 10 minutes |
| Lambda network connector | Until the connector is gone |
| Amazon Connect instance | Until DeleteInstance is accepted: an instance refuses it for its first 20 s or so. The instance is gone from DescribeInstance at once, but its alias stays reserved for a few seconds more, so a create that reuses the alias waits for it to be released, up to 3 minutes |
| ECS service | Until INACTIVE |
| GameLift game server group | Until it is gone (about 90 s while GameLift removes its Auto Scaling group, unless DeleteOption: RETAIN keeps it) |
| DynamoDB table, DynamoDB global table and its replicas | Until the table is gone, in every replica region |
| RDS, DocumentDB and Neptune cluster or instance, ElastiCache cache cluster | Until it is gone |
| VPC whose CIDR came from an IPAM pool | Until the pool releases the VPC's allocation (about 18 minutes) |
| Subnet whose CIDR came from an IPAM pool | Until the pool releases the subnet's allocation (about 19 minutes for an IPv4 block, about 25 for an IPv6 one) |
| IPAM pool CIDR refused while deleted resources' allocations remain | Until the pool releases them, then delete again |
Bedrock AgentCore runtime still CREATING or UPDATING |
Until it leaves that status, then delete (up to 30 minutes) |
| Bedrock AgentCore runtime after its delete | Until it is gone (about 3 minutes) |
Each wait is there for a reason:
A Bedrock AgentCore runtime that a
--no-waitor interrupted deploy leftCREATINGorUPDATINGis waited out before the delete. If the wait runs out, or the runtime cannot be read, cdkd sends the delete anyway.A Bedrock AgentCore runtime stays
DELETINGfor about 3 minutes and keeps its name, so a deploy right after the destroy, or a replacement, would fail withConflictException. cdkd waits until it is gone, as CloudFormation does, for up to 10 minutes. If this wait runs out, cdkd warns and moves on.A NAT gateway that is still
deletingblocks the deletes of its subnet, internet gateway and VPC withDependencyViolation.A VPC endpoint that is still
deletingkeeps its network interfaces, which block the deletes of its subnets, security groups and VPC withDependencyViolation.The CloudFront API requires a distribution to be disabled before it can be deleted.
A Kinesis or Firehose stream keeps its name while it is
DELETING, so a deploy right after the destroy would fail withalready exists. If this wait runs out, cdkd warns and moves on.A Kinesis stream consumer keeps its name on the stream while it is
DELETING, so registering it again right away fails withalready exists. cdkd waits until it is gone, as CloudFormation does.A Step Functions state machine stays
DELETINGuntil its running executions end, keeping its name, so a deploy that adds it back fails withStateMachineDeleting. Its role would also be deleted while those executions still run. cdkd checks for a running execution before the delete and, when there is one, waits until the state machine is gone, as CloudFormation does, for up to 10 minutes. If this wait runs out, cdkd warns and moves on;aws stepfunctions stop-executionends it sooner. With no running execution, cdkd does not wait.A Lambda network connector reports
DELETINGbefore it is gone, so cdkd waits until AWS no longer returns it, about 3 seconds, before reporting it deleted. A connector that ends inDELETE_FAILEDfails the destroy.An ECS service is still
DRAININGwhenDeleteServicereturns. Until it isINACTIVE, its dependents cannot be removed: an ECS gateway, for one, refuses its delete while the cluster association stays active. cdkd waits forINACTIVE(or for the service to be gone), as CloudFormation does, for up to 600 seconds or the--resource-timeoutset forAWS::ECS::Serviceif longer. A wait that runs out fails the delete.A DynamoDB table stays
DELETINGafterDeleteTablereturns, and a global table's copy in each replica region staysDELETINGfor minutes after the source table stops listing it. Until they are gone, a dependent such as a KMS key would be deleted under a live table. cdkd waits for every copy, the replica regions in parallel, for up to about 12 minutes. If this wait runs out, cdkd warns and moves on.AWS releases a deleted VPC's IPAM pool allocation late, around 18 minutes after
DeleteVpcreturns, and until then the pool refuses to deprovision its CIDR (The CIDR has one or more allocations.). So destroying a VPC whose CIDR came from an IPAM pool takes that long. cdkd waits for the pool to stop listing the allocation for up to 25 minutes. If this wait runs out, or the role cannot callec2:GetIpamPoolAllocations, cdkd warns and moves on.An IPAM pool CIDR whose delete is refused with
The CIDR has one or more allocations.waits too, when the pool still lists allocations of VPCs or subnets that are already deleted, in your account and the stack's region. cdkd waits up to another 25 minutes (or half the--resource-timeoutyou set for the type) for AWS to release them, then deletes the pool CIDR again. An allocation held by a live resource fails the delete at once, as CloudFormation's own pool CIDR delete does. If the wait runs out, or the role cannot callec2:GetIpamPoolAllocations, cdkd warns, the destroy stops at the pool CIDR, and it can be re-run.A subnet whose IPv4 or IPv6 CIDR came from an IPAM pool holds its allocation past the delete the same way, so cdkd waits for each pool the subnet names to stop listing it. An IPv4 and an IPv6 pool share one 25-minute cap, with the same warning. AWS releases an IPv4 allocation about 19 minutes after
DeleteSubnetreturns, and an IPv6 one about 25 minutes after (1523 seconds, measured in us-east-1 on 2026-11-07), past that cap: the subnet delete then warns and moves on, and the pool CIDR's delete above waits out the rest.An RDS, DocumentDB or Neptune cluster or instance, or an ElastiCache cache cluster, can take ten minutes or more to delete. cdkd waits for it to be gone, so a delete that is still running is not reported as done. If this wait runs out, the delete fails.
Related
- cdkd deploy: the modes and the table of affected types
- Choose a Wait Mode: the same choice, summarized for a first read
- cdkd deploy: tuning:
--resource-timeoutin full - cdkd deploy: the stack lock: why a second deploy can start during these waits