Skip to content

Commit

Permalink
update test to check for verification token
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Kania committed Dec 10, 2020
1 parent 10fd305 commit bd737d3
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ data "aws_route53_zone" "SES_domain" {
| Name | Description |
|------|-------------|
| ses\_identity\_arn | SES identity ARN. |
| ses\_verification\_token | A code which when added to the domain as a TXT record will signal to SES that the owner of the domain has authorised SES to act on their behalf. |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

Expand Down
2 changes: 1 addition & 1 deletion examples/simple/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ resource "aws_route53_record" "temp_verification" {
name = "_amazonses.${local.temp_domain}"
type = "TXT"
ttl = "600"
records = [var.test_name]
records = [module.ses_domain.ses_verification_token]
}


Expand Down
3 changes: 3 additions & 0 deletions examples/simple/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
output "ses_verification_token" {
value = module.ses_domain.ses_verification_token
}
5 changes: 5 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ output "ses_identity_arn" {
description = "SES identity ARN."
value = aws_ses_domain_identity.main.arn
}

output "ses_verification_token" {
description = "A code which when added to the domain as a TXT record will signal to SES that the owner of the domain has authorised SES to act on their behalf."
value = aws_ses_domain_identity.main.verification_token
}
3 changes: 2 additions & 1 deletion test/terraform_aws_ses_domain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ func TestTerraformSESDomainWithNoVerificationRecords(t *testing.T) {

terraform.InitAndApply(t, terraformOptions)

verificationToken := terraform.Output(t, terraformOptions, "ses_verification_token")
txtRecords, _ := net.LookupTXT(testDomain)
assert.Contains(t, txtRecords, testName)
assert.Contains(t, txtRecords, verificationToken)
}

0 comments on commit bd737d3

Please sign in to comment.