Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ module "lambda" {

// optionally overwrite `cloudwatch_event_target_arn` in case an alias should be used for the event rule
cloudwatch_event_target_arn = aws_lambda_alias.example.arn

// optionally add `cloudwatch_event_target_input` for event input
Copy link
Owner

Choose a reason for hiding this comment

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

the README.md is generated, could you please add this to docs/part1.md and run make documentation

Please also add this to the example in

cloudwatch_event_target_arn = aws_lambda_alias.example.arn

cloudwatch_event_target_input = jsonencode({"key": "value"})
}

pattern = {
Expand Down
5 changes: 3 additions & 2 deletions cloudwatch_event_rules.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ resource "aws_cloudwatch_event_rule" "lambda" {
resource "aws_cloudwatch_event_target" "lambda" {
for_each = var.cloudwatch_event_rules

arn = lookup(each.value, "cloudwatch_event_target_arn", local.function_arn)
rule = aws_cloudwatch_event_rule.lambda[each.key].name
arn = lookup(each.value, "cloudwatch_event_target_arn", local.function_arn)
rule = aws_cloudwatch_event_rule.lambda[each.key].name
input = lookup(each.value, "cloudwatch_event_target_input", null)
}
3 changes: 2 additions & 1 deletion docs/deployment/part2.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | 3.67.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.9 |

## Modules

Expand All @@ -36,6 +36,7 @@ No modules.
| [aws_iam_role.trigger](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
| [aws_iam_role_policy_attachment.codedeploy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
| [aws_s3_bucket.pipeline](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) | resource |
| [aws_s3_bucket_acl.pipeline](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_acl) | resource |
| [aws_s3_bucket_policy.cloudtrail](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_policy) | resource |
| [aws_s3_bucket_public_access_block.source](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_public_access_block) | resource |
| [aws_sns_topic.notifications](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sns_topic) | resource |
Expand Down
3 changes: 3 additions & 0 deletions docs/part1.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ module "lambda" {

// optionally overwrite `cloudwatch_event_target_arn` in case an alias should be used for the event rule
cloudwatch_event_target_arn = aws_lambda_alias.example.arn

// optionally add `cloudwatch_event_target_input` for event input
cloudwatch_event_target_input = jsonencode({"key": "value"})
}

pattern = {
Expand Down
5 changes: 4 additions & 1 deletion examples/with-cloudwatch-event-rules/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ module "lambda" {

// optionally overwrite `cloudwatch_event_target_arn` in case an alias should be used for the event rule
cloudwatch_event_target_arn = aws_lambda_alias.example.arn

// optionally add `cloudwatch_event_target_input` for event input
cloudwatch_event_target_input = jsonencode({ "key" : "value" })
}

pattern = {
Expand All @@ -39,4 +42,4 @@ module "lambda" {
PATTERN
}
}
}
}
3 changes: 2 additions & 1 deletion modules/deployment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ resource "aws_s3_bucket_object" "source" {

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | 3.67.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.9 |

## Modules

Expand All @@ -200,6 +200,7 @@ No modules.
| [aws_iam_role.trigger](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
| [aws_iam_role_policy_attachment.codedeploy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
| [aws_s3_bucket.pipeline](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) | resource |
| [aws_s3_bucket_acl.pipeline](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_acl) | resource |
| [aws_s3_bucket_policy.cloudtrail](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_policy) | resource |
| [aws_s3_bucket_public_access_block.source](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_public_access_block) | resource |
| [aws_sns_topic.notifications](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sns_topic) | resource |
Expand Down