Adds a resource policy to the specified response plan. The resource policy is used to share the response plan using Resource Access Manager (RAM). For more information about cross-account sharing, see Cross-Region and cross-account incident management.
Parameters:
-
resource_arn
(Arn)
–
The Amazon Resource Name (ARN) of the response plan to add the resource policy to.
-
policy
(Policy)
–
Details of the resource policy.
Raises:
Source code in docs_src/capo_ssm_incidents/_services/async_ssm_incidents.py
| async def put_resource_policy(
self,
resource_arn: "capo_ssm_incidents.types.arn.Arn",
policy: "capo_ssm_incidents.types.policy.Policy",
*,
config_overrides: Optional[AsyncSSMIncidentsClientConfig] = None,
) -> "capo_ssm_incidents.types.put_resource_policy_output.PutResourcePolicyOutput":
"""<p>Adds a resource policy to the specified response plan. The resource policy is used to share the response 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/incident-manager-cross-account-cross-region.html">Cross-Region and cross-account incident management</a>.</p>
Args:
resource_arn: <p>The Amazon Resource Name (ARN) of the response plan to add the resource policy to.</p>
policy: <p>Details of the resource policy.</p>
Raises:
capo_ssm_incidents.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this operation.</p>
capo_ssm_incidents.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
capo_ssm_incidents.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource which doesn't exist. </p>
capo_ssm_incidents.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
capo_ssm_incidents.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
capo_ssm_incidents.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_ssm_incidents.types.put_resource_policy_input.PutResourcePolicyInput]",
) -> AsyncOperationResponse[
"capo_ssm_incidents.types.put_resource_policy_output.PutResourcePolicyOutput"
]:
import capo_ssm_incidents._operations.ssm_incidents.put_resource_policy
(
output,
http_response,
) = await capo_ssm_incidents._operations.ssm_incidents.put_resource_policy.async_put_resource_policy(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("PutResourcePolicy")
)
input_: capo_ssm_incidents.types.put_resource_policy_input.PutResourcePolicyInput = {
"resource_arn": resource_arn,
"policy": policy,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|