Commit 4e8654d1 authored by Chris Merrett's avatar Chris Merrett

Potential fix for broken scheduling, linted

parent aed242ed
Pipeline #4934 passed with stage
in 17 seconds
......@@ -36,34 +36,40 @@ variable "cloudwatch_schedule" {
#############################################################################################################
data "aws_iam_policy_document" "policy" {
statement {
effect = "Allow"
actions = [
effect = "Allow"
actions = [
"logs:*",
]
resources = [
"arn:aws:logs:*:*:*",
]
}
statement {
effect = "Allow"
actions = [
effect = "Allow"
actions = [
"ec2:Describe*",
]
resources = [
"*",
]
}
statement {
effect = "Allow"
actions = [
effect = "Allow"
actions = [
"ec2:CreateSnapshot",
"ec2:DeleteSnapshot",
"ec2:CreateTags",
"ec2:ModifySnapshotAttribute",
"ec2:ResetSnapshotAttribute",
]
resources = [
"*",
]
......@@ -72,11 +78,13 @@ data "aws_iam_policy_document" "policy" {
data "aws_iam_policy_document" "trust" {
statement {
effect = "Allow"
effect = "Allow"
principals {
type = "Service"
identifiers = ["lambda.amazonaws.com"]
}
actions = [
"sts:AssumeRole",
]
......@@ -122,6 +130,7 @@ resource "aws_lambda_permission" "main" {
action = "lambda:InvokeFunction"
function_name = "${aws_lambda_function.main.arn}"
principal = "events.amazonaws.com"
source_arn = "${aws_cloudwatch_event_rule.main.arn}"
}
#############################################################################################################
......@@ -134,6 +143,7 @@ resource "aws_cloudwatch_event_rule" "main" {
}
resource "aws_cloudwatch_event_target" "main" {
rule = "${aws_cloudwatch_event_rule.main.name}"
arn = "${aws_lambda_function.main.arn}"
rule = "${aws_cloudwatch_event_rule.main.name}"
arn = "${aws_lambda_function.main.arn}"
target_id = "${aws_lambda_function.main.function_name}"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment