Local Testing — AWS (Floci)
Show the whole prompt
Read https://intentius.io/chant/local-testing/aws/.
In `examples/local-cloud-trio`, run `npm install` and then `npx chant run aws --no-record`. The run boots Floci and applies the stack with `awsApply`. It checks the bucket and then tears Floci down, and it needs Docker.
Keep the `endpoint` override on `http://localhost:4566`, and show me what the run prints.
Never deploy to a real cloud account or shared environment (with `chant run`, `chant components` or a platform's own CLI), approve (a pull request review, `chant approve` or `chant run approve`), override a policy denial (`chant approve policy-override`), or merge; never cut or publish a release (`chant release cut --yes` or `chant release publish`), push or delete a `ci/*` tag (`chant ci tick` pushes them), or change the value of an existing flag; never touch `.chant/allowed_signers` or `chant/lifecycle`.Optional: hand this page to your coding agent
Read https://intentius.io/chant/local-testing/aws/.In `examples/local-cloud-trio`, run `npm install` and then `npx chant run aws --no-record`. The run boots Floci and applies the stack with `awsApply`. It checks the bucket and then tears Floci down, and it needs Docker.Keep the `endpoint` override on `http://localhost:4566`, and show me what the run prints.Never deploy to a real cloud account or shared environment (with `chant run`, `chant components` or a platform's own CLI), approve (a pull request review, `chant approve` or `chant run approve`), override a policy denial (`chant approve policy-override`), or merge; never cut or publish a release (`chant release cut --yes` or `chant release publish`), push or delete a `ci/*` tag (`chant ci tick` pushes them), or change the value of an existing flag; never touch `.chant/allowed_signers` or `chant/lifecycle`.AWS keeps CloudFormation as its native format. awsApply deploys the built template by calling the CloudFormation API directly — create-or-update the stack, then poll it to a settled state — against Floci’s emulated control plane or real AWS by endpoint override. Like azApply and gcpApply, it calls the API over HTTP instead of running aws cloudformation deploy.
The resource
Section titled “The resource”An S3 bucket, described as data. It synthesizes to CloudFormation:
export const bucket = new Bucket({ BucketName: "chant-trio-bucket", PublicAccessBlockConfiguration: { BlockPublicAcls: true, BlockPublicPolicy: true, IgnorePublicAcls: true, RestrictPublicBuckets: true, },});The op
Section titled “The op”chant run aws boots Floci, builds the stack, applies it with awsApply, verifies the bucket over the S3 API, and tears the emulator down. Every phase is a modeled activity — no raw shell.
export default Op({ name: "aws", taskQueue: "trio-aws", phases: [ phase("Emulator", [flociUp({ dockerSocket: true })]), phase("Build", [build(".", { script: "build:aws" })]), phase("Apply", [awsApply("dist/aws.json", { stackName: "trio-aws", endpoint: "http://localhost:4566" })]), phase("Verify", [httpCheck("http://localhost:4566/chant-trio-bucket")]), phase("Teardown", [flociDown()]), ],});flociUp starts the pinned floci/floci:1.5.34 image unless image names
another one. Pass network to join the container to a Docker network, and
loopback: true to publish its port on 127.0.0.1 only. Extra Floci
variables go in settings and reach the container as -e KEY=VALUE; a key
that does not start with FLOCI_ is refused.
flociUp({ image: "floci/floci:<tag>", network: "loom-local", loopback: true })The same options exist on chant emulator up as
--image, --network, --setting and --loopback.
How awsApply works
Section titled “How awsApply works”CloudFormation is a control plane: you submit a template to a named stack and it reconciles. awsApply drives that plane through its API, no CLI in between:
- Reads the built template and calls
DescribeStacksto decide create vs update. CreateStackorUpdateStackwith the template body and capabilities. A no-op update (real AWS’s “No updates are to be performed”) is treated as unchanged.- Polls
DescribeStacksuntil the stack settles —CREATE_COMPLETE/UPDATE_COMPLETE— and fails the phase on a*_FAILED/ROLLBACKstate.
The stack is the deploy boundary, so deletes ride CloudFormation itself — awsDelete calls DeleteStack and polls until the stack is gone. No separate prune.
Run it
Section titled “Run it”Requires Docker.
cd examples/local-cloud-trionpm installchant run awsFrom local to real cloud
Section titled “From local to real cloud”Drop the endpoint override and awsApply targets real CloudFormation. The template, the create-or-update logic, and the settle-polling are unchanged — only the API host differs.