vendors have codes on them; making sqs for processing.

This commit is contained in:
Bryce Covert
2018-04-05 20:17:19 -07:00
parent 33cfc395de
commit 81263332df
13 changed files with 315 additions and 97 deletions

View File

@@ -45,6 +45,36 @@ resource "aws_s3_bucket" "invoices" {
}
EOF
}
resource "aws_sqs_queue" "integreat-mail" {
name = "integreat-mail-prod"
policy = <<POLICY
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": "*",
"Action": "sqs:SendMessage",
"Resource": "arn:aws:sqs:*:*:integreat-mail-prod",
"Condition": {
"ArnEquals": { "aws:SourceArn": "${aws_s3_bucket.invoices.arn}" }
}
}
]
}
POLICY
}
resource "aws_s3_bucket_notification" "mail_bucket_notification" {
bucket = "${aws_s3_bucket.invoices.id}"
queue {
queue_arn = "${aws_sqs_queue.integreat-mail.arn}"
events = ["s3:ObjectCreated:*"]
filter_suffix = ""
}
}
resource "aws_iam_user" "app_user" {
name = "integreat"