LoginSignup
0
0

More than 3 years have passed since last update.

AWS CDKでELBのタイムアウト設定を変更する

Posted at

はじめに

新規で作る時は初期化の際にidleTimeoutとして設定ができる

ecsPatternsだと自動的にALB等の初期化が終わっている
既存のリソースのtimeout設定を変える方法が調べづらかったのでシェア

やり方

ec2Service.loadBalancer.setAttribute('idle_timeout.timeout_seconds', '3600')

CDKのドキュメントを読めば分かる通り、ELBのインスタンスに setAttribute というメソッドが生えているのでこれを使う

第一引数がkey
なんの属性を変えるか指定する
どういった属性が変えられるかは↓のドキュメントを御覧ください
https://docs.aws.amazon.com/ja_jp/elasticloadbalancing/latest/application/application-load-balancers.html#load-balancer-attributes

第二引数で、設定したい値を指定する

おわり

属性あるけど変えられんやんけ!ってのが多々あるので、探せばなんとかなる
最悪cloudformationを書く

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0