Skip to content

Commit

Permalink
fix(DMVP-5181): Add sqs event support
Browse files Browse the repository at this point in the history
  • Loading branch information
aramkarapetian committed Sep 23, 2024
1 parent 25c39ed commit 8ebdfc6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion s3.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ module "s3" {
website = var.s3_configs.website
create_iam_user = var.s3_configs.create_iam_user
cors_rule = var.s3_configs.cors_rule
event-notification-config = var.s3_configs.event-notification-config
event_notification_config = var.s3_configs.event_notification_config
}
4 changes: 2 additions & 2 deletions tests/s3-configed/1-example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ module "this" {
expose_headers = ["ETag", "Access-Control-Allow-Origin"]
}
]
event-notification-config = {
event_notification_config = {
target_type = "sqs"
queue_name = "test"
name_suffix = "event"
filter_prefix = "test/"
events = ["s3:ObjectCreated:*"]
}
Expand Down
13 changes: 7 additions & 6 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,20 @@ variable "s3_configs" {
website = optional(object({ index_document = string, error_document = string }), { index_document = "index.html", error_document = "index.html" })
create_iam_user = optional(bool, false)
cors_rule = optional(list(any), [])
event-notification-config = optional(object({
target_type = string,
queue_name = string,
filter_prefix = string,
events = optional(list(string), ["s3:ObjectCreated:*"])
event_notification_config = optional(object({
target_type = string, // Target type for the S3 event notification, can be "sqs" or "null". Other target types can be implemented in the future.
name_suffix = string, // Suffix to add to the target name.
filter_prefix = string, // Prefix to filter object key names for the event notification.
events = optional(list(string), ["s3:ObjectCreated:*"]) // List of S3 events that trigger the notification. Defaults to "s3:ObjectCreated:*".
}), {
target_type = "null"
queue_name = "test"
name_suffix = "event"
filter_prefix = "test/"
events = ["s3:ObjectCreated:*"]
}
)
})

default = {
acl = "private"
create_index_html = true
Expand Down

0 comments on commit 8ebdfc6

Please sign in to comment.