Aws/adopt
Brownfield adoption of existing AWS infrastructure into swamp models. Discovers resources via native SDK calls, generates setup commands, and orchestrates import via a dependency-ordered workflow.
Authentication
Uses the default AWS credential chain. Requires appropriate IAM permissions for discovery (ReadOnly access to EC2, RDS, SecretsManager).
Quick Start
swamp extension pull @webframp/aws/adopt
swamp model create @webframp/aws/adopt my-discovery \
--global-arg region=us-east-1 --global-arg vpcId=vpc-xxx
swamp model method run my-discovery discover_all
# Follow the setup commands in the output, then:
swamp workflow run @webframp/adopt-stack --input vpcId=vpc-xxx| Argument | Type | Description |
|---|---|---|
| stackName | string | CloudFormation stack name (not ARN) |
| includeNested | boolean | Recurse into AWS::CloudFormation::Stack resources |
| maxDepth | number | Nested stack recursion limit |
| prefix | string | Prefix for generated swamp model names |
Resources
Orchestrate brownfield adoption of existing AWS infrastructure. Runs get and sync on pre-created swamp models in dependency order: networking first, then database, then secrets, then verification. Models must be pre-created from discover_all output before running this workflow. The workflow references models by deterministic names derived from the prefix and resource identifiers. Resources whose IDs cannot be derived from workflow inputs (subnets, route tables, security groups) should be impor
Adopt all resources defined in a CloudFormation stack into swamp typed data, comparing the stack's resource list against live AWS state. How it works: - Job 1 runs plan_stack_adoption to enumerate stack resources (recursively into nested stacks), map them to swamp types, and produce an adoption plan. - Job 2 iterates over the plan's mapped[] resources and runs `get` on each pre-existing swamp model to refresh its live state. Steps allow failure so missing models on the first run don't fai
Check for drift on all resources adopted from a CloudFormation stack. Re-runs the adoption plan to detect stack changes, then syncs each adopted model to refresh live state. The drift report compares the previous stored state against the fresh sync to surface differences. Usage: AWS_PROFILE=my-account/ReadOnlyPlus \ swamp workflow run @webframp/adopt-drift-check \ --input modelName=my-adopt \ --input stackName=my-prod-stack
Compares stored state vs live state for adopted CloudFormation stack resources and surfaces drift
Summarizes adoption workflow results with success/failure counts, per-job breakdown, and remediation guidance
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License declared1/1earned
- Verified public repository2/2earned