aws-lightsail-container-deploy
Skill1 starsChanged 13 days agoMITView on GitHub
Use when running `aws lightsail` container-service commands, deploying or redeploying a multi-container app to Lightsail, editing a Lightsail containers.json or public-endpoint.json, or debugging a Lightsail container-service error. Trigger words - create-container-service-deployment, container name rejected, image version, pod networking, deployment stuck, Lightsail logs.
In this repository30 other files it gives its agents.
- angular-crud-gotchasSkill
- bannerlord-decompileSkill
- codegen-t4-templatesSkill
- csharpSkill
- delphi-code-smellsSkill
- delphi-firedacSkill
- delphiSkill
- delphi-types-and-unitsSkill
- difftasticSkill
- dockerSkill
- efcore-aspnet-reviewSkill
- git-bash-editingSkill
- github-issue-creatorSkill
- microsoft-docsSkill
- minimal-comments-and-docsSkill
- msbuildSkill
- mssqlSkill
- mstest-assertionsSkill
- mysqlSkill
- nginx-config-testingSkill
- odata-generated-gridsSkill
- postgresSkill
- powershellSkill
- react-crud-gotchasSkill
- sanitize-for-open-sourceSkill
- self-contained-deploymentSkill
- skill-writerSkill
- ui-conventionsSkill
- verify-in-running-appSkill
- winui3Skill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 40
No per-container DNS: All containers in one deployment share a single network namespace (pod-style).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AWS Lightsail Container Service Deploy
Load this before writing any aws lightsail container-service command or touching containers.json — the API and runtime model here diverge from both plain ECS and Docker Compose in ways that produce confusing errors if you guess.
Quick start — the correct deploy sequence
# 1. Get the CURRENT highest version for every image — never assume/increment manually, never use ":latest"
aws lightsail get-container-images --service-name <service> --query "containerImages[].image"
# 2. Push a new image, note the printed version it lands on
aws lightsail push-container-image --service-name <service> --label <label> --image <local-image>:local
# 3. Update containers.json with the new numeric version for the image(s) that changed
# 4. Deploy — containers and publicEndpoint are SEPARATE flags, not one --cli-input-json payload
aws lightsail create-container-service-deployment \
--service-name <service> \
--containers file://containers.json \
--public-endpoint file://public-endpoint.json
# 5. Poll the DEPLOYMENT state (not the service state) until ACTIVE
aws lightsail get-container-services --service-name <service> \
--query "containerServices[0].currentDeployment.{version:version,state:state}"
# 6. On failure, pull real logs per-container rather than guessing
aws lightsail get-container-log --service-name <service> --container-name <name> --query "logEvents[-20:]"Core rules
- Container names: hyphens only, no underscores — must match
^(?:[a-z0-9]{1,2}|[a-z0-9][a-z0-9-]+[a-z0-9])$. - Image versions are numeric-only — there is no
:latest/.LATEST. Always re-checkget-container-imagesright before deploying. create-container-service-deploymenttakes--containers file://...and--public-endpoint file://...as separate parameters — never--cli-input-jsonwith the container map as the whole payload.- No per-container DNS. All containers in one deployment share a single network namespace (pod-style). Reach a sibling via
localhost:<port>, never its container name — that only works in Docker Compose. - Only one container per deployment can be public (
publicEndpoint). Multiple logically-public services (SPA + API) need a reverse-proxy container (nginx) as the sole public endpoint, routing internally overlocalhost. Side effect: same-origin, so no CORS needed. - No
depends_onequivalent — containers start in parallel with no ordering guarantee. Anything that resolves a sibling hostname at startup (e.g. nginxproxy_pass) needs lazy/per-request resolution, not a literal target, or it can crash before a sibling is even up. - Two different
statefields: the container service's state (RUNNINGwhile it serves a deployment, seen live) vs. an individual deployment's state (ACTIVATING→ACTIVE/FAILED, superseded ones goINACTIVE). ARUNNINGservice says nothing about the new deployment, so poll the deployment.ACTIVATINGcan legitimately sit for several minutes. - No IaC path fits this well — it's CLI-managed (
push-container-image+create-container-service-deployment), not Terraform/CloudFormation-first for a small service like this. - Secrets live in plain env vars inside
containers.json— there's no secrets-manager integration at this tier. Gitignore the real file; keep a redacted.examplesibling checked in for shape.
In the Critical Viewer repo the whole sequence is scripted: python tools/deploy/lightsail/lightsail_deploy.py status | push | deploy | logs (checks the rules above, picks the highest numeric image version, polls the deployment state, prints redacted logs on failure; run deploy --dry-run first).
Full symptom → cause → fix detail (exact error text as seen) for every rule above: see REFERENCE.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

