LoginSignup
14
13

More than 5 years have passed since last update.

AWS ELBの証明書を削除する

Last updated at Posted at 2014-04-11

ELBの証明書はAPI経由で削除することが出来る。
APIへのアクセスはAWSコマンドラインインターフェースを使うと便利。

AWSコマンドラインインターフェースはPythonモジュールとして提供されている。以下のコマンドでインストールする。

pip install awscli

AWSクレデンシャルの設定

AWSのクレデンシャルを~/.aws/configファイルに書く。

~/.aws/config
[default]
aws_access_key_id=[YOUR AWS ACCESS KEY]
aws_secret_access_key=[YOUR AWS SECRET KEY]
region=us-west-1

証明書の一覧を取得

削除対象の証明書を調べるため、登録済みの証明書一覧をlist-server-certificatesコマンドで取得します。

aws iam list-server-certificates

取得データはJSONです。
ServerCertificateNameがELBのプルダウンに出てくる証明書の名称です。

{
    "ServerCertificateMetadataList": [
        {
            "Path": "/",
            "Arn": "arn:aws:iam::xxxxxx:server-certificate/old-certificate",
            "ServerCertificateId": "xxxxxx",
            "ServerCertificateName": "old-certificate",
            "UploadDate": "2014-04-10T08:52:28Z"
        },
        {
            "Path": "/",
            "Arn": "arn:aws:iam::xxxxxx:server-certificate/new-certificate",
            "ServerCertificateId": "xxxxxx",
            "ServerCertificateName": "new-certificate",
            "UploadDate": "2014-05-01T02:29:52Z"
        }
    ]
}

証明書の削除

ELBの証明書はdelete-server-certificateコマンドから実施する。
証明書の名前は事前に調べておきましょう。

aws iam delete-server-certificate --server-certificate-name old-certificate

参考。

14
13
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
14
13