Skip to main content
← Back to list
01Issue
BugClosedSwamp Club
AssigneesNone

Delete method uses identifier as data name instead of instance name

Opened by swampadmin · 7/11/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:

  1. Data naming failure for resources with / in identifiers: Routes have composite identifiers like rtb-xxx|0.0.0.0/0 where the CIDR block contains /. When delete tries to write data with this as the name, it fails with "Data name must not contain '/'".

  2. 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

  1. Create a route model with DestinationCidrBlock: "0.0.0.0/0"
  2. Run the create method — succeeds, data written under instance name
  3. Run the delete method — fails on context.writeResource("state", args.identifier, ...) because args.identifier is rtb-xxx|0.0.0.0/0 which 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 /
02Bog Flow
OPENTRIAGEDIN PROGRESSCLOSED

Closed

No activity in this phase yet.

03Sludge Pulse

Sign in to post a ripple.