putResourcePolicy method

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

Attaches a resource-based policy to an entity. Examples of an entity include: AmiProduct and ContainerProduct.

May throw AccessDeniedException. May throw InternalServiceException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter policy : The policy document to set; formatted in JSON.

Parameter resourceArn : The Amazon Resource Name (ARN) of the entity resource you want to associate with a resource policy.

Implementation

Future<void> 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,
  );
}