サーバ証明書をaws-cliでインストール
はじめに
ELBでSSLTerminationを行い、CloudFrontは独自ドメインSSLを使用する。
という場合があったので、忘れないようにここに書いておきます。
用意する証明書
名前 | 用途 |
---|---|
hoge.com | Webサイト(ELB)用 |
cdn.hoge.com | CloudFront用 |
事前準備
awscliにて、plofile「demo」としてクレデンシャル登録済みの前提です。
以下のコマンドで作成。
aws configure --profile demo
ELB用
$ aws --profile demo iam upload-server-certificate --server-certificate-name hoge.com --certificate-body file://HOGE_CERT.crt --private-key file://hoge_web.pem --certificate-chain file://HOGE_INTER.crt
CloudFront用
$ aws --profile demo iam upload-server-certificate --path /cloudfront/ --server-certificate-name cdn.hoge.com --certificate-body file://HOGE_CERT.crt --private-key file://hoge_cloudfront.pem --certificate-chain file://HOGE_INTER.crt
参考リンク
- http://docs.aws.amazon.com/ja_jp/ElasticLoadBalancing/latest/DeveloperGuide/ssl-server-cert.html
- http://docs.aws.amazon.com/ja_jp/ElasticLoadBalancing/latest/DeveloperGuide/elb-update-ssl-cert.html
- http://docs.aws.amazon.com/ja_jp/AmazonCloudFront/latest/DeveloperGuide/private-content-trusted-signers.html#private-content-creating-cloudfront-key-pairs