putResourcePolicy method

Future<PutResourcePolicyOutput> putResourcePolicy({
  1. required String policy,
  2. required String resourceArn,
})

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.

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

Parameter policy : Details of the resource policy.

Parameter resourceArn : The Amazon Resource Name (ARN) of the response plan to add the resource policy to.

Implementation

Future<PutResourcePolicyOutput> putResourcePolicy({
  required String policy,
  required String resourceArn,
}) async {
  final $payload = <String, dynamic>{
    'policy': policy,
    'resourceArn': resourceArn,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/putResourcePolicy',
    exceptionFnMap: _exceptionFns,
  );
  return PutResourcePolicyOutput.fromJson(response);
}