Delete method uses identifier as data name instead of instance name
Opened by swampadmin · 8/1/2025
Summary
The generated AWS extension model delete methods use args.identifier as the data name when calling context.writeResource(), while create methods use the instance name from globalArguments. This causes two problems:
Data naming failure for resources with
/in identifiers: Routes have composite identifiers likertb-xxx|0.0.0.0/0where the CIDR block contains/. When delete tries to write data with this as the name, it fails with "Data name must not contain '/'".Create and delete write to different data names: Create writes to the instance name (e.g.,
public-rt), but delete writes to the AWS identifier (e.g.,rtb-04331d1cdfab6c613). These are different data entries, so delete doesn't update the state that create established.
Steps to Reproduce
- Create a route model with
DestinationCidrBlock: "0.0.0.0/0" - Run the create method — succeeds, data written under instance name
- Run the delete method — fails on
context.writeResource("state", args.identifier, ...)becauseargs.identifierisrtb-xxx|0.0.0.0/0which contains/
Affected Code
All generated AWS extension models follow this pattern in their delete method:
const handle = await context.writeResource("state", args.identifier, {
identifier: args.identifier,
existed,
status: existed ? "deleted" : "not_found",
deletedAt: new Date().toISOString(),
});Should instead use the instance name (consistent with create):
const handle = await context.writeResource("state", instanceName, {
identifier: args.identifier,
existed,
status: existed ? "deleted" : "not_found",
deletedAt: new Date().toISOString(),
});Environment
- Discovered while running a production VPC delete workflow with EC2 route models
- Affects all AWS extension models, but only manifests when identifiers contain path-unsafe characters like
/
Closed
No activity in this phase yet.
Sign in to post a ripple.