File tree Expand file tree Collapse file tree 4 files changed +23
-9
lines changed Expand file tree Collapse file tree 4 files changed +23
-9
lines changed Original file line number Diff line number Diff line change @@ -105,11 +105,12 @@ module "eventbridge" {
105
105
attach_role_arn = true
106
106
},
107
107
{
108
- name = " send-orders-to-kinesis"
109
- arn = aws_kinesis_stream.this.arn
110
- dead_letter_arn = aws_sqs_queue.dlq.arn
111
- input_transformer = local.order_input_transformer
112
- attach_role_arn = true
108
+ name = " send-orders-to-kinesis"
109
+ arn = aws_kinesis_stream.this.arn
110
+ dead_letter_arn = aws_sqs_queue.dlq.arn
111
+ input_transformer = local.order_input_transformer
112
+ partition_key_path = " $.id"
113
+ attach_role_arn = true
113
114
},
114
115
{
115
116
name = " process-email-with-ecs-task" ,
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ Note that this example may create resources which cost money. Run `terraform des
28
28
29
29
| Name | Version |
30
30
| ------| ---------|
31
+ | <a name =" provider_aws " ></a > [ aws] ( #provider\_ aws ) | >= 5.27 |
31
32
| <a name =" provider_null " ></a > [ null] ( #provider\_ null ) | >= 2.0 |
32
33
| <a name =" provider_random " ></a > [ random] ( #provider\_ random ) | >= 3.0 |
33
34
@@ -42,6 +43,7 @@ Note that this example may create resources which cost money. Run `terraform des
42
43
43
44
| Name | Type |
44
45
| ------| ------|
46
+ | [ aws_kinesis_stream.this] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/kinesis_stream ) | resource |
45
47
| [ null_resource.download_package] ( https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource ) | resource |
46
48
| [ random_pet.this] ( https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet ) | resource |
47
49
Original file line number Diff line number Diff line change @@ -42,6 +42,12 @@ module "eventbridge" {
42
42
schedule_expression = " rate(10 hours)"
43
43
arn = module.lambda.lambda_function_arn
44
44
}
45
+ kinesis-cron = {
46
+ group_name = " prod"
47
+ schedule_expression = " rate(10 hours)"
48
+ arn = aws_kinesis_stream.this.arn
49
+ partition_key = " foo"
50
+ }
45
51
}
46
52
}
47
53
@@ -53,6 +59,11 @@ resource "random_pet" "this" {
53
59
length = 2
54
60
}
55
61
62
+ resource "aws_kinesis_stream" "this" {
63
+ name = random_pet. this . id
64
+ shard_count = 1
65
+ }
66
+
56
67
# ############################################
57
68
# Using packaged function from Lambda module
58
69
# ############################################
Original file line number Diff line number Diff line change @@ -195,10 +195,10 @@ resource "aws_cloudwatch_event_target" "this" {
195
195
}
196
196
197
197
dynamic "kinesis_target" {
198
- for_each = lookup (each. value , " kinesis_target " , null ) != null ? [true ] : []
198
+ for_each = lookup (each. value , " partition_key_path " , null ) != null ? [true ] : []
199
199
200
200
content {
201
- partition_key_path = lookup (kinesis_target . value , " partition_key_path" , null )
201
+ partition_key_path = each . value . partition_key_path
202
202
}
203
203
}
204
204
@@ -561,10 +561,10 @@ resource "aws_scheduler_schedule" "this" {
561
561
}
562
562
563
563
dynamic "kinesis_parameters" {
564
- for_each = lookup (each. value , " kinesis_parameters " , null ) != null ? [true ] : []
564
+ for_each = lookup (each. value , " partition_key " , null ) != null ? [true ] : []
565
565
566
566
content {
567
- partition_key = kinesis_parameters . value . partition_key
567
+ partition_key = each . value . partition_key
568
568
}
569
569
}
570
570
You can’t perform that action at this time.
0 commit comments