Search in sources :

Example 1 with ExtendedS3DestinationConfiguration

use of software.amazon.awssdk.services.firehose.model.ExtendedS3DestinationConfiguration 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();
}
Also used : CreateDeliveryStreamResponse(software.amazon.awssdk.services.firehose.model.CreateDeliveryStreamResponse) CreateDeliveryStreamRequest(software.amazon.awssdk.services.firehose.model.CreateDeliveryStreamRequest) ExtendedS3DestinationConfiguration(software.amazon.awssdk.services.firehose.model.ExtendedS3DestinationConfiguration)

Example 2 with ExtendedS3DestinationConfiguration

use of software.amazon.awssdk.services.firehose.model.ExtendedS3DestinationConfiguration 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);
    }
}
Also used : FirehoseException(software.amazon.awssdk.services.firehose.model.FirehoseException) CreateDeliveryStreamResponse(software.amazon.awssdk.services.firehose.model.CreateDeliveryStreamResponse) CreateDeliveryStreamRequest(software.amazon.awssdk.services.firehose.model.CreateDeliveryStreamRequest) ExtendedS3DestinationConfiguration(software.amazon.awssdk.services.firehose.model.ExtendedS3DestinationConfiguration)

Aggregations

CreateDeliveryStreamRequest (software.amazon.awssdk.services.firehose.model.CreateDeliveryStreamRequest)2 CreateDeliveryStreamResponse (software.amazon.awssdk.services.firehose.model.CreateDeliveryStreamResponse)2 ExtendedS3DestinationConfiguration (software.amazon.awssdk.services.firehose.model.ExtendedS3DestinationConfiguration)2 FirehoseException (software.amazon.awssdk.services.firehose.model.FirehoseException)1