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
...@@ -37,9 +37,11 @@ variable "cloudwatch_schedule" { ...@@ -37,9 +37,11 @@ variable "cloudwatch_schedule" {
data "aws_iam_policy_document" "policy" { data "aws_iam_policy_document" "policy" {
statement { statement {
effect = "Allow" effect = "Allow"
actions = [ actions = [
"logs:*", "logs:*",
] ]
resources = [ resources = [
"arn:aws:logs:*:*:*", "arn:aws:logs:*:*:*",
] ]
...@@ -47,9 +49,11 @@ data "aws_iam_policy_document" "policy" { ...@@ -47,9 +49,11 @@ data "aws_iam_policy_document" "policy" {
statement { statement {
effect = "Allow" effect = "Allow"
actions = [ actions = [
"ec2:Describe*", "ec2:Describe*",
] ]
resources = [ resources = [
"*", "*",
] ]
...@@ -57,6 +61,7 @@ data "aws_iam_policy_document" "policy" { ...@@ -57,6 +61,7 @@ data "aws_iam_policy_document" "policy" {
statement { statement {
effect = "Allow" effect = "Allow"
actions = [ actions = [
"ec2:CreateSnapshot", "ec2:CreateSnapshot",
"ec2:DeleteSnapshot", "ec2:DeleteSnapshot",
...@@ -64,6 +69,7 @@ data "aws_iam_policy_document" "policy" { ...@@ -64,6 +69,7 @@ data "aws_iam_policy_document" "policy" {
"ec2:ModifySnapshotAttribute", "ec2:ModifySnapshotAttribute",
"ec2:ResetSnapshotAttribute", "ec2:ResetSnapshotAttribute",
] ]
resources = [ resources = [
"*", "*",
] ]
...@@ -73,10 +79,12 @@ data "aws_iam_policy_document" "policy" { ...@@ -73,10 +79,12 @@ data "aws_iam_policy_document" "policy" {
data "aws_iam_policy_document" "trust" { data "aws_iam_policy_document" "trust" {
statement { statement {
effect = "Allow" effect = "Allow"
principals { principals {
type = "Service" type = "Service"
identifiers = ["lambda.amazonaws.com"] identifiers = ["lambda.amazonaws.com"]
} }
actions = [ actions = [
"sts:AssumeRole", "sts:AssumeRole",
] ]
...@@ -122,6 +130,7 @@ resource "aws_lambda_permission" "main" { ...@@ -122,6 +130,7 @@ resource "aws_lambda_permission" "main" {
action = "lambda:InvokeFunction" action = "lambda:InvokeFunction"
function_name = "${aws_lambda_function.main.arn}" function_name = "${aws_lambda_function.main.arn}"
principal = "events.amazonaws.com" principal = "events.amazonaws.com"
source_arn = "${aws_cloudwatch_event_rule.main.arn}"
} }
############################################################################################################# #############################################################################################################
...@@ -136,4 +145,5 @@ resource "aws_cloudwatch_event_rule" "main" { ...@@ -136,4 +145,5 @@ resource "aws_cloudwatch_event_rule" "main" {
resource "aws_cloudwatch_event_target" "main" { resource "aws_cloudwatch_event_target" "main" {
rule = "${aws_cloudwatch_event_rule.main.name}" rule = "${aws_cloudwatch_event_rule.main.name}"
arn = "${aws_lambda_function.main.arn}" 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