Olivers
05/05/2022, 3:05 PMimport * as sst from "@serverless-stack/resources";
export default class MyStack extends sst.Stack {
constructor(
scope: <http://sst.App|sst.App>,
id: string,
props?: sst.StackProps,
private readonly auth?: sst.Auth
) {
super(scope, id, props);
const site = new sst.ReactStaticSite(this, "MyDashboard", {
path: "frontend",
environment: {
REACT_APP_AWS_REGION: scope.region,
REACT_APP_IDENTITY_POOL_ID: this.auth?.cognitoIdentityPoolId,
REACT_APP_USER_POOL_CLIENT_ID:
this.auth?.cognitoUserPoolClient?.userPoolClientId,
REACT_APP_USER_POOL_ID: this.auth?.cognitoUserPool?.userPoolId,
REACT_APP_API_URL: process.env.REACT_APP_API_URL,
},
buildCommand: "npm run build",
});
// Show the endpoint in the output
this.addOutputs({
SiteUrl: site.url,
});
}
}
thdxr
05/05/2022, 3:09 PMthdxr
05/05/2022, 3:11 PMthdxr
05/05/2022, 3:12 PMthdxr
05/05/2022, 3:13 PMOlivers
05/05/2022, 3:14 PMOlivers
05/05/2022, 3:15 PMthdxr
05/05/2022, 3:15 PMthdxr
05/05/2022, 3:16 PMOlivers
05/05/2022, 3:16 PM