Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # CloudWatchのルールリソース
- resource "aws_cloudwatch_event_rule" "run_lambda_rule" {
- name = "run_lambda_rule"
- description = "Run Lambda Rule"
- schedule_expression = "cron(0/5 * * * ? *)"
- lifecycle {
- ignore_changes = ["schedule_expression"]
- }
- is_enabled = "true"
- }
- # ルールを適用させるターゲット(今回はlambdaを指定する)
- resource "aws_cloudwatch_event_target" "run_lambda_target" {
- rule = aws_cloudwatch_event_rule.run_lambda_rule.name
- target_id = "sample_run_lambda"
- arn = aws_lambda_function.example_lambda.arn
- depends_on = [aws_cloudwatch_event_rule.run_lambda_rule, ]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement