Skip to main content

Aws/adopt

@webframp/aws/adoptv2026.05.28.1· 5d agoMODELS·WORKFLOWS·REPORTS
01README

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
02Models1
@webframp/aws/adoptv2026.05.28.1aws/adopt.ts
fn discover_vpcs()
Discover existing VPCs
fn discover_subnets()
Discover existing subnets
fn discover_gateways()
Discover existing internet gateways
fn discover_route_tables()
Discover existing route tables
fn discover_security_groups()
Discover existing security groups
fn discover_rds_clusters()
Discover existing RDS clusters
fn discover_rds_instances()
Discover existing RDS instances
fn discover_db_subnet_groups()
Discover existing DB subnet groups
fn discover_secrets()
Discover existing Secrets Manager secrets
fn discover_all()
Run full discovery and generate setup commands for brownfield adoption
fn plan_stack_adoption(stackName: string, includeNested: boolean, maxDepth: number, prefix: string)
Enumerate all resources in a CloudFormation stack, map to swamp types, and build an adoption plan
ArgumentTypeDescription
stackNamestringCloudFormation stack name (not ARN)
includeNestedbooleanRecurse into AWS::CloudFormation::Stack resources
maxDepthnumberNested stack recursion limit
prefixstringPrefix for generated swamp model names

Resources

discovery(24h)— Full discovery result with setup commands and workflow guidance
partial(24h)— Single resource-type discovery result
stackPlan(7d)— CloudFormation stack adoption plan with mapped/unmapped/skipped/orphan resources
03Workflows3
@webframp/adopt-stackeb3aa3b7-04c5-4f62-81fb-f150fcf820dc

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-networkingImport networking resources starting with the VPC
1.get-vpc${{ inputs.prefix }}-vpc-${{ inputs.vpcSuffix }}.get— Adopt the target VPC by running get with its identifier
adopt-databaseImport RDS database resources that depend on networking
1.get-db-subnet-group${{ inputs.prefix }}-dbsubnet-${{ inputs.dbSubnetGroupName }}.get— Adopt the DB subnet group
2.get-rds-cluster${{ inputs.prefix }}-cluster-${{ inputs.clusterIdentifier }}.get— Adopt the RDS cluster by its identifier
adopt-secretsImport secrets associated with adopted resources
1.get-secret${{ inputs.prefix }}-secret-${{ inputs.secretName }}.get— Adopt the secret by its ARN
verify-adoptionVerify adopted resources by syncing live state
1.sync-vpc${{ inputs.prefix }}-vpc-${{ inputs.vpcSuffix }}.sync— Sync VPC model to confirm live state matches
2.sync-rds-cluster${{ inputs.prefix }}-cluster-${{ inputs.clusterIdentifier }}.sync— Sync RDS cluster model to confirm live state matches
@webframp/adopt-cfn-stackc0875484-1d77-4a65-8779-d5e5c4626b81

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

planEnumerate stack resources and build adoption plan
1.plan-resources${{ inputs.modelName }}.plan_stack_adoption— Map CloudFormation resources to swamp types
executeRefresh live state on each mapped swamp model
1.get-${{ self.resource.logicalId }}${{ self.resource.modelName }}.get— Adopt ${{ self.resource.cfnType }} via its swamp model
@webframp/adopt-drift-check7b52035f-ceb3-40cb-aa52-d46b6cb76e20

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

planRe-enumerate stack resources to detect additions/removals
1.plan-resources${{ inputs.modelName }}.plan_stack_adoption
sync-allSync each adopted model to refresh live state
1.sync-${{ self.resource.logicalId }}${{ self.resource.modelName }}.sync— Sync ${{ self.resource.modelName }}
04Reports2
@webframp/adopt-drift-reportworkflow
adopt_drift_report.ts

Compares stored state vs live state for adopted CloudFormation stack resources and surfaces drift

awsadoptiondriftcloudformation
@webframp/adopt-reportworkflow
adopt_report.ts

Summarizes adoption workflow results with success/failure counts, per-job breakdown, and remediation guidance

awsadoptionbrownfieldimport
05Previous Versions2
2026.05.21.1May 22, 2026
2026.05.18.1May 20, 2026
06Stats
A
100 / 100
Downloads
4
Archive size
715.6 KB
  • 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
07Platforms
08Labels