1
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?

auth_token_update_strategyの差分何これ

Last updated at Posted at 2025-12-08

はじめに

これは私が社内に蔓延る IaC 管理のされていないリソースを片っ端から import している時のお話…。
redis を import しようとしている時に、特に変更した覚えのない差分がずっと付き纏います。

+ auth_token_update_strategy     = "ROTATE"

何これ?

本文

起こっていたこと

この auth_token_update_strategy は ElastiCache Redis の認証トークンを更新する際の戦略を指定するパラメータです。

  • ROTATE
    • 新しい AUTH トークンを追加しつつ、以前のトークンも保持する。ローテーション期間中は両方のトークンが使用可能
  • SET
    • 単一の AUTH トークンのみをサポートするように更新する。ROTATE 後に使用して、新しいトークンを必須として確定させる

この変更差分があるまま apply をすると以下のようなエラーが出ます。

InvalidParameterValue: The AUTH token modification is only supported when encryption-in-transit is enabled.

それもそのはず、そもそも transit_encryption_enabled = true でない限り auth_token_update_strategy は設定できないはずだからです。

今回変更を加えようとしていた elasticache では認証をつける予定はなく、auth_token_update_strategy に関する設定は不要のはずでした。
そして、もちろんそこの箇所に関する意図的な変更はしていませんでした。

解決方法

実は terraform-provider-aws に issue が立っていました。

この問題は v5.28.0 で修正されています(PR #34600)。
なので、aws provider を v5.28.0 以上に version up すれば改善できます。

なぜこうなっていたのか

terraform-provider-aws v5.27.0 で auth_token_update_strategy 属性が追加された際、デフォルト値として ROTATE が設定されていました。この実装に問題があり、auth_token を設定していないリソースに対しても auth_token_update_strategy パラメータが AWS API に送信されてしまい、意図せず認証トークンの有効化がトリガーされる状態になっていました。

そのため、既存の ElastiCache リソースを import したり、provider を v5.27.0 にアップグレードすると、設定していないはずの auth_token_update_strategy = "ROTATE" の差分が表示されてしまっていたようでした。

参考

1
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
1
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?