概要

  • 特定のIAMでS3のオブジェクトをダウンロードしようとすると以下のエラーが出る
    • The ciphertext refers to a customer master key that does not exist, does not exist in this region, or you are not allowed to access.
  • IAMユーザを使用できるIPアドレスを絞るためにIAMユーザのポリシーでConditionで「aws:SourceIp」を使っていることが原因
  • Conditionに追加でNullの条件演算子の「“kms:ViaService”: “true”」を指定することで解消

背景

以下を行った際、「The ciphertext refers to a customer master key that does not exist, does not exist in this region, or you are not allowed to access.」というCMKに関連するエラーが発生しました。

全文はこちら:S3からオブジェクトをダウンロードしようとするとKMSの権限エラー
著者:@suzuki_kento