aws-samples / aws-samples/sample-autonomous-cloud-coding-agents
bug(cdk): AgentCore runtime leaks ENIs that block cdk destroy; Memory undeletable while CREATING
- Dominant language
- TypeScript
- Stars
- 143
- Forks
- 46
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 20
Description
### Observed (live, us-east-1, 2026-07-31, ADR-021 P1 verification run)
1. **`cdk destroy` of the agent stack hung >1h40m and ended `DELETE_FAILED`**: two service-managed `agentic_ai` ENIs (AgentCore runtime) remained attached to the platform VPC's private subnets after the runtime resource was deleted, blocking deletion of both private subnets and the runtime SG. The stack had to be left in `DELETE_FAILED` (zero-cost residue: VPC shell, 2 subnets, 1 SG) pending eventual ENI release and a delete retry.
2. **`AWS::BedrockAgentCore::Memory` cannot be deleted while in `CREATING`** — a teardown racing a slow Memory creation wedges.
### Impact
Any operator tearing down a deployment (ephemeral stacks, #72's scheduled cleanup) hits multi-hour destroy times or `DELETE_FAILED` states through no fault of their own.
### Proposal
- Investigate whether AgentCore ENI release can be awaited or forced (custom resource that waits/detaches on stack deletion, similar to VPC-lambda ENI cleanup patterns)
- Guard Memory deletion on reaching a stable state
- At minimum: document the expected destroy latency + retry procedure in the developer guide
Not specific to the Lambda MicroVMs backend — observed on the AgentCore substrate during unrelated verification. Refs #645.
Contributor guide
Research direction
Start by reproducing the AgentCore teardown behavior in us-east-1 and read ADR-021, with the related context in #645. Compare the proposed ENI cleanup and Memory deletion guard against the documented minimum fix; done means destroy completes without DELETE_FAILED, or the developer guide clearly documents expected latency and retry steps.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws
- Domain
- cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100