Skip to content

Commit

Permalink
Merge pull request #2 from joe-niland/master
Browse files Browse the repository at this point in the history
feat: Make creation of IAM user optional
  • Loading branch information
Sohan Yadav committed May 26, 2020
2 parents 459bb83 + 425c924 commit 85659a4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -166,20 +166,23 @@ resource "aws_ses_template" "default" {
# Module : IAM USER
# Description : Terraform module which creates SMTP Iam user resource on AWS
resource "aws_iam_user" "default" {
name = var.iam_name
count = var.iam_name != "" ? 1 : 0
name = var.iam_name
}

# Module : IAM ACCESS KEY
# Description : Terraform module which creates SMTP Iam access key resource on AWS
resource "aws_iam_access_key" "default" {
user = aws_iam_user.default.name
count = var.iam_name != "" ? 1 : 0
user = aws_iam_user.default[0].name
}

# Module : IAM USER POLICY
# Description : Terraform module which creates SMTP Iam user policy resource on AWS
resource "aws_iam_user_policy" "default" {
count = var.iam_name != "" ? 1 : 0
name = var.iam_name
user = aws_iam_user.default.name
user = aws_iam_user.default[0].name
policy = data.aws_iam_policy_document.allow_iam_name_to_send_emails.json
}

Expand Down

0 comments on commit 85659a4

Please sign in to comment.