Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ✨ sst #149

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

feat: ✨ sst #149

wants to merge 9 commits into from

Conversation

KevinWu098
Copy link
Member

@KevinWu098 KevinWu098 commented Feb 3, 2025

Summary

  1. Sets up SST

v2 -> v3

Config

Using the config section on the v2 -> v3 migration guide

v2

  config(_input) {
    return {
      name: "ZotMeet",
      region: "us-east-1",
    };
  },

v3

    app(input) {
        return {
            name: "ZotMeet",
            removal: input?.stage === "production" ? "retain" : "remove",
            protect: ["production"].includes(input?.stage),
            home: "aws",
        };
    },

App

  1. Stack no longer exists
  2. CDK no longer exists

Migrated domain name and dns zone as per this AWS guide

v2

  stacks(app) {
    app.stack(function Site({ stack }) {
      if (!process.env.CERTIFICATE_ARN) {
        throw new Error("Certificate ARN not provided.");
      }
      const site = new SvelteKitSite(stack, "site", {
        customDomain: {
          domainName: `${stack.stage === "prod" ? "" : `${stack.stage}.`}zotmeet.com`,
          hostedZone: "zotmeet.com",
          cdk: {
            // @ts-expect-error Constructs types are broken, see https://github.com/sst/sst/issues/3483
            certificate: Certificate.fromCertificateArn(
              stack,
              "MyCert",
              process.env.CERTIFICATE_ARN,
            ),
          },
        },
      });
      stack.addOutputs({ url: site.url });
    });
  },

v3

    async run() {
        new sst.aws.Nextjs("site", {
            domain: {
                name: `${$app.stage === "prod" ? "" : `${$app.stage}.`}zotmeet.com`,
                dns: sst.aws.dns({
                    zone: "zotmeet.com",
                }),
            },
        });
    },

Closes #144

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add deployment for SST v3
1 participant