Stan
10/25/2021, 3:04 PM<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>557QNR68XV66PJ3Z</RequestId>
<HostId>NvQ+73Rns6kCTmYb5cUEJGqXLiXNS8h1Fd0LQ0DsSmytrgjEg1KUkMIl4o0I79Gz3Zm5pihaqqw=</HostId>
</Error>
This is my stack:
import { StringParameter } from "@aws-cdk/aws-ssm";
import * as sst from "@serverless-stack/resources";
export default class MerchantPanelStack extends sst.Stack {
constructor(scope: <http://sst.App|sst.App>, id: string, props?: sst.StackProps) {
super(scope, id, props);
const hostedZone = StringParameter.valueFromLookup(this, "/route53/subdomain/zoneName").toLowerCase();
const site = new sst.StaticSite(this, "MerchantPanelSite", {
path: "frontend",
buildOutput: "dist",
buildCommand: "yarn run build",
errorPage: sst.StaticSiteErrorOptions.REDIRECT_TO_INDEX_PAGE,
customDomain: {
domainName: `merchant-panel.${hostedZone}`,
hostedZone: `${hostedZone}`
}
});
// Show the endpoint in the output
this.addOutputs({
WebsiteURL: site.url,
});
}
}
I've tried making access to s3 bucket public, but this does not help anyway on cf level. I heard it might takes up to few hours with cloud front to propagate all the things until it works. Is this the case or am I doing something wrong?thdxr
10/25/2021, 3:20 PMthdxr
10/25/2021, 3:20 PMStan
10/25/2021, 3:57 PMthdxr
10/25/2021, 4:00 PMStan
10/25/2021, 4:05 PMStan
10/25/2021, 4:07 PMthdxr
10/25/2021, 4:09 PMthdxr
10/25/2021, 4:10 PMStan
10/25/2021, 4:12 PMFrank
Frank
Stan
10/25/2021, 5:38 PMyarn create serverless-stack admin-panel --language typescript --use-yarn
so I guess its the latest version.
Here is the repo with the code: https://github.com/stan-peryt/admin-panelStan
10/25/2021, 5:57 PMthdxr
10/25/2021, 6:04 PMbuildOutput
to be a deeper folder if I'm understanding you correctlyStan
10/25/2021, 6:19 PMnew StaticSite(this, "AngularSite", {
path: "path/to/src",
buildOutput: "dist",
buildCommand: "ng build --output-path dist",
errorPage: StaticSiteErrorOptions.REDIRECT_TO_INDEX_PAGE,
});
and unfortunately cloud front does not help much with debugging this.
So in my case, if anyone have similar problem, final working setup is:
import { StringParameter } from "@aws-cdk/aws-ssm";
import * as sst from "@serverless-stack/resources";
export default class MerchantPanelStack extends sst.Stack {
constructor(scope: <http://sst.App|sst.App>, id: string, props?: sst.StackProps) {
super(scope, id, props);
const hostedZone = StringParameter.valueFromLookup(this, "/route53/subdomain/zoneName").toLowerCase();
const site = new sst.StaticSite(this, "MerchantPanelSite", {
path: "frontend",
buildOutput: "dist/merchant-panel",
buildCommand: "yarn run build",
errorPage: sst.StaticSiteErrorOptions.REDIRECT_TO_INDEX_PAGE,
customDomain: {
domainName: `merchant-panel.${hostedZone}`,
hostedZone: `${hostedZone}`
}
});
// Show the endpoint in the output
this.addOutputs({
WebsiteURL: site.url,
});
}
}