Salta ai contenuti

Deploy your Astro Site to AWS with SST

Questi contenuti non sono ancora disponibili nella tua lingua.

You can deploy an Astro site to AWS using SST, an open-source framework for deploying modern full-stack applications with SSG and SSR support.

You can also use any additional SST components like Cron Jobs, Buckets, Queues, etc while maintaining type-safety.

  1. Create an astro project.

  2. Run npx sst@latest init.

  3. It should detect that you are using Astro and ask you to confirm.

  4. Once you’re ready for deployment you can run npx sst deploy --stage production.

You can also read the full Astro on AWS with SST tutorial that will guide you through the steps.

To use any additional SST components, add them to sst.config.ts.

sst.config.ts
const bucket = new sst.aws.Bucket("MyBucket", {
access: "public",
});
new sst.aws.Astro("MyWeb", {
link: [bucket],
});

And then access them in your .astro file.

---
import { Resource } from "sst"
console.log(Resource.MyBucket.name)
---

Consult the SST docs on linking resources to learn more.

If you have any questions, you can ask in the SST Discord.

Altre Guide di Pubblicazione

Contribuisci

A cosa stai pensando?

Crea una Issue su GitHub

Il modo più rapido per segnalare un problema al nostro team.

Comunità
京ICP备15031610号-99