Files
floci/docs/services/lightsail.md
T
Priamo Germosen 508911da33 fix(lightsail): mint an id, not the name, in a resource's ARN (#10219)
Floci minted a Lightsail resource's ARN from its name (arn:aws:lightsail:<region>:<account>:Instance/web), while AWS
mints an id for it: the Lightsail API Reference gives an instance's ARN as
arn:aws:lightsail:us-east-2:123456789101:Instance/244ad76f-8aad-4741-809f-12345EXAMPLE, and a key pair's, a static
IP's and a disk's the same way, and the Service Authorization Reference writes every Lightsail type as <Type>/${Id}.
baseResource now mints a UUID for each instance, disk, static IP and key pair it makes, so an instance made again
under a name a deleted one had gets an ARN of its own, as on AWS. A request still names a resource by its name, and a
tag call by its name or by the stored ARN, which TagResource and UntagResource already matched on the whole ARN. A
resource stored before keeps the ARN it was made with.

This is the mint the request-resources table needs before Lightsail joins it: its rows find a resource by the name a
request gives and check it on the ARN Lightsail stores.

LightsailResourceProviderTest checks that each of the four types' ARNs carries a UUID after its type, that an
instance made again under a deleted one's name gets a new ARN, and that a tag call naming that ARN tags it;
LightsailIntegrationTest checks the ARN GetInstance answers.
2026-12-05 08:33:39 -04:00

2.2 KiB

Amazon Lightsail

Floci exposes Amazon Lightsail through the AWS JSON 1.1 protocol:

  • Endpoint: POST /
  • Target prefix: Lightsail_20161128.*
  • Signing name: lightsail

The local implementation keeps Lightsail state in Floci storage and is designed for SDK and AWS CLI compatibility on common development workflows.

Supported local workflows

  • Instances: create, get, list, start, stop, reboot, delete, state lookup, and public port management
  • Disks: create, get, list, attach, detach, and delete
  • Static IPs: allocate, get, list, attach, detach, and release
  • Key pairs: create, import, get, list, delete, and download default key pair
  • Discovery: regions, blueprints, bundles, active names, operations, and operations for resource
  • Tags: tag and untag local Lightsail resources, by resourceName or resourceArn

Each resource's ARN carries an id Floci mints for it, as AWS's do (arn:aws:lightsail:us-east-1:000000000000:Instance/244ad76f-8aad-4741-809f-12345EXAMPLE), not its name; a resource stored before keeps the ARN it was made with.

Read-only list operations for cloud-side Lightsail resource families that are not locally implemented yet return empty AWS-shaped lists. Cloud-only provisioning workflows such as container services, distributions, managed databases, load balancers, buckets, and snapshots are recognized from the AWS Lightsail API model and return an explicit UnsupportedOperation error instead of a custom endpoint or non-AWS response shape.

Examples

aws --endpoint-url http://localhost:4566 lightsail get-blueprints
aws --endpoint-url http://localhost:4566 lightsail create-instances \
  --instance-names web-a \
  --availability-zone us-east-1a \
  --blueprint-id ubuntu_22_04 \
  --bundle-id nano_3_0
aws --endpoint-url http://localhost:4566 lightsail allocate-static-ip \
  --static-ip-name web-ip

aws --endpoint-url http://localhost:4566 lightsail attach-static-ip \
  --static-ip-name web-ip \
  --instance-name web-a

Persistence

Lightsail resources use StorageFactory and follow the global storage mode by default. Configure the service with:

floci:
  services:
    lightsail:
      enabled: true
  storage:
    services:
      lightsail:
        flush-interval-ms: 5000