Skip to main content

Dynamodb Datastore Bootstrap

@webframp/dynamodb-datastore-bootstrapv2026.07.22.1· 2d agoMODELSWORKFLOWS
01README

One-shot bootstrap for @webframp/dynamodb-datastore. Ships a single provisioner model that creates a DynamoDB table (with GSI and TTL) and a least-privilege IAM managed policy, plus a workflow that runs the provisioner and then switches the current swamp repository over to the DynamoDB datastore.

Prerequisites

  • AWS credentials in the default credential chain (env / profile / role) with permissions to create the DynamoDB table, enable TTL, and create the managed policy.
  • The caller that will run swamp after setup must already hold, or will attach, the managed policy produced by this workflow.

What it does

  1. provision creates a DynamoDB table (PAY_PER_REQUEST, pk/sk key schema, GSI gsi1 for sync walks, TTL on ttl attribute) and a scoped IAM managed policy granting the seven runtime actions limited to that table.
  2. A final command/shell step runs swamp datastore setup extension @webframp/dynamodb-datastore --config ... to flip the repo's datastore to DynamoDB.

Running

swamp extension pull @webframp/dynamodb-datastore-bootstrap

swamp model create @webframp/dynamodb-datastore-bootstrap/provisioner \
  swamp-dynamodb-provisioner

swamp model create command/shell swamp-dynamodb-setup

swamp workflow run @webframp/bootstrap-dynamodb-datastore \
  --input region=us-east-1

swamp datastore status

See the bundled README for optional inputs (table_name, policy_name), the exact IAM policy produced, and idempotency notes.

02Release Notes

2026.07.22.1

Added: One-shot bootstrap for @webframp/dynamodb-datastore. Ships a provisioner model that creates a DynamoDB table (PAY_PER_REQUEST, GSI gsi1, TTL on ttl) and a scoped IAM managed policy (7 actions), plus a workflow that runs the provisioner and switches the repo datastore to DynamoDB.

Added: Full idempotency — re-running the provisioner against existing infrastructure is a no-op that reports tableCreated: false and policyCreated: false.

Added: TOCTOU-safe policy creation — concurrent provisioner runs will not fail if the policy is created between the existence check and the create call.

03Models1
@webframp/dynamodb-datastore-bootstrap/provisionerv2026.07.22.1provisioner.ts
fn provision()
Create/verify the DynamoDB table and scoped IAM managed policy for @webframp/dynamodb-datastore.

Resources

state(infinite)— DynamoDB table + IAM managed policy provisioned for swamp.
04Workflows1
@webframp/bootstrap-dynamodb-datastoref8d2a1c3-5e7b-4f9a-b6d0-8c4e2a1f3d5b

Provision a DynamoDB table + least-privilege IAM managed policy for @webframp/dynamodb-datastore, then switch the current repo to use DynamoDB. After completion the repo is configured. Verify with `swamp datastore status`.

infraCreate the DynamoDB table and IAM managed policy.
1.provisionswamp-dynamodb-provisioner.provision— Run the provisioner model to create/verify the table + scoped managed policy. Instance `swamp-dynamodb-provisioner` must be pre-created with globalArguments wired to the workflow inputs: table_name: ${{ inputs.table_name }} region: ${{ inputs.region }} policy_name: ${{ inputs.policy_name }}
configurePoint this repo's datastore at the new DynamoDB table.
1.run-setupswamp-dynamodb-setup.execute— Run `swamp datastore setup extension @webframp/dynamodb-datastore`.
05Stats
A
100 / 100
Downloads
0
Archive size
8.5 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
06Platforms
07Labels