gpt4 book ai didi

Terraform AWS SES 凭证资源

转载 作者:行者123 更新时间:2023-12-01 05:08:46 25 4
gpt4 key购买 nike

我已经搜索过,但没有找到任何信息。
我们可以使用 terraform 创建 AWS SES 凭证吗?

最佳答案

使用以下 terraform 代码获取 SES 凭据 -

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
}

关于Terraform AWS SES 凭证资源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52850212/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com