Select your cookie preferences

We use cookies and similar tools to enhance your experience, provide our services, deliver relevant advertising, and make improvements. Approved third parties also use these tools to help us deliver advertising and provide certain site features.

create_contact

create_contact(**kwargs)

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.

See also: AWS API Documentation

Request Syntax

response = client.create_contact(
    Alias='string',
    DisplayName='string',
    Type='PERSONAL'|'ESCALATION',
    Plan={
        'Stages': [
            {
                'DurationInMinutes': 123,
                'Targets': [
                    {
                        'ChannelTargetInfo': {
                            'ContactChannelId': 'string',
                            'RetryIntervalInMinutes': 123
                        },
                        'ContactTargetInfo': {
                            'ContactId': 'string',
                            'IsEssential': True|False
                        }
                    },
                ]
            },
        ]
    },
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    IdempotencyToken='string'
)
Parameters
  • Alias (string) --

    [REQUIRED]

    The short name to quickly identify a contact or escalation plan. The contact alias must be unique and identifiable.

  • DisplayName (string) -- The full name of the contact or escalation plan.
  • Type (string) --

    [REQUIRED]

    To create an escalation plan use ESCALATION . To create a contact use PERSONAL .

  • Plan (dict) --

    [REQUIRED]

    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.

    • Stages (list) -- [REQUIRED]

      A list of stages that the escalation plan or engagement plan uses to engage contacts and contact methods.

      • (dict) --

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

        • DurationInMinutes (integer) -- [REQUIRED]

          The time to wait until beginning the next stage. The duration can only be set to 0 if a target is specified.

        • Targets (list) -- [REQUIRED]

          The contacts or contact methods that the escalation plan or engagement plan is engaging.

          • (dict) --

            The contact or contact channel that's being engaged.

            • ChannelTargetInfo (dict) --

              Information about the contact channel Incident Manager is engaging.

              • ContactChannelId (string) -- [REQUIRED]

                The Amazon Resource Name (ARN) of the contact channel.

              • RetryIntervalInMinutes (integer) --

                The number of minutes to wait to retry sending engagement in the case the engagement initially fails.

            • ContactTargetInfo (dict) --

              Information about the contact that Incident Manager is engaging.

              • ContactId (string) --

                The Amazon Resource Name (ARN) of the contact.

              • IsEssential (boolean) -- [REQUIRED]

                A Boolean value determining if the contact's acknowledgement stops the progress of stages in the plan.

  • Tags (list) --

    Adds a tag to the target. You can only tag resources created in the first Region of your replication set.

    • (dict) --

      A container of a key-value name pair.

      • Key (string) --

        Name of the object key.

      • Value (string) --

        Value of the tag.

  • IdempotencyToken (string) --

    A token ensuring that the operation is called only once with the specified details.

    This field is autopopulated if not provided.

Return type

dict

Returns

Response Syntax

{
    'ContactArn': 'string'
}

Response Structure

  • (dict) --

    • ContactArn (string) --

      The Amazon Resource Name (ARN) of the created contact or escalation plan.

Exceptions

  • SSMContacts.Client.exceptions.AccessDeniedException
  • SSMContacts.Client.exceptions.ConflictException
  • SSMContacts.Client.exceptions.InternalServerException
  • SSMContacts.Client.exceptions.ServiceQuotaExceededException
  • SSMContacts.Client.exceptions.ThrottlingException
  • SSMContacts.Client.exceptions.ValidationException
  • SSMContacts.Client.exceptions.DataEncryptionException

Examples

The following create-contact example creates a contact in your environment with a blank plan. The plan can be updated after creating contact channels. Use the create-contact-channel operation with the output ARN of this command. After you have created contact channels for this contact use update-contact to update the plan.

response = client.create_contact(
    Alias='akuam',
    DisplayName='Akua Mansa',
    Plan={
        'Stages': [
        ],
    },
    Type='PERSONAL',
)

print(response)

Expected Output:

{
    'ContactArn': 'arn:aws:ssm-contacts:us-east-2:111122223333:contact/akuam',
    'ResponseMetadata': {
        '...': '...',
    },
}