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.
Parameters:
-
contact_arn
(SsmContactsArn)
–
The Amazon Resource Name (ARN) of the contact or escalation plan.
-
policy
(Policy)
–
Details of the resource policy.
Raises:
Source code in docs_src/capo_ssm_contacts/_services/ssm_contacts.py
| def put_contact_policy(
self,
contact_arn: "capo_ssm_contacts.types.ssm_contacts_arn.SsmContactsArn",
policy: "capo_ssm_contacts.types.policy.Policy",
*,
config_overrides: Optional[SSMContactsClientConfig] = None,
) -> "capo_ssm_contacts.types.put_contact_policy_result.PutContactPolicyResult":
"""<p>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 <a href="https://docs.aws.amazon.com/incident-manager/latest/userguide/xa.html">Setting up cross-account functionality</a>.</p>
Args:
contact_arn: <p>The Amazon Resource Name (ARN) of the contact or escalation plan.</p>
policy: <p>Details of the resource policy.</p>
Raises:
capo_ssm_contacts.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this operation.</p>
capo_ssm_contacts.errors.conflict_exception.ConflictException: <p>Updating or deleting a resource causes an inconsistent state.</p>
capo_ssm_contacts.errors.internal_server_exception.InternalServerException: <p>Unexpected error occurred while processing the request.</p>
capo_ssm_contacts.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource that doesn't exist.</p>
capo_ssm_contacts.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
capo_ssm_contacts.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
capo_ssm_contacts.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_ssm_contacts.types.put_contact_policy_request.PutContactPolicyRequest]",
) -> OperationResponse[
"capo_ssm_contacts.types.put_contact_policy_result.PutContactPolicyResult"
]:
import capo_ssm_contacts._operations.ssm_contacts.put_contact_policy
output, http_response = (
capo_ssm_contacts._operations.ssm_contacts.put_contact_policy.put_contact_policy(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("PutContactPolicy")
)
input_: capo_ssm_contacts.types.put_contact_policy_request.PutContactPolicyRequest = {
"contact_arn": contact_arn,
"policy": policy,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|