Devin
02/11/2022, 11:14 PM<http://domain.com|domain.com>
on route 53 and move it to... Netlify I guess. I'll keep <http://app.domain.com|app.domain.com>
for the SST application. Effectively splitting the static site and the application.
Anyone have any thoughts about things I should watch out for?thdxr
02/11/2022, 11:14 PMthdxr
02/11/2022, 11:15 PMDevin
02/11/2022, 11:15 PMDevin
02/11/2022, 11:19 PMJason Melis
02/12/2022, 1:56 PMDevin
02/12/2022, 3:06 PMDevin
02/12/2022, 4:29 PM<http://thecdkbook.com|thecdkbook.com>
doesn’t have deployment of static pages correctly worked out for their site.
import * as sst from "@serverless-stack/resources";
import { RemovalPolicy } from "aws-cdk-lib";
import { Source, s3Deployment } from "aws-cdk-lib/aws-s3-deployment";
export default class MarketingStack extends sst.Stack {
constructor(scope, id, props) {
super(scope, id, props);
const { api } = props;
const staticSite = new sst.StaticSite(this, "Site", {
path: "website",
errorPage: "404.html",
buildOutput: "public",
buildCommand: "npm run build",
environment: {
GATSBY_API_URL: api.url,
},
s3Bucket: {
publicReadAccess: true,
removalPolicy: RemovalPolicy.DESTROY,
websiteIndexDocument: "index.html",
},
});
new s3Deployment.BucketDeployment(this, "deployStaticWebsite", {
sources: [Source.asset("../website")],
destinationBucket: staticSite.bucketArn,
});
thdxr
02/12/2022, 4:35 PMDevin
02/12/2022, 4:36 PMDevin
02/12/2022, 4:38 PM