0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

AWS Certificate Manager (ACM) にインポートした証明書をAWS CLIで取得できない時の解決方法

Last updated at Posted at 2023-04-29

背景

  • 環境構築後のテストの工程においてaws-cli使用してリソースの状態のエビデンスを取得している
  • ACMへの変更を実施したため、いつも通りaws-cliコマンドでACMが管理している証明書の一覧を取得した
  • しかし、その構築作業で追加されているはずの証明書がリストに出力されなかった
  • コンソールで確認すると目的の証明書は表示されている
  • 表示されない証明書は外部発行の証明書(ACMで発行されていない)
  • インポートした証明書のパブリックキーはECDSA P 256
    image.png

解決方法

--certificate-statusesオプションでkeyTypeを設定する
コマンド例はこちら。

$ aws list-certificates --certificate-statuses keyTypes=XXXXX

AWS CLIのコマンドリファレンスに以下のような記載がありました。
オプションを指定していないとデフォルトではRSA_2048のみにフィルターされているとのこと。

keyTypes -> (list)
Specify one or more algorithms that can be used to generate key pairs.
Default filtering returns only RSA_2048 certificates. To return other certificate types, provide the desired type signatures in a comma-separated list. For example, "keyTypes": ["RSA_2048,RSA_4096"] returns both RSA_2048 and RSA_4096 certificates.

まとめ

  • 証明書のパブリックキーがRSA_2048でない場合は--certificate-statusesオプションでkeyTypeを指定する
  • まず公式ドキュメントを見る
    • 証明書 XXX CLI取得できないというような検索ワードでググっていて時間を浪費しました・・・
    • 公式ドキュメントが重要だと再度認識させられた
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?