putImageRecipePolicy method

Future<PutImageRecipePolicyResponse> putImageRecipePolicy({
  1. required String imageRecipeArn,
  2. required String policy,
})

Applies a policy to an image recipe. We recommend that you call the RAM API CreateResourceShare to share resources. If you call the Image Builder API PutImageRecipePolicy, you must also call the RAM API PromoteResourceShareCreatedFromPolicy in order for the resource to be visible to all principals with whom the resource is shared.

May throw CallRateLimitExceededException. May throw ClientException. May throw ForbiddenException. May throw InvalidParameterValueException. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ServiceException. May throw ServiceUnavailableException.

Parameter imageRecipeArn : The Amazon Resource Name (ARN) of the image recipe that this policy should be applied to.

Parameter policy : The policy to apply.

Implementation

Future<PutImageRecipePolicyResponse> putImageRecipePolicy({
  required String imageRecipeArn,
  required String policy,
}) async {
  final $payload = <String, dynamic>{
    'imageRecipeArn': imageRecipeArn,
    'policy': policy,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/PutImageRecipePolicy',
    exceptionFnMap: _exceptionFns,
  );
  return PutImageRecipePolicyResponse.fromJson(response);
}