I wasn't sure if this is already implemented but even I changed the auto scaling groups desired and minimum capacity to 2  whenever I executed the deployment jhipster aws I notice the web cant be accessed and throwing 502 Bad Gateway
I think blue green deployment is already a standard and would be great if it is supported.
jhipster info
INFO! Using JHipster version installed locally in current project's node_modules
INFO! Executing jhipster:info
Welcome to the JHipster Information Sub-Generator
##### **JHipster Version(s)**
##### **JHipster configuration, a `.yo-rc.json` file generated in the root folder**
<details>
<summary>.yo-rc.json file</summary>
<pre>
{
  "generator-jhipster": {
    "authenticationType": "oauth2",
    "cacheProvider": "redis",
    "clientFramework": "react",
    "serverPort": "8080",
    "serviceDiscoveryType": "eureka",
    "skipUserManagement": true,
    "baseName": "webportal",
    "buildTool": "gradle",
    "databaseType": "sql",
    "devDatabaseType": "postgresql",
    "enableHibernateCache": true,
    "enableSwaggerCodegen": true,
    "enableTranslation": true,
    "jhiPrefix": "jhi",
    "languages": ["in", "en"],
    "messageBroker": false,
    "nativeLanguage": "in",
    "prodDatabaseType": "postgresql",
    "searchEngine": "elasticsearch",
    "skipClient": false,
    "testFrameworks": [],
    "websocket": false,
    "packageName": "com.dsa.portal",
    "packageFolder": "com/dsa/portal",
    "skipServer": false,
    "applicationType": "monolith",
    "clientPackageManager": "npm",
    "clientTheme": "journal",
    "clientThemeVariant": "light",
    "dtoSuffix": "DTO",
    "embeddableLaunchScript": false,
    "otherModules": [],
    "useSass": true,
    "jhipsterVersion": "6.10.5",
    "creationTimestamp": 1588422840597,
    "entitySuffix": "",
    "blueprints": [],
    "lastLiquibaseTimestamp": 1601739358000,
    "aws": {
      "applicationName": "webportal",
      "environmentName": "prod",
      "bucketName": "comot-webportal",
      "instanceType": "t2.micro",
      "awsRegion": "ap-southeast-1",
      "dbName": "webportal",
      "dbInstanceClass": "db.t2.micro"
    }
  },
  "entities": ["News"]
}
</pre>
</details>
##### **JDL for the Entity configuration(s) `entityName.json` files generated in the `.jhipster` directory**
<details>
<summary>JDL entity definitions</summary>
<pre>
entity News {
  originalArticleUrl String required unique maxlength(512),
  imageSrc String maxlength(512),
  title String required maxlength(512),
  publishedDate Instant required,
  content String maxlength(65000) required,
  articleUrl String required unique maxlength(512)
}
entity Comment {
  text String required minlength(3) maxlength(100),
  createdDate Instant
}
entity Publisher {
  name String required unique,
  logoUrl String required,
  averageRating Double max(5)
}
entity Category {
  name String required unique minlength(3)
}
entity Rating {
  score Double required min(1) max(5)
}
entity Device {
  token String required unique
}
entity ParentCategory {
  name String required unique,
  logoUrl String required unique
}
relationship OneToMany {
  Publisher{news} to News{publisher(name) required},
  Publisher{ratings} to Rating{publisher required}
}
relationship ManyToOne {
  News{category(name) required} to Category,
  Comment{user(login) required} to User,
  Comment{news required} to News,
  Category{parentCategory(name) required} to ParentCategory,
  Rating{user(login) required} to User,
  Device{user(login)} to User
}
relationship ManyToMany {
  Publisher{subscribers(login) required} to User,
  ParentCategory{subscribers(login) required} to User
}
paginate News with infinite-scroll
paginate Comment, Publisher, Category, Rating, Device, ParentCategory with pagination
service News, Publisher, Category, Rating, Device, ParentCategory with serviceClass
service Comment with serviceImpl
search News, Comment, Publisher, Category, Rating, Device, ParentCategory with elasticsearch
filter News, Comment, Publisher, Category, Rating, ParentCategory
readOnly Device
</pre>
</details>
##### **Environment and Tools**
openjdk version "1.8.0_275"
OpenJDK Runtime Environment (build 1.8.0_275-8u275-b01-0ubuntu1~18.04-b01)
OpenJDK 64-Bit Server VM (build 25.275-b01, mixed mode)
git version 2.17.1
node: v13.2.0
npm: 6.14.4
yeoman: 3.1.1
Docker version 19.03.6, build 369ce74a3c
docker-compose version 1.25.4, build unknown
identical .jhipster/Category.json
identical .jhipster/Comment.json
identical .jhipster/Device.json
identical .jhipster/News.json
identical .jhipster/ParentCategory.json
identical .jhipster/Publisher.json
identical .jhipster/Rating.json
INFO! Congratulations, JHipster execution is complete!
@vrijmetse : Just to clarify you mean after running the aws subgenerator you are unable to access the site? Also could you please complete the issue template by adding your project configuration. You can execute jhipster info within the project folder and copy the output. 馃 
Hi @SudharakaP I am unable to access the website during the deployment process. I have updated the right error message which is 502 instead of 503.
@SudharakaP I would like to clarify that the sub-generator works but with downtime.
@vrijmetse : I could not recreate the issue; but do you have any other information such as the server stack trace when this error happens by any chance?
@SudharakaP Basically when I execute the command, I notice the Environment changes in this cycle
Green > Grey > Green
I think I found the log (If you notice there are times when the response is 502 and 503 before it becomes 200).
172.31.16.244 - - [09/Dec/2020:07:22:16 +0000] "GET /api2/homepage?page=0&size=40&sort=publishedDate,desc&cacheBuster=1607498536212 HTTP/1.1" 200 7162 "https://thisismydomain.com/?page=1&sort=publishedDate,desc" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36"
172.31.36.29 - - [09/Dec/2020:07:22:20 +0000] "GET / HTTP/1.1" 503 299 "-" "ELB-HealthChecker/2.0"
172.31.36.29 - - [09/Dec/2020:07:22:30 +0000] "GET / HTTP/1.1" 502 341 "-" "ELB-HealthChecker/2.0"
172.31.16.244 - - [09/Dec/2020:07:22:36 +0000] "GET / HTTP/1.1" 502 341 "-" "ELB-HealthChecker/2.0"
172.31.36.29 - - [09/Dec/2020:07:22:40 +0000] "GET / HTTP/1.1" 502 341 "-" "ELB-HealthChecker/2.0"
172.31.16.244 - - [09/Dec/2020:07:22:46 +0000] "GET / HTTP/1.1" 502 341 "-" "ELB-HealthChecker/2.0"
172.31.36.29 - - [09/Dec/2020:07:22:50 +0000] "GET / HTTP/1.1" 502 341 "-" "ELB-HealthChecker/2.0"
172.31.16.244 - - [09/Dec/2020:07:23:36 +0000] "GET / HTTP/1.1" 200 1665 "-" "ELB-HealthChecker/2.0"
Let me try to bump up my application version from 0.0.1-SNAPSHOT to 0.0.2-SNAPSHOT before executing the jhipster aws command.
@vrijmetse : Is the application running normally before this healthcheck? Do you see any other exceptions in the log prior to this?
Yes, If you see the first line in the log it still giving response 200
[09/Dec/2020:07:22:16 +0000] "GET /api2/homepage?page=0&size=40&sort=publishedDate,desc&cacheBuster=1607498536212 HTTP/1.1" 200 7162 "https://thisismydomain.com/?page=1&sort=publishedDate,desc" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko)
Hi @SudharakaP ,
After reading the documentation I can achieve zero downtime by updating the EBS environment deployment configuration.
Basically I set the following:
Maybe the above setting (or similar) can be configured in CloudFormation setup would be great.
More details can be found https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.rolling-version-deploy.html.
Thanks for the help!
@vrijmetse : Thanks for posting back your solution. I am closing this as it seems this is purely an aws deployment configuration issue and there's nothing to be done on the jhipster side. I couldn't recreate this issue; but if more users report this we can dig deeper into it. 馃槃