イミテーションの木

色々やってみよう

Linux2へ移行するときの.ebextensions - AWS Elastic Beanstalk

f:id:dmckun:20211020122550p:plain

 

やりたいこと

Linux AMI → Linux2へブランチ切り替え

 

やってみた

既存のバージョンアップでは達成出来ないようなので、新規でインスタンスを作成してソースをお引越しする

Configuration validation exception: Unknown or duplicate parameter: NodeCommand

そんな甘くない

 

何をしなきゃいけない?

.ebextensions配下のファイルを書き換えたりしないといけないみたい

docs.aws.amazon.com

 

対処しよう

nodecommand.configをProcfileに書き換えて

/.ebextensions/nodecommand.config

option_settings:
  aws:elasticbeanstalk:container:nodejs:
    NodeCommand: "npm start"

/Procfile

scripts: node bin/www

 

01-nginx-max-body.configを01_files.configに書き換える

/.ebextensions/01-nginx-max-body.config

files:
  "/etc/nginx/conf.d/client-max-body-size.conf":
     mode: "000644"
     owner: root
     group: root
     content: "client_max_body_size 10M;"

/.ebextensions/01_files.config

files:
  "/etc/nginx/conf.d/proxy.conf":
     mode: "000644"
     owner: root
     group: root
     content: "client_max_body_size 10M;"

 

でーきたっ