AWS
ElasticBeanstalk
aws-cli

Elastic BeanstalkでELBのHTTPS設定(CLI編)

More than 3 years have passed since last update.


問題

EB cliのv2まではoption settingsで以下のような記述でeb updateしたらHTTPSの設定ができていたけど、新しいv3では対応しなくなった

[aws:elb:loadbalancer]

LoadBalancerHTTPSPort=443
SSLCertificateId="arn:aws:iam::123456789012:server-certificate/ssl_2015"
LoadBalancerSSLPortProtocol=HTTPS

option_settings:

- namespace: aws:elb:loadbalancer
option_name: LoadBalancerHTTPSPort
value: 443
- namespace: aws:elb:loadbalancer
option_name: SSLCertificateId
value: "arn:aws:iam::123456789012:server-certificate/ssl_2015"
- namespace: aws:elb:loadbalancer
option_name: LoadBalancerSSLPortProtocol
value: HTTPS


現状

eb configでeditorを開いて編集しろとの事ですが、Web consoleを使うのと大差ない上、いかんせん面倒くだい。


解決

なので、eb cliは使わずにaws cliで設定する

aws elasticbeanstalk update-environment --environment-name can-pass-production --option-settings Namespace=aws:elb:loadbalancer,OptionName=LoadBalancerHTTPSPort,Value=443 Namespace=aws:elb:loadbalancer,OptionName=LoadBalancerSSLPortProtocol,Value=HTTPS Namespace=aws:elb:loadbalancer,OptionName=SSLCertificateId,Value=arn:aws:iam::123456789012:server-certificate/ssl_2015

ふう。

ref:

http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli.html#eb-cli2-differences