distributeImage method

Future<DistributeImageResponse> distributeImage({
  1. required String distributionConfigurationArn,
  2. required String executionRole,
  3. required String sourceImage,
  4. String? clientToken,
  5. ImageLoggingConfiguration? loggingConfiguration,
  6. Map<String, String>? tags,
})

DistributeImage distributes existing AMIs to additional regions and accounts without rebuilding the image.

May throw AccessDeniedException. May throw CallRateLimitExceededException. May throw ClientException. May throw ForbiddenException. May throw IdempotentParameterMismatchException. May throw InvalidRequestException. May throw ResourceInUseException. May throw ResourceNotFoundException. May throw ServiceException. May throw ServiceQuotaExceededException. May throw ServiceUnavailableException. May throw TooManyRequestsException.

Parameter distributionConfigurationArn : The Amazon Resource Name (ARN) of the distribution configuration to use.

Parameter executionRole : The IAM role to use for the distribution.

Parameter sourceImage : The source image Amazon Resource Name (ARN) to distribute.

Parameter clientToken : Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see Ensuring idempotency in the Amazon EC2 API Reference.

Parameter loggingConfiguration : The logging configuration for the distribution.

Parameter tags : The tags to apply to the distributed image.

Implementation

Future<DistributeImageResponse> distributeImage({
  required String distributionConfigurationArn,
  required String executionRole,
  required String sourceImage,
  String? clientToken,
  ImageLoggingConfiguration? loggingConfiguration,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'distributionConfigurationArn': distributionConfigurationArn,
    'executionRole': executionRole,
    'sourceImage': sourceImage,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (loggingConfiguration != null)
      'loggingConfiguration': loggingConfiguration,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/DistributeImage',
    exceptionFnMap: _exceptionFns,
  );
  return DistributeImageResponse.fromJson(response);
}