use of software.amazon.awssdk.services.firehose.model.CreateDeliveryStreamRequest in project flink by apache.
the class KinesisFirehoseTestUtils method createDeliveryStream.
public static void createDeliveryStream(String deliveryStreamName, String bucketName, String roleARN, FirehoseAsyncClient firehoseAsyncClient) throws ExecutionException, InterruptedException {
ExtendedS3DestinationConfiguration s3Config = ExtendedS3DestinationConfiguration.builder().bucketARN(bucketName).roleARN(roleARN).build();
CreateDeliveryStreamRequest request = CreateDeliveryStreamRequest.builder().deliveryStreamName(deliveryStreamName).extendedS3DestinationConfiguration(s3Config).deliveryStreamType(DeliveryStreamType.DIRECT_PUT).build();
CompletableFuture<CreateDeliveryStreamResponse> deliveryStream = firehoseAsyncClient.createDeliveryStream(request);
deliveryStream.get();
}
use of software.amazon.awssdk.services.firehose.model.CreateDeliveryStreamRequest in project aws-doc-sdk-examples by awsdocs.
the class CreateDeliveryStream method createStream.
// snippet-start:[firehose.java2.create_stream.main]
public static void createStream(FirehoseClient firehoseClient, String bucketARN, String roleARN, String streamName) {
try {
ExtendedS3DestinationConfiguration destinationConfiguration = ExtendedS3DestinationConfiguration.builder().bucketARN(bucketARN).roleARN(roleARN).build();
CreateDeliveryStreamRequest deliveryStreamRequest = CreateDeliveryStreamRequest.builder().deliveryStreamName(streamName).extendedS3DestinationConfiguration(destinationConfiguration).deliveryStreamType("DirectPut").build();
CreateDeliveryStreamResponse streamResponse = firehoseClient.createDeliveryStream(deliveryStreamRequest);
System.out.println("Delivery Stream ARN is " + streamResponse.deliveryStreamARN());
} catch (FirehoseException e) {
System.out.println(e.getLocalizedMessage());
System.exit(1);
}
}
Aggregations