Resource: aws_ssmcontacts_plan

Terraform resource for managing an AWS SSM Contact Plan.

Example Usage

Basic Usage

resource "aws_ssmcontacts_plan" "example" {
  contact_id = "arn:aws:ssm-contacts:us-west-2:123456789012:contact/contactalias"
  stage {
    duration_in_minutes = 1
  }
}

Usage with SSM Contact

resource "aws_ssmcontacts_contact" "contact" {
  alias = "alias"
  type  = "PERSONAL"
}

resource "aws_ssmcontacts_plan" "plan" {
  contact_id = aws_ssmcontacts_contact.contact.arn
  stage {
    duration_in_minutes = 1
  }
}

Usage With All Fields

resource "aws_ssmcontacts_contact" "escalation_plan" {
  alias = "escalation-plan-alias"
  type  = "ESCALATION"
}

resource "aws_ssmcontacts_contact" "contact_one" {
  alias = "alias"
  type  = "PERSONAL"
}

resource "aws_ssmcontacts_contact" "contact_two" {
  alias = "alias"
  type  = "PERSONAL"
}

resource "aws_ssmcontacts_plan" "test" {
  contact_id = aws_ssmcontacts_contact.escalation_plan.arn

  stage {
    duration_in_minutes = 0

    target {
      contact_target_info {
        is_essential = false
        contact_id   = aws_ssmcontacts_contact.contact_one.arn
      }
    }

    target {
      contact_target_info {
        is_essential = true
        contact_id   = aws_ssmcontacts_contact.contact_two.arn
      }
    }

    target {
      channel_target_info {
        retry_interval_in_minutes = 2
        contact_channel_id        = aws_ssmcontacts_contact_channel.channel.arn
      }
    }
  }
}

Argument Reference

The following arguments are required:

Stage

A stage specifies a set amount of time that an escalation plan or engagement plan engages the specified contacts or contact methods.

The stage block supports the following:

Target

A target specifies the contact or contact channel that's being engaged.

The target block supports the following:

Channel Target Info

Channel target info specifies information about the contact channel that Incident Manager uses to engage the contact.

The channel_target_info block supports the following:

Contact Target Info

Contact target info specifies the contact that Incident Manager is engaging during an incident.

The contact_target_info block supports the following:

Attribute Reference

This resource exports no additional attributes.

Import

In Terraform v1.5.0 and later, use an import block to import SSM Contact Plan using the Contact ARN. For example:

import {
  to = aws_ssmcontacts_plan.example
  id = "{ARNValue}"
}

Using terraform import, import SSM Contact Plan using the Contact ARN. For example:

% terraform import aws_ssmcontacts_plan.example {ARNValue}