SSMContacts / Client / get_contact_policy

get_contact_policy#

SSMContacts.Client.get_contact_policy(**kwargs)#

Retrieves the resource policies attached to the specified contact or escalation plan.

See also: AWS API Documentation

Request Syntax

response = client.get_contact_policy(
    ContactArn='string'
)
Parameters:

ContactArn (string) –

[REQUIRED]

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

Return type:

dict

Returns:

Response Syntax

{
    'ContactArn': 'string',
    'Policy': 'string'
}

Response Structure

  • (dict) –

    • ContactArn (string) –

      The ARN of the contact or escalation plan.

    • Policy (string) –

      Details about the resource policy attached to the contact or escalation plan.

Exceptions

  • SSMContacts.Client.exceptions.AccessDeniedException

  • SSMContacts.Client.exceptions.InternalServerException

  • SSMContacts.Client.exceptions.ResourceNotFoundException

  • SSMContacts.Client.exceptions.ThrottlingException

  • SSMContacts.Client.exceptions.ValidationException

Examples

The following get-contact-policy example lists the resource policies associated with the specified contact.

response = client.get_contact_policy(
    ContactArn='arn:aws:ssm-contacts:us-east-1:111122223333:contact/akuam',
)

print(response)

Expected Output:

{
    'ContactArn': 'arn:aws:ssm-contacts:us-east-1:111122223333:contact/akuam',
    'Policy': '{"Version":"2012-10-17","Statement":[{"Sid":"SharePolicyForDocumentationDralia","Effect":"Allow","Principal":{"AWS":"222233334444"},"Action":["ssm-contacts:GetContact","ssm-contacts:StartEngagement","ssm-contacts:DescribeEngagement","ssm-contacts:ListPagesByEngagement","ssm-contacts:StopEngagement"],"Resource":["arn:aws:ssm-contacts:*:111122223333:contact/akuam","arn:aws:ssm-contacts:*:111122223333:engagement/akuam/*"]}]}',
    'ResponseMetadata': {
        '...': '...',
    },
}