putContainerRecipePolicy method

Future<PutContainerRecipePolicyResponse> putContainerRecipePolicy({
  1. required String containerRecipeArn,
  2. required String policy,
})

Applies a policy to a container image. We recommend that you call the RAM API CreateResourceShare (https://docs.aws.amazon.com//ram/latest/APIReference/API_CreateResourceShare.html) to share resources. If you call the Image Builder API PutContainerImagePolicy, you must also call the RAM API PromoteResourceShareCreatedFromPolicy (https://docs.aws.amazon.com//ram/latest/APIReference/API_PromoteResourceShareCreatedFromPolicy.html) 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 containerRecipeArn : The Amazon Resource Name (ARN) of the container recipe that this policy should be applied to.

Parameter policy : The policy to apply to the container recipe.

Implementation

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