diff --git a/README.md b/README.md index 8b3176f9c..4be25d236 100644 --- a/README.md +++ b/README.md @@ -209,7 +209,7 @@ The contents of this setting are as follows. > NOTE: See the following explanation for how to use Context > -> - [Manage personal environment by cdk.context.json](doc/HowTo.md#cdkcontextjson-Manage-personal-environment) +> - [Manage personal environment by cdk.context.json](doc/HowTo.md#Manage-personal-environment-by-cdkcontextjson) > > - [Accessing context in application](doc/HowTo.md#accessing-context-in-application) @@ -352,7 +352,7 @@ This completes the baseline and sample application deployment for a single accou From now on, you will use this sample code as a starting point to develop applications tailored to your use case. Indicates information necessary for general development. - [Development process](doc/HowTo.md#development-process) -- [Update package dependencies](doc/HowTo.md#update-dependencies) +- [Update package dependencies](doc/HowTo.md#update-package-dependencies) #### 5-4. Remediation of security issues diff --git a/doc/DeployToControlTower.md b/doc/DeployToControlTower.md index 7578eeb19..3d9775d0f 100644 --- a/doc/DeployToControlTower.md +++ b/doc/DeployToControlTower.md @@ -263,7 +263,7 @@ The contents of this setting are as follows. > NOTE: See the following explanation for how to use Context > -> - [Manage personal environment by cdk.context.json](doc/HowTo.md#cdkcontextjson-Manage-personal-environment) +> - [Manage personal environment by cdk.context.json](doc/HowTo.md#Manage-personal-environment-by-cdkcontextjson) > > - [Accessing context in application](doc/HowTo.md#accessing-context-in-application) @@ -493,7 +493,7 @@ This completes the baseline and sample application deployment for a single accou From now on, you will use this sample code as a starting point to develop applications tailored to your use case. Indicates information necessary for general development. - [Development process](doc/HowTo.md#development-process) -- [Update package dependencies](doc/HowTo.md#update-dependencies) +- [Update package dependencies](doc/HowTo.md#update-package-dependencies) #### 7-4. Remediation of security issues diff --git a/doc/HowTo.md b/doc/HowTo.md index 1658314ec..65893c705 100644 --- a/doc/HowTo.md +++ b/doc/HowTo.md @@ -7,10 +7,10 @@ Here we will describe howTo for various settings. - [VisualStudioCode Setup Instructions](#VisualStudioCode-Setup-Instructions) - [Git pre-commit hook setup](#Git-pre-commit-hook-setup) - [Skip Deployment Approvals and Don't Roll Back](#skip-deployment-approvals-and-dont-roll-back) -- [Manage personal environment by cdk.context.json](#cdkcontextjson-Manage-personal-environment) +- [Manage personal environment by cdk.context.json](#Manage-personal-environment-by-cdkcontextjson) - [Set up Slack for AWS ChatBot](#set-up-slack-for-aws-chatbot) - [Deployment with CloudShell](#deployment-with-cloudshell) -- [Update package dependencies](#update-dependencies) +- [Update package dependencies](#update-package-dependencies) - [Accessing context in application](#accessing-context-in-application) - [Development process](#development-process) - [Remediate Security Issues](#remediate-security-issues) @@ -39,7 +39,7 @@ For macOS, select [Running Visual Studio Code on macOS](https://code.visualstudi If you clone this repository in a subsequent step and open it in VSCode, you will be prompted to install the recommended extension. Now click on _Install_. -! [vscode-recommended-extensions](doc/images/VSCode-Recommended-Extensions.jpg) +![vscode-recommended-extensions](../doc/images/VSCode-Recommended-Extensions.jpg) This recommended extension is defined in `.vscode/extensions.json`. For more information about this feature, see [Managing Extensions in Visual Studio Code](https://code.visualstudio.com/docs/editor/extension-marketplace#_workspace-recommended-extensions). @@ -340,6 +340,14 @@ If your CDK code requires additional packages, install them as follows: Here we > ``` > NOTE: +> When you update a CDK source code, your snap shot test (npm run test) will be failed because a generated template is differ from previous one. +> If your CDK code is correct, you need to update a snapshot using command below. +> +> ```sh +> # Update snapshot +> npm run test -- -u +> ``` +> > To build all use cases, run the following using workspaces: > > ```sh @@ -349,6 +357,7 @@ If your CDK code requires additional packages, install them as follows: Here we > npm run format > npm run clean --workspaces > npm run build --workspaces +> npm run test --workspaces -- -u # update snaphosts > npm run test --workspaces > ``` > diff --git a/doc/HowTo_ja.md b/doc/HowTo_ja.md index f7bf18c5d..cf522cd2d 100644 --- a/doc/HowTo_ja.md +++ b/doc/HowTo_ja.md @@ -39,7 +39,7 @@ macOS の場合、 [Running Visual Studio Code on macOS](https://code.visualstud 後続の手順でこのリポジトリを clone して VSCode で開くと、推奨 Extension のインストールを促されます。ここで _Install_ をクリックます。 -![VSCode-Recommended-Extensions](doc/images/VSCode-Recommended-Extensions.jpg) +![VSCode-Recommended-Extensions](../doc/images/VSCode-Recommended-Extensions.jpg) この推奨 Extension は `.vscode/extensions.json` で定義されています。この機能の詳細は [Managing Extensions in Visual Studio Code](https://code.visualstudio.com/docs/editor/extension-marketplace#_workspace-recommended-extensions) をご参照ください。 @@ -335,12 +335,20 @@ CDK コードで追加のパッケージが必要になった場合は、以下 > npm run format > # build > npm run build -> # snapshot test +> # snapshot test (see NOTE) > npm run test > ``` > NOTE: > +> CDK コードを変更した場合、以前とは異なるテンプレートが生成されるため、スナップショットテスト (npm run test) が失敗します +> テンプレートが正しく生成されているならば、次のようにスナップショットの更新が必要です。 +> +> ```sh +> # Update snapshot +> npm run test -- -u +> ``` +> > 全てのユースケースをビルドするには workspaces を使用して次のように実行します。 > > ```sh @@ -350,6 +358,7 @@ CDK コードで追加のパッケージが必要になった場合は、以下 > npm run format > npm run clean --workspaces > npm run build --workspaces +> npm run test --workspaces -- -u # update snaphosts > npm run test --workspaces > ``` > diff --git a/doc/images/BLEA-GuestSampleASG.png b/doc/images/BLEA-GuestSampleASG.png deleted file mode 100644 index 758af6b78..000000000 Binary files a/doc/images/BLEA-GuestSampleASG.png and /dev/null differ diff --git a/doc/images/BLEA-GuestSampleEC2.png b/doc/images/BLEA-GuestSampleEC2.png deleted file mode 100644 index 98d5b2455..000000000 Binary files a/doc/images/BLEA-GuestSampleEC2.png and /dev/null differ diff --git a/doc/images/BLEA-GuestSampleECS.png b/doc/images/BLEA-GuestSampleECS.png deleted file mode 100644 index 674d69b9c..000000000 Binary files a/doc/images/BLEA-GuestSampleECS.png and /dev/null differ diff --git a/doc/images/BLEA-GuestSampleWebASG.png b/doc/images/BLEA-GuestSampleWebASG.png new file mode 100644 index 000000000..ff28075da Binary files /dev/null and b/doc/images/BLEA-GuestSampleWebASG.png differ diff --git a/doc/images/BLEA-GuestSampleWebEC2.png b/doc/images/BLEA-GuestSampleWebEC2.png new file mode 100644 index 000000000..ec0eaba02 Binary files /dev/null and b/doc/images/BLEA-GuestSampleWebEC2.png differ diff --git a/doc/images/BLEA-GuestSampleWebECS.png b/doc/images/BLEA-GuestSampleWebECS.png new file mode 100644 index 000000000..3a3ac7158 Binary files /dev/null and b/doc/images/BLEA-GuestSampleWebECS.png differ diff --git a/doc/images/BLEA-GuestSampleWebECSSSL.png b/doc/images/BLEA-GuestSampleWebECSSSL.png new file mode 100644 index 000000000..9eac130ca Binary files /dev/null and b/doc/images/BLEA-GuestSampleWebECSSSL.png differ diff --git a/usecases/guest-webapp-sample/README.md b/usecases/guest-webapp-sample/README.md new file mode 100644 index 000000000..076df2abc --- /dev/null +++ b/usecases/guest-webapp-sample/README.md @@ -0,0 +1,30 @@ +# Sample Web application - Architecture diagram + +## Sample Web application (ECS) + +![ECS](../../doc/images/BLEA-GuestSampleWebECS.png) + +- bin/blea-guest-ecsapp-sample.ts + - ECS/Fargate + AuroraPostgreSQL + +## Sample Web application (ECS+SSL) + +![ECS-and-SSL](../../doc/images/BLEA-GuestSampleWebECSSSL.png) + +- bin/blea-guest-ecsapp-ssl-sample.ts + - ECS/Fargate + AuroraPostgreSQL + - With SSL Certificate for your domain + +## Sample Web application (Autoscaling Group) + +![ASG](../../doc/images/BLEA-GuestSampleWebASG.png) + +- bin/blea-guest-asgapp-sample.ts + - EC2 Autoscaling Group + Aurora PostgreSQL + +## Sample Web application (EC2) + +![EC2](../../doc/images/BLEA-GuestSampleWebEC2.png) + +- bin/blea-guest-ec2app-sample.ts + - EC2 + AuroraPostgreSQL diff --git a/usecases/guest-webapp-sample/README_ja.md b/usecases/guest-webapp-sample/README_ja.md index b7fc679ef..3cb39e5ca 100644 --- a/usecases/guest-webapp-sample/README_ja.md +++ b/usecases/guest-webapp-sample/README_ja.md @@ -1,22 +1,30 @@ -### ECS システムサンプル +# Web アプリケーションサンプルアーキテクチャ図 -![BLEA-GuestSampleECS](doc/images/BLEA-GuestSampleECS.png) +## Web アプリケーションサンプル (ECS) + +![ECS](../../doc/images/BLEA-GuestSampleWebECS.png) - bin/blea-guest-ecsapp-sample.ts - ECS/Fargate+AuroraPostgreSQL を使ったサンプルシステム +## Web アプリケーションサンプル (ECS+SSL) + +![ECS-and-SSL](../../doc/images/BLEA-GuestSampleWebECSSSL.png) +- bin/blea-guest-ecsapp-ssl-sample.ts + - ECS/Fargate+AuroraPostgreSQL を使ったサンプルシステム + - 独自ドメインによる SSL 証明書対応 -### AutoSacling システムサンプル +## Web アプリケーションサンプル (Autoscaling Group) -![BLEA-GuestSampleASG](doc/images/BLEA-GuestSampleASG.png) +![ASG](../../doc/images/BLEA-GuestSampleWebASG.png) - bin/blea-guest-asgapp-sample.ts - EC2 Autoscaling Group+AuroraPostgreSQL を使ったサンプルシステム -### EC2 システムサンプル +## Web アプリケーションサンプル (EC2) -![BLEA-GuestSampleEC2](doc/images/BLEA-GuestSampleEC2.png) +![EC2](../../doc/images/BLEA-GuestSampleWebEC2.png) - bin/blea-guest-ec2app-sample.ts - EC2+AuroraPostgreSQL を使ったサンプルシステム