putImageRecipePolicy method
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 ServiceException. May throw ClientException. May throw ServiceUnavailableException. May throw InvalidRequestException. May throw InvalidParameterValueException. May throw ResourceNotFoundException. May throw ForbiddenException. May throw CallRateLimitExceededException.
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 {
ArgumentError.checkNotNull(imageRecipeArn, 'imageRecipeArn');
ArgumentError.checkNotNull(policy, 'policy');
_s.validateStringLength(
'policy',
policy,
1,
30000,
isRequired: true,
);
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);
}