Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. # CloudWatchのルールリソース
  2. resource "aws_cloudwatch_event_rule" "run_lambda_rule" {
  3. name = "run_lambda_rule"
  4. description = "Run Lambda Rule"
  5. schedule_expression = "cron(0/5 * * * ? *)"
  6. lifecycle {
  7. ignore_changes = ["schedule_expression"]
  8. }
  9.  
  10. is_enabled = "true"
  11. }
  12.  
  13.  
  14. # ルールを適用させるターゲット(今回はlambdaを指定する)
  15. resource "aws_cloudwatch_event_target" "run_lambda_target" {
  16. rule = aws_cloudwatch_event_rule.run_lambda_rule.name
  17. target_id = "sample_run_lambda"
  18. arn = aws_lambda_function.example_lambda.arn
  19. depends_on = [aws_cloudwatch_event_rule.run_lambda_rule, ]
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement