Skip to content

Instantly share code, notes, and snippets.

@tkuchiki
Last active August 29, 2015 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tkuchiki/10447527 to your computer and use it in GitHub Desktop.
Save tkuchiki/10447527 to your computer and use it in GitHub Desktop.
ELB
# 証明書アップロード
# http://docs.aws.amazon.com/cli/latest/reference/iam/upload-server-certificate.html
$ aws iam upload-server-certificate --server-certificate-name example.com --certificate-body file:///path/to/example.com.crt --private-key file:///path/to/example.com.key --certificate-chain file:///path/to/example.com.ca
SERVERCERTIFICATEMETADATA arn:aws:iam::123456789012:server-certificate/example.com / XXXXXXXXXXXXXXXXXXXXX example.com 2014-04-11T07:43:32.214Z
# Listener 作成
# http://docs.aws.amazon.com/cli/latest/reference/elb/create-load-balancer-listeners.html
$ aws elb create-load-balancer-listeners --load-balancer-name test-elb --listeners "Protocol=https,LoadBalancerPort=443,InstanceProtocol=http,InstancePort=80,SSLCertificateId=arn:aws:iam::123456789012:server-certificate/example.com"
# Listener の証明書変更
# http://docs.aws.amazon.com/cli/latest/reference/elb/set-load-balancer-listener-ssl-certificate.html
$ aws elb set-load-balancer-listener-ssl-certificate --load-balancer-name test-elb --load-balancer-port 443 --ssl-certificate-id "arn:aws:iam::210987654321:server-certificate/example.org"
Load Balancer Protocol Load Balancer Port Instance Protocol Instance Port Cipher SSL Certificate
HTTPS 443 HTTP 80 Change example.com Change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment