main.tf 1.2 KB

12345678910111213141516171819202122232425262728
  1. resource "aws_cloudformation_stack" "aws_scheduler" {
  2. # ATM, we really don't want this in prod or common. If we change our minds, we'll need to verify that
  3. # the `schedule` tag is set correctly.
  4. #
  5. # Until then, this should prevent it, along with a warning in outputs.tf
  6. count = (var.environment == "test" || var.environment == "common") ? 1 : 0
  7. name = "aws-scheduler"
  8. on_failure = "ROLLBACK"
  9. #iam_role_arn = "${lookup(local.workspace_to_full_admin_assumerole,terraform.workspace,"")}"
  10. capabilities = ["CAPABILITY_IAM"]
  11. parameters = {
  12. UseCloudWatchMetrics = "Yes"
  13. Regions = var.aws_region
  14. SchedulerFrequency = "15"
  15. Trace = "Yes" # Detailed logs in Cloudwatch
  16. StartedTags = ""
  17. StoppedTags = ""
  18. CrossAccountRoles = ""
  19. # These will probably cause terraform drift so right now not doing them
  20. #StartedTags = "SchedulerStatus=Started {year}-{month}-{day} {hour}:{minute} {timezone}"
  21. #StoppedTags = "SchedulerStatus=Stopped {year}-{month}-{day} {hour}:{minute} {timezone}"
  22. }
  23. template_body = file("${path.module}/files/instance-scheduler.template.${var.aws_partition}")
  24. }