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?

AWSアクセスキーを用いたSSL証明書の自動更新

Last updated at Posted at 2025-11-01

前提

  • Let’s Encrypt で証明書取得済み

  • Route53 + AWSアクセスキー(certbot certonly --dns-route53)方式で取得している

この状況で証明書の自動更新をしたい

AWS 認証情報をセットする

sudo mkdir -p /root/.aws
sudo nano /root/.aws/credentials
ファイルの作成

[default]
aws_access_key_id = YOUR_ACCESS_KEY
aws_secret_access_key = YOUR_SECRET_KEY
region = ap-northeast-1

中身を記述
sudo chmod 600 /root/.aws/credentials
権限を強めておきましょう
sudo certbot renew --dry-run
上記を実行することで自動更新が完了します

Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/[各ドメイン].conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Account registered.
Simulating renewal of an existing certificate for [各ドメイン]

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations, all simulated renewals succeeded: 
  /etc/letsencrypt/live/[各ドメイン]/fullchain.pem (success)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

このようなlogで成功です
systemctl list-timers | grep cert
ちゃんと進んでいるか時間を確認することが出来ます

Sun 2025-11-02 00:17:27 JST 6h Sat 2025-11-01 17:09:29 JST 52min ago certbot.timer certbot.service

読み方

表示 意味
Sun 2025-11-02 00:17:27 JST 次に実行される日時
6h 次の実行までの残り時間
Sat 2025-11-01 17:09:29 JST 前回実行された日時
52min ago 前回実行からの経過時間
certbot.timer 実行スケジュールを司る systemd タイマー
certbot.service 実際に動く certbot の処理(更新コマンド)
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?