Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(export): send email confirmation #1041

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

kschelonka
Copy link
Contributor

@kschelonka kschelonka commented Feb 13, 2025

Send email confirmation for export -- notify users that request was received and provide them with further info.

Copied template from account deletion confirmation
image

@kschelonka kschelonka requested a review from a team as a code owner February 13, 2025 00:49
@kschelonka kschelonka requested review from marcin-kozinski and removed request for a team February 13, 2025 00:49
Copy link

github-actions bot commented Feb 13, 2025

Plan Result (@infrastructure/transactional-emails-production)

CI link

Plan: 1 to add, 2 to change, 0 to destroy.
  • Create
    • aws_sns_topic_subscription.ListEvents-sns-subscription
  • Update
    • aws_sqs_queue_policy.transactional-email-sns-dlq-policy
    • aws_sqs_queue_policy.transactional-email-sns-sqs-policy
Change Result (Click me)
  # aws_sns_topic_subscription.ListEvents-sns-subscription will be created
  + resource "aws_sns_topic_subscription" "ListEvents-sns-subscription" {
      + arn                             = (known after apply)
      + confirmation_timeout_in_minutes = 1
      + confirmation_was_authenticated  = (known after apply)
      + endpoint                        = "arn:aws:sqs:us-east-1:996905175585:TransactionalEmails-Prod-Sqs-Event-Consumer-Queue"
      + endpoint_auto_confirms          = false
      + filter_policy                   = jsonencode(
            {
              + detail-type = [
                  + "list-export-requested",
                ]
            }
        )
      + filter_policy_scope             = "MessageBody"
      + id                              = (known after apply)
      + owner_id                        = (known after apply)
      + pending_confirmation            = (known after apply)
      + protocol                        = "sqs"
      + raw_message_delivery            = false
      + redrive_policy                  = jsonencode(
            {
              + deadLetterTargetArn = "arn:aws:sqs:us-east-1:996905175585:TransactionalEmails-Prod-SNS-Topics-DLQ"
            }
        )
      + topic_arn                       = "arn:aws:sns:us-east-1:996905175585:PocketEventBridge-Prod-ListEvents"
    }

  # aws_sqs_queue_policy.transactional-email-sns-dlq-policy will be updated in-place
  ~ resource "aws_sqs_queue_policy" "transactional-email-sns-dlq-policy" {
        id        = "https://sqs.us-east-1.amazonaws.com/996905175585/TransactionalEmails-Prod-SNS-Topics-DLQ"
      ~ policy    = jsonencode(
          ~ {
              ~ Statement = [
                  ~ {
                      ~ Condition = {
                          ~ ArnLike = {
                              ~ "aws:SourceArn" = [
                                    # (4 unchanged elements hidden)
                                    "arn:aws:sns:us-east-1:996905175585:PocketEventBridge-Prod-ListExportReadyEvents",
                                  + "arn:aws:sns:us-east-1:996905175585:PocketEventBridge-Prod-ListEvents",
                                ]
                            }
                        }
                        # (4 unchanged attributes hidden)
                    },
                ]
                # (1 unchanged attribute hidden)
            }
        )
        # (1 unchanged attribute hidden)
    }

  # aws_sqs_queue_policy.transactional-email-sns-sqs-policy will be updated in-place
  ~ resource "aws_sqs_queue_policy" "transactional-email-sns-sqs-policy" {
        id        = "https://sqs.us-east-1.amazonaws.com/996905175585/TransactionalEmails-Prod-Sqs-Event-Consumer-Queue"
      ~ policy    = jsonencode(
          ~ {
              ~ Statement = [
                  ~ {
                      ~ Condition = {
                          ~ ArnLike = {
                              ~ "aws:SourceArn" = [
                                    # (4 unchanged elements hidden)
                                    "arn:aws:sns:us-east-1:996905175585:PocketEventBridge-Prod-ListExportReadyEvents",
                                  + "arn:aws:sns:us-east-1:996905175585:PocketEventBridge-Prod-ListEvents",
                                ]
                            }
                        }
                        # (4 unchanged attributes hidden)
                    },
                ]
                # (1 unchanged attribute hidden)
            }
        )
        # (1 unchanged attribute hidden)
    }

Plan: 1 to add, 2 to change, 0 to destroy.

⚠️ Errors

Copy link

@nzeltzer nzeltzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

kschelonka and others added 4 commits February 13, 2025 10:59
There is a delay between when a file is expired and when
it is actually deleted from s3. We want to be more timely,
so check for expiration when checking for file existence.

add expiration rules to localstack for testing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants