locals{ schedule_expression= "rate(10 minutes)" } # Variables variable "stf_function_name" {} variable "stf_function_arn" {} # Resources data "aws_iam_policy_document" "allow_cloudwatch_to_execute_policy" { statement { actions = [ "sts:AssumeRole" ] principals { type = "Service" identifiers = [ "states.amazonaws.com", "events.amazonaws.com" ] } } } resource "aws_iam_role" "allow_cloudwatch_to_execute_role" { name = "aws-events-invoke-StepFunction" assume_role_policy = data.aws_iam_policy_document.allow_cloudwatch_to_execute_policy.json } resource "aws_iam_role_policy" "state_execution" { name = "state_execution_policy" role = aws_iam_role.allow_cloudwatch_to_execute_role.id policy = <