LoginSignup
9
7

More than 5 years have passed since last update.

ELBとCloudFrontで同じSSL証明書を使う方法

Last updated at Posted at 2016-01-13

ワイルドカード証明書を利用する場合、ELBとCloudFrontで同じSSL証明書を利用する場合がありますが、AWSマネジメントコンソールのELBメニューからSSL証明書を登録してもCloudFrontのCustom SSL Certificateプルダウンリストには表示されません。

cloudfront_no_sslcert.PNG

CloudFrontでSSL証明書を利用する場合、AWS CLIで登録する必要があります。(--path /cloudfront オプションが必要)

aws iam upload-server-certificate \
--server-certificate-name <任意のサーバ証明書識別名> \
--certificate-body file://<サーバ証明書のパス> \
--private-key file://<秘密鍵のパス> \
--certificate-chain file://<中間CA証明書のパス> \
--path /cloudfront/

以下のコマンドで正しくアップロードが完了したことを確認できます。

aws iam get-server-certificate --server-certificate-name <任意のサーバ証明書識別名>

上記コマンド登録した証明書は、ELB側にも登録されますので、ELBとCloudFront両方で同じSSL証明書を利用する場合は、AWS CLIでSSL証明書を登録しましょう。

※ELBで登録してしまったSSL証明書は以下のコマンドで削除できます。

aws iam list-server-certificates 
aws iam delete-server-certificate --server-certificate-name <任意のサーバ証明書識別名>
9
7
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
9
7