putComponentPolicy method

Future<PutComponentPolicyResponse> putComponentPolicy({
  1. required String componentArn,
  2. required String policy,
})

Applies a policy to a component. We recommend that you call the RAM API CreateResourceShare to share resources. If you call the Image Builder API PutComponentPolicy, 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 componentArn : The Amazon Resource Name (ARN) of the component that this policy should be applied to.

Parameter policy : The policy to apply.

Implementation

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