Aws/drift State
Unified drift detection surface that composes observations from existing models (adopt, inventory, terraform, config, dns) into queryable versioned state.
This higher-order model makes zero AWS API calls. It reads upstream model data via the swamp data repository and produces typed drift state: baselines, drift results, timelines, and velocity metrics.
Quick Start
# Pull the extension
swamp extension pull @webframp/aws/drift-state
# Create the drift-state model (after upstream models exist)
swamp model create @webframp/aws/drift-state drift-state
# Set baselines from current upstream data
swamp model method run drift-state set_baseline
# Later: compute drift against baselines
swamp model method run drift-state compute_drift
# Query drifted resources
swamp model method run drift-state get_drifted
# View drift timeline for a resource
swamp model method run drift-state get_drift_timeline \
--input '{"canonicalId": "arn:aws:ec2:us-east-1:123456:vpc/vpc-abc"}'
# Run the full refresh workflow (syncs upstream + recomputes)
swamp workflow run @webframp/drift-state-refreshMethods
- compute_drift — Compare latest upstream snapshots against baselines
- set_baseline — Mark current upstream state as expected
- get_drifted — Query resources currently in drifted state
- get_drift_timeline — History of drift events for a resource
- get_drift_velocity — Aggregate drift rate metrics
- refresh — Recompute drift from current upstream data
Upstream Sources
@webframp/aws/adopt(required) — VPCs, subnets, gateways, route tables, security groups, RDS@webframp/aws/inventory(required) — EC2, RDS, DynamoDB, Lambda, S3, EBS@webframp/terraform(optional) — All Terraform-managed resources. If not installed, terraform is reported inunavailableSourcesand skipped gracefully.@webframp/aws/config-compliance(optional) — AWS Config non-compliant resources. If not installed, config is reported inunavailableSources.@webframp/aws/dns-observation(optional) — Orphaned DNS records pointing at decommissioned infrastructure. If not installed, dns is reported inunavailableSources.@webframp/aws/event-topology(optional) — Event graph topology (EventBridge, SNS, SQS, Lambda ESM). If not installed, event_topology is reported inunavailableSources.
| Argument | Type | Description |
|---|---|---|
| sources? | array | Upstream sources to compose. Omit for all available. |
| adoptModelName? | string | Name of the @webframp/aws/adopt model instance |
| inventoryModelName? | string | Name of the @webframp/aws/inventory model instance |
| terraformModelName? | string | Name of the @webframp/terraform model instance |
| configModelName? | string | Name of the @webframp/aws/config-compliance model instance |
| dnsModelName? | string | Name of the @webframp/aws/dns-observation model instance |
| topologyModelName? | string | Name of the @webframp/aws/event-topology model instance |
| staleThresholdMinutes? | number | Data older than this (minutes) is flagged as stale |
| Argument | Type | Description |
|---|---|---|
| source | enum | Which upstream source to baseline |
| adoptModelName? | string | Name of the @webframp/aws/adopt model instance |
| inventoryModelName? | string | Name of the @webframp/aws/inventory model instance |
| terraformModelName? | string | Name of the @webframp/terraform model instance |
| configModelName? | string | Name of the @webframp/aws/config-compliance model instance |
| dnsModelName? | string | Name of the @webframp/aws/dns-observation model instance |
| topologyModelName? | string | Name of the @webframp/aws/event-topology model instance |
| Argument | Type | Description |
|---|---|---|
| resourceType? | string | Filter by AWS resource type (e.g., AWS::EC2::VPC) |
| source? | string | Filter by detection source (adopt, inventory, terraform) |
| Argument | Type | Description |
|---|---|---|
| canonicalId | string | Canonical resource ID (ARN or composite key) |
| limit? | number | Maximum events to return |
| Argument | Type | Description |
|---|---|---|
| adoptModelName? | string | Name of the @webframp/aws/adopt model instance |
| inventoryModelName? | string | Name of the @webframp/aws/inventory model instance |
| terraformModelName? | string | Name of the @webframp/terraform model instance |
| configModelName? | string | Name of the @webframp/aws/config-compliance model instance |
| dnsModelName? | string | Name of the @webframp/aws/dns-observation model instance |
| topologyModelName? | string | Name of the @webframp/aws/event-topology model instance |
Resources
Refresh upstream models and recompute drift state. Runs discover_all (adopt), inventory_scan (inventory), get_non_compliant (config), detect_orphans (dns), and discover (event-topology) in parallel, then computes drift against stored baselines.
2026.06.27.3
Added: @webframp/aws/dns-observation as 5th upstream source. Orphaned DNS
records (pointing at decommissioned ELBs, CloudFront distributions, S3 buckets,
or stale IPs) now surface as drifted resources with detectionSource: "dns".
normalizeDnsResourcesmaps orphan records to NormalizedResourcednsModelNameargument added tocompute_drift,set_baseline,refreshdrift-state-refreshworkflow gains parallelrefresh-dnsjob
2026.06.27.2
Added: @webframp/aws/config-compliance as 4th upstream source. AWS Config
non-compliant resources now appear as drifted with detectionSource: "config".
- Refactored normalizer dispatch into SOURCES/NORMALIZERS registry pattern
configModelNameargument added to all methods
2026.06.27.1
Added: Initial release of @webframp/aws/drift-state — unified drift
detection model that composes observations from adopt, inventory, and terraform
models into queryable versioned state.
Methods: compute_drift, set_baseline, get_drifted, get_drift_timeline,
get_drift_velocity, refresh.
Includes companion workflow @webframp/drift-state-refresh for automated
upstream sync + drift computation.
Modified 1 workflows. updated labels
2026.06.27.3
Added: @webframp/aws/dns-observation as 5th upstream source. Orphaned DNS
records (pointing at decommissioned ELBs, CloudFront distributions, S3 buckets,
or stale IPs) now surface as drifted resources with detectionSource: "dns".
normalizeDnsResourcesmaps orphan records to NormalizedResourcednsModelNameargument added tocompute_drift,set_baseline,refreshdrift-state-refreshworkflow gains parallelrefresh-dnsjob
2026.06.27.2
Added: @webframp/aws/config-compliance as 4th upstream source. AWS Config
non-compliant resources now appear as drifted with detectionSource: "config".
- Refactored normalizer dispatch into SOURCES/NORMALIZERS registry pattern
configModelNameargument added to all methods
2026.06.27.1
Added: Initial release of @webframp/aws/drift-state — unified drift
detection model that composes observations from adopt, inventory, and terraform
models into queryable versioned state.
Methods: compute_drift, set_baseline, get_drifted, get_drift_timeline,
get_drift_velocity, refresh.
Includes companion workflow @webframp/drift-state-refresh for automated
upstream sync + drift computation.
Modified 1 workflows. updated labels
2026.06.27.1
Added: Initial release of @webframp/aws/drift-state — unified drift
detection model that composes observations from adopt, inventory, and terraform
models into queryable versioned state.
Methods: compute_drift, set_baseline, get_drifted, get_drift_timeline,
get_drift_velocity, refresh.
Includes companion workflow @webframp/drift-state-refresh for automated
upstream sync + drift computation.
Modified 1 workflows
2026.06.27.1
Added: Initial release of @webframp/aws/drift-state — unified drift
detection model that composes observations from adopt, inventory, and terraform
models into queryable versioned state.
Methods: compute_drift, set_baseline, get_drifted, get_drift_timeline,
get_drift_velocity, refresh.
Includes companion workflow @webframp/drift-state-refresh for automated
upstream sync + drift computation.
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License declared1/1earned
- Verified public repository2/2earned