-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update lambda permission for private link (#154)
* add permission to lambda when deploying it with private link * add endpoint * terraform fmt * update changelog
- Loading branch information
Showing
7 changed files
with
77 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
resource "aws_cloudwatch_event_rule" "EventBridgeRule" { | ||
count = var.integration_type == "EcrScan" ? 1 : 0 | ||
name = format("ECR-image-scan-lambda-invoke") | ||
description = "Event rule for invoking Lambda on ECR image scan" | ||
event_pattern = jsonencode({ | ||
count = var.integration_type == "EcrScan" ? 1 : 0 | ||
name = format("ECR-image-scan-lambda-invoke") | ||
description = "Event rule for invoking Lambda on ECR image scan" | ||
event_pattern = jsonencode({ | ||
source = ["aws.ecr"], | ||
detail-type = ["ECR Image Scan"], | ||
detail = { | ||
scan-status = ["COMPLETE"] | ||
detail = { | ||
scan-status = ["COMPLETE"] | ||
} | ||
}) | ||
}) | ||
|
||
tags = { | ||
tags = { | ||
Name = "ECR-image-scan-lambda-invoke" | ||
} | ||
} | ||
} | ||
|
||
resource "aws_cloudwatch_event_target" "EventBridgeRuleTarget" { | ||
depends_on = [ aws_cloudwatch_event_rule.EventBridgeRule ] | ||
count = var.integration_type == "EcrScan" ? 1 : 0 | ||
rule = aws_cloudwatch_event_rule.EventBridgeRule[0].name | ||
target_id = "LambdaFunction" | ||
depends_on = [aws_cloudwatch_event_rule.EventBridgeRule] | ||
count = var.integration_type == "EcrScan" ? 1 : 0 | ||
rule = aws_cloudwatch_event_rule.EventBridgeRule[0].name | ||
target_id = "LambdaFunction" | ||
|
||
arn = element(module.lambda[*].integration.lambda_function_arn, 0) | ||
arn = element(module.lambda[*].integration.lambda_function_arn, 0) | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters