📝

[小ネタ] IAM Identity Center の VerifyEmail の API は存在しない

に公開

Actions, resources, and condition keys for AWS IAM Identity Center directory - Service Authorization Reference

Actions Description Access level
VerifyEmail Grants permission to verify an email address of an User Write

Actions, resources, and condition keys for AWS IAM Identity Center directory - Service Authorization Reference

IAM のアクションとしての VerifyEmail は存在しますが、ユーザーが使用可能な API としては存在しません。

VerifyEmail について

Add users to your Identity Center directory - AWS IAM Identity Center

If this happens, you can resend the email by choosing Reset password, and then choosing Send an email to the user with instructions for resetting the password.

IAM Identity Center でユーザーを作成する際に、「パスワードの設定手順が記載された E メールをこのユーザーに送信します」を選択すると、ユーザー作成時に入力した E メールアドレスに招待メールが送信されます。
この招待の有効期限は 7 日ですが、期限切れ後にコンソールから再送することができます。

コンソールから再送する際に必要な権限が VerifyEmail です。
VerifyEmail アクションを拒否した状態では以下のようなエラーが発生します。

sso-directory:VerifyEmail へのアクセスが拒否されました
sso-directory:VerifyEmail に対する許可がありません。
アクセスをリクエストするには、次のテキストをコピーして AWS 管理者に送信してください。 
ユーザー: xxx
アクション: sso-directory:VerifyEmail
コンテキスト: an identity-based policy explicitly denies the action

上述の通り、VerifyEmail は CloudTrail には記録されます。

一方で、ユーザーが使用可能な API としては提供されていないため、招待メールを AWS CLI や AWS SDK で再送することはできません。
そのため、招待メールを再送する必要がある場合には IAM Identity Center コンソールから再送する必要があります。

まとめ

今回は IAM Identity Center の VerifyEmail の API は存在しないという内容を紹介しました。
どなたかの参考になれば幸いです。

参考資料

Discussion