Skip to main content

Aws/adopt

@webframp/aws/adoptv2026.07.30.1· 2d agoMODELSWORKFLOWSREPORTS
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
02Release Notes

2026.07.30.1

Added: Optional profile global argument for multi-account credential resolution. When set, credentials resolve via fromIni (supports SSO token cache and shared-config profiles). When omitted, the default credential chain applies as before. Fully backward compatible — no changes required for existing instances.

03Models1
@webframp/aws/adoptv2026.07.30.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
04Workflows3
@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 }}
05Reports2
@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
06Previous Versions12
2026.07.29.1

2026.07.29.1

Fixed: Terminate upgrade chain at current version (extension was uninstallable due to broken upgrade chain).

2026.07.27.1

Changed: Bump @aws-sdk/* 3.1094.0 → 3.1096.0 (4 packages)

Changed: Bump @swamp/aws/ec2 2026.07.20.1 → 2026.07.27.1

Changed: Bump @swamp/aws/rds 2026.07.20.1 → 2026.07.27.1

Changed: Bump @swamp/aws/secretsmanager 2026.07.20.1 → 2026.07.27.1

2026.07.26.1

Fixed: Model failed to load because the upgrades array's last toVersion ("2026.07.18.2") did not match the model's current version ("2026.07.24.1"). Swamp's model loader enforces this invariant, causing the extension to be rejected at load time before any AWS API calls could execute. This manifested as silent failures in ECS Fargate environments where the error was not surfaced to the operator.

Upgrade note: Users on 2026.07.24.1 can upgrade in place. The upgrade chain now covers all published versions (2026.07.18.2 → 2026.07.24.1 → 2026.07.26.1) with no schema changes at any step.

updated dependencies

2026.07.26.1

2026.07.26.1

Fixed: Model failed to load because the upgrades array's last toVersion ("2026.07.18.2") did not match the model's current version ("2026.07.24.1"). Swamp's model loader enforces this invariant, causing the extension to be rejected at load time before any AWS API calls could execute. This manifested as silent failures in ECS Fargate environments where the error was not surfaced to the operator.

Upgrade note: Users on 2026.07.24.1 can upgrade in place. The upgrade chain now covers all published versions (2026.07.18.2 → 2026.07.24.1 → 2026.07.26.1) with no schema changes at any step.

2026.07.24.1

2026.07.24.1

Changed: Bump AWS SDK from 3.1091.0 to 3.1094.0 (patch-level update).

Changed: Bump dependency pins to latest published versions:

  • @swamp/aws/ec2 2026.04.03.2 → 2026.07.20.1
  • @swamp/aws/rds 2026.04.23.2 → 2026.07.20.1
  • @swamp/aws/secretsmanager 2026.06.15.1 → 2026.07.20.1

updated dependencies

2026.07.21.1

2026.07.21.1

Changed: Bumped AWS SDK dependencies to 3.1091.0 (from 3.1090.0).

Upgrade note: No behavioral changes. Routine dependency maintenance.

2026.07.18.2

2026.07.18.2

Added: An upgrades array entry (no-op) to adopt.ts for proper typeVersion tracking on existing instances. No schema or behavior changes.

2026.07.18.1

Added: @module-level JSDoc documentation to adopt.ts.

Changed: Bumped @aws-sdk/client-cloudformation, @aws-sdk/client-ec2, @aws-sdk/client-rds, and @aws-sdk/client-secrets-manager from 3.1069.0 to 3.1090.0 for dependency freshness. No behavior change.

2026.07.16.1

Fixed: The pinned dependency on @swamp/aws/secretsmanager@2026.05.18.1 no longer resolved in the registry, which broke swamp extension pull for this extension and for anything depending on it transitively (e.g. @webframp/aws/drift-state). Bumped the pin to 2026.06.15.1, the current published version. This extension only references the secretsmanager model type name in generated setup commands — it doesn't call into the package's code — so there's no behavior change beyond the pull now succeeding.

2026.07.18.1

2026.07.18.1

Added: @module-level JSDoc documentation to adopt.ts.

Changed: Bumped @aws-sdk/client-cloudformation, @aws-sdk/client-ec2, @aws-sdk/client-rds, and @aws-sdk/client-secrets-manager from 3.1069.0 to 3.1090.0 for dependency freshness. No behavior change.

2026.07.16.1

Fixed: The pinned dependency on @swamp/aws/secretsmanager@2026.05.18.1 no longer resolved in the registry, which broke swamp extension pull for this extension and for anything depending on it transitively (e.g. @webframp/aws/drift-state). Bumped the pin to 2026.06.15.1, the current published version. This extension only references the secretsmanager model type name in generated setup commands — it doesn't call into the package's code — so there's no behavior change beyond the pull now succeeding.

2026.07.16.1

2026.07.16.1

Fixed: The pinned dependency on @swamp/aws/secretsmanager@2026.05.18.1 no longer resolved in the registry, which broke swamp extension pull for this extension and for anything depending on it transitively (e.g. @webframp/aws/drift-state). Bumped the pin to 2026.06.15.1, the current published version. This extension only references the secretsmanager model type name in generated setup commands — it doesn't call into the package's code — so there's no behavior change beyond the pull now succeeding.

updated dependencies

2026.06.23.1
2026.06.15.1
2026.05.28.1

Modified 1 models. Added 2 workflows. Added 1 reports

2026.05.21.1
2026.05.18.1
07Stats
A
100 / 100
Downloads
30
Archive size
524.6 KB
  • 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
08Platforms
09Labels