Resource: aws_ssmcontacts_rotation

Provides a Terraform resource for managing a Contacts Rotation in AWS Systems Manager Incident Manager.

Example Usage

Basic Usage

resource "aws_ssmcontacts_rotation" "example" {
  contact_ids = [
    aws_ssmcontacts_contact.example.arn
  ]

  name = "rotation"

  recurrence {
    number_of_on_calls    = 1
    recurrence_multiplier = 1
    daily_settings {
      hour_of_day    = 9
      minute_of_hour = 00
    }
  }

  time_zone_id = "Australia/Sydney"

  depends_on = [aws_ssmincidents_replication_set.example]
}

Usage with Weekly Settings and Shift Coverages Fields

resource "aws_ssmcontacts_rotation" "example" {
  contact_ids = [
    aws_ssmcontacts_contact.example.arn
  ]

  name = "rotation"

  recurrence {
    number_of_on_calls    = 1
    recurrence_multiplier = 1
    weekly_settings {
      day_of_week = "WED"
      hand_off_time {
        hour_of_day    = 04
        minute_of_hour = 25
      }
    }

    weekly_settings {
      day_of_week = "FRI"
      hand_off_time {
        hour_of_day    = 15
        minute_of_hour = 57
      }
    }

    shift_coverages {
      map_block_key = "MON"
      coverage_times {
        start {
          hour_of_day    = 01
          minute_of_hour = 00
        }
        end {
          hour_of_day    = 23
          minute_of_hour = 00
        }
      }
    }
  }

  start_time = "2023-07-20T02:21:49+00:00"

  time_zone_id = "Australia/Sydney"

  tags = {
    key1 = "tag1"
    key2 = "tag2"
  }

  depends_on = [aws_ssmincidents_replication_set.example]
}

Usage with Monthly Settings Fields

resource "aws_ssmcontacts_rotation" "example" {
  contact_ids = [
    aws_ssmcontacts_contact.example.arn,
  ]

  name = "rotation"

  recurrence {
    number_of_on_calls    = 1
    recurrence_multiplier = 1
    monthly_settings {
      day_of_month = 20
      hand_off_time {
        hour_of_day    = 8
        minute_of_hour = 00
      }
    }
    monthly_settings {
      day_of_month = 13
      hand_off_time {
        hour_of_day    = 12
        minute_of_hour = 34
      }
    }
  }

  time_zone_id = "Australia/Sydney"

  depends_on = [aws_ssmincidents_replication_set.example]
}

Argument Reference

The following arguments are required:

The following arguments are optional:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Recurrence

Daily Settings

Monthly Settings

Weekly Settings

Hand Off Time

Shift Coverages

Coverage Times

Import

In Terraform v1.5.0 and later, use an import block to import SSMContacts Rotation using the arn. For example:

import {
  to = aws_ssmcontacts_rotation.example
  id = "arn:aws:ssm-contacts:us-east-1:012345678910:rotation/example"
}

Using terraform import, import CodeGuru Profiler Profiling Group using the arn. For example:

% terraform import aws_ssmcontacts_rotation.example arn:aws:ssm-contacts:us-east-1:012345678910:rotation/example