If you're using Terraform, you can use the following .tf
file so that you can get the proper data
resource "aws_iam_user" "smtp_user" {
name = "smtp_user"
}
resource "aws_iam_access_key" "smtp_user" {
user = aws_iam_user.smtp_user.name
}
data "aws_iam_policy_document" "ses_sender" {
statement {
actions = ["ses:SendRawEmail"]
resources = ["*"]
}
}
resource "aws_iam_policy" "ses_sender" {
name = "ses_sender"
description = "Allows sending of e-mails via Simple Email Service"
policy = data.aws_iam_policy_document.ses_sender.json
}
resource "aws_iam_user_policy_attachment" "test-attach" {
user = aws_iam_user.smtp_user.name
policy_arn = aws_iam_policy.ses_sender.arn
}
output "smtp_username" {
value = aws_iam_access_key.smtp_user.id
}
output "smtp_password" {
value = aws_iam_access_key.smtp_user.ses_smtp_password_v4
}
This will output the user name and password needed for SMTP authentication for the region.
This will do the proper computation for the password.