forked from aws-samples/aws-sdk-js-notes-app
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* address some tsc errors * add cdk stack for frontend deployment * add commands revolving around frontend to makefile * update README --------- Co-authored-by: lukqw <[email protected]>
- Loading branch information
Showing
9 changed files
with
64 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { | ||
Stack, | ||
StackProps, | ||
CfnOutput, | ||
aws_s3 as s3, | ||
aws_s3_deployment, | ||
} from "aws-cdk-lib"; | ||
import { Construct } from "constructs"; | ||
|
||
export class AwsSdkJsNotesAppFrontendStack extends Stack { | ||
constructor(scope: Construct, id: string, props?: StackProps) { | ||
super(scope, id, props); | ||
|
||
const websiteBucket = new s3.Bucket(this, "WebsiteBucket", { | ||
bucketName: "notes-app-frontend", | ||
websiteIndexDocument: "index.html", | ||
websiteErrorDocument: "index.html", | ||
}); | ||
|
||
new aws_s3_deployment.BucketDeployment(this, "DeployWebsite", { | ||
sources: [aws_s3_deployment.Source.asset("../frontend/dist")], | ||
destinationBucket: websiteBucket, | ||
}); | ||
|
||
new CfnOutput(this, "FrontendBucketWebsite", { | ||
value: `http://${websiteBucket.bucketName}.s3-website.localhost.localstack.cloud:4566/`, | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { App } from "aws-cdk-lib"; | ||
import { AwsSdkJsNotesAppFrontendStack } from "./aws-sdk-js-notes-app-frontend-stack"; | ||
|
||
const app = new App(); | ||
new AwsSdkJsNotesAppFrontendStack(app, "aws-sdk-js-notes-app-frontend"); |