contacts
Creates, updates, deletes, gets or lists a contacts resource.
Overview
| Name | contacts |
| Type | Resource |
| Id | aws.ssm_contacts.contacts |
Fields
The following fields are returned by SELECT queries:
- get_contact
- list_contacts
| Name | Datatype | Description |
|---|---|---|
alias | string | The alias of the contact or escalation plan. The alias is unique and identifiable. (pattern: <code>^[a-z0-9_-]*$</code>) |
contact_arn | string | The ARN of the contact or escalation plan. (pattern: <code>arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\w+=/,.@]:[0-9]+:([\w+=/,.@:-]+)</code>) |
display_name | string | The full name of the contact or escalation plan. (pattern: <code>^[\p{L}\p{Z}\p{N}_.-]*$</code>) |
plan | object | Details about the specific timing or stages and targets of the escalation plan or engagement plan. |
type | string | The type of contact. (PERSONAL, ESCALATION, ONCALL_SCHEDULE) |
| Name | Datatype | Description |
|---|---|---|
alias | string | The unique and identifiable alias of the contact or escalation plan. (pattern: <code>^[a-z0-9_-]*$</code>) |
contact_arn | string | The Amazon Resource Name (ARN) of the contact or escalation plan. (pattern: <code>arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\w+=/,.@]:[0-9]+:([\w+=/,.@:-]+)</code>) |
display_name | string | The full name of the contact or escalation plan. (pattern: <code>^[\p{L}\p{Z}\p{N}_.-]*$</code>) |
type | string | The type of contact. PERSONAL: A single, individual contact. ESCALATION: An escalation plan. ONCALL_SCHEDULE: An on-call schedule. (PERSONAL, ESCALATION, ONCALL_SCHEDULE) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_contact | select | region | Retrieves information about the specified contact or escalation plan. | |
list_contacts | select | region | Lists all contacts and escalation plans in Incident Manager. | |
create_contact | insert | region | Contacts are either the contacts that Incident Manager engages during an incident or the escalation plans that Incident Manager uses to engage contacts in phases during an incident. | |
update_contact | update | region, ContactId | Updates the contact or escalation plan specified. | |
delete_contact | delete | region | To remove a contact from Incident Manager, you can delete the contact. However, deleting a contact does not remove it from escalation plans and related response plans. Deleting an escalation plan also does not remove it from all related response plans. To modify an escalation plan, we recommend using the UpdateContact action to specify a different existing contact. | |
activate_contact_channel | exec | region, ContactChannelId, ActivationCode | Activates a contact's contact channel. Incident Manager can't engage a contact until the contact channel has been activated. | |
deactivate_contact_channel | exec | region, ContactChannelId | To no longer receive Incident Manager engagements to a contact channel, you can deactivate the channel. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_contact
- list_contacts
Retrieves information about the specified contact or escalation plan.
SELECT
alias,
contact_arn,
display_name,
plan,
type
FROM aws.ssm_contacts.contacts
WHERE region = '{{ region }}' -- required
;
Lists all contacts and escalation plans in Incident Manager.
SELECT
alias,
contact_arn,
display_name,
type
FROM aws.ssm_contacts.contacts
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_contact
- Manifest
Contacts are either the contacts that Incident Manager engages during an incident or the escalation plans that Incident Manager uses to engage contacts in phases during an incident.
INSERT INTO aws.ssm_contacts.contacts (
Alias,
DisplayName,
Type,
Plan,
Tags,
IdempotencyToken,
region
)
SELECT
'{{ Alias }}',
'{{ DisplayName }}',
'{{ Type }}',
'{{ Plan }}',
'{{ Tags }}',
'{{ IdempotencyToken }}',
'{{ region }}'
RETURNING
contact_arn
;
# Description fields are for documentation purposes
- name: contacts
props:
- name: region
value: "{{ region }}"
description: Required parameter for the contacts resource.
- name: Alias
value: "{{ Alias }}"
description: |
The short name to quickly identify a contact or escalation plan. The contact alias must be unique and identifiable.
- name: DisplayName
value: "{{ DisplayName }}"
description: |
The full name of the contact or escalation plan.
- name: Type
value: "{{ Type }}"
description: |
The type of contact to create. PERSONAL: A single, individual contact. ESCALATION: An escalation plan. ONCALL_SCHEDULE: An on-call schedule.
valid_values: ['PERSONAL', 'ESCALATION', 'ONCALL_SCHEDULE']
- name: Plan
description: |
A list of stages. A contact has an engagement plan with stages that contact specified contact channels. An escalation plan uses stages that contact specified contacts.
value:
Stages:
- DurationInMinutes: {{ DurationInMinutes }}
Targets: "{{ Targets }}"
RotationIds:
- "{{ RotationIds }}"
- name: Tags
description: |
Adds a tag to the target. You can only tag resources created in the first Region of your replication set.
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
- name: IdempotencyToken
value: "{{ IdempotencyToken }}"
description: |
A token ensuring that the operation is called only once with the specified details.
UPDATE examples
- update_contact
Updates the contact or escalation plan specified.
UPDATE aws.ssm_contacts.contacts
SET
ContactId = '{{ ContactId }}',
DisplayName = '{{ DisplayName }}',
Plan = '{{ Plan }}'
WHERE
region = '{{ region }}' --required
AND ContactId = '{{ ContactId }}' --required;
DELETE examples
- delete_contact
To remove a contact from Incident Manager, you can delete the contact. However, deleting a contact does not remove it from escalation plans and related response plans. Deleting an escalation plan also does not remove it from all related response plans. To modify an escalation plan, we recommend using the UpdateContact action to specify a different existing contact.
DELETE FROM aws.ssm_contacts.contacts
WHERE region = '{{ region }}' --required
;
Lifecycle Methods
- activate_contact_channel
- deactivate_contact_channel
Activates a contact's contact channel. Incident Manager can't engage a contact until the contact channel has been activated.
EXEC aws.ssm_contacts.contacts.activate_contact_channel
@region='{{ region }}' --required
@@json=
'{
"ContactChannelId": "{{ ContactChannelId }}",
"ActivationCode": "{{ ActivationCode }}"
}'
;
To no longer receive Incident Manager engagements to a contact channel, you can deactivate the channel.
EXEC aws.ssm_contacts.contacts.deactivate_contact_channel
@region='{{ region }}' --required
@@json=
'{
"ContactChannelId": "{{ ContactChannelId }}"
}'
;