putContactPolicy method

Future<void> putContactPolicy({
  1. required String contactArn,
  2. required String policy,
})

Adds a resource policy to the specified contact or escalation plan. The resource policy is used to share the contact or escalation plan using Resource Access Manager (RAM). For more information about cross-account sharing, see Setting up cross-account functionality.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

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

Parameter policy : Details of the resource policy.

Implementation

Future<void> putContactPolicy({
  required String contactArn,
  required String policy,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SSMContacts.PutContactPolicy'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ContactArn': contactArn,
      'Policy': policy,
    },
  );
}