From b6ffb7f694efd0c3f602a417d0c68b050ab139d1 Mon Sep 17 00:00:00 2001 From: Paul Sun Date: Mon, 21 Oct 2024 13:42:32 -0700 Subject: [PATCH] revert --- .../aws-kinesisfirehose-alpha/lib/delivery-stream.ts | 2 +- .../@aws-cdk/aws-kinesisfirehose-alpha/lib/destination.ts | 4 +--- .../lib/lambda-function-processor.ts | 5 +---- packages/@aws-cdk/aws-kinesisfirehose-alpha/lib/processor.ts | 4 +--- .../aws-kinesisfirehose-alpha/test/delivery-stream.test.ts | 2 +- .../test/integ.delivery-stream.source-stream.ts | 2 +- .../aws-kinesisfirehose-alpha/test/integ.delivery-stream.ts | 2 +- .../test/integ.kinesis-stream-events-target.ts | 2 +- .../lib/private/helpers.ts | 2 +- 9 files changed, 9 insertions(+), 16 deletions(-) diff --git a/packages/@aws-cdk/aws-kinesisfirehose-alpha/lib/delivery-stream.ts b/packages/@aws-cdk/aws-kinesisfirehose-alpha/lib/delivery-stream.ts index 71792fbd146cf..e00fd1f25b72f 100644 --- a/packages/@aws-cdk/aws-kinesisfirehose-alpha/lib/delivery-stream.ts +++ b/packages/@aws-cdk/aws-kinesisfirehose-alpha/lib/delivery-stream.ts @@ -358,7 +358,7 @@ export class DeliveryStream extends DeliveryStreamBase { readStreamGrant = props.source.grantRead(this._role); } - const destinationConfig = props.destination._bind(this, {}); + const destinationConfig = props.destination.bind(this, {}); const sourceConfig = props.source?._bind(this, this._role?.roleArn); const resource = new CfnDeliveryStream(this, 'Resource', { diff --git a/packages/@aws-cdk/aws-kinesisfirehose-alpha/lib/destination.ts b/packages/@aws-cdk/aws-kinesisfirehose-alpha/lib/destination.ts index 8a7c6afbf2fab..8993ee66e2352 100644 --- a/packages/@aws-cdk/aws-kinesisfirehose-alpha/lib/destination.ts +++ b/packages/@aws-cdk/aws-kinesisfirehose-alpha/lib/destination.ts @@ -34,8 +34,6 @@ export interface IDestination { * Binds this destination to the Kinesis Data Firehose delivery stream. * * Implementers should use this method to bind resources to the stack and initialize values using the provided stream. - * - * @internal */ - _bind(scope: Construct, options: DestinationBindOptions): DestinationConfig; + bind(scope: Construct, options: DestinationBindOptions): DestinationConfig; } diff --git a/packages/@aws-cdk/aws-kinesisfirehose-alpha/lib/lambda-function-processor.ts b/packages/@aws-cdk/aws-kinesisfirehose-alpha/lib/lambda-function-processor.ts index d8e637bc07a69..447f5e2196521 100644 --- a/packages/@aws-cdk/aws-kinesisfirehose-alpha/lib/lambda-function-processor.ts +++ b/packages/@aws-cdk/aws-kinesisfirehose-alpha/lib/lambda-function-processor.ts @@ -15,10 +15,7 @@ export class LambdaFunctionProcessor implements IDataProcessor { this.props = props; } - /** - * @internal - */ - public _bind(_scope: Construct, options: DataProcessorBindOptions): DataProcessorConfig { + public bind(_scope: Construct, options: DataProcessorBindOptions): DataProcessorConfig { this.lambdaFunction.grantInvoke(options.role); return { diff --git a/packages/@aws-cdk/aws-kinesisfirehose-alpha/lib/processor.ts b/packages/@aws-cdk/aws-kinesisfirehose-alpha/lib/processor.ts index 11f90eacca714..b5157f5872e01 100644 --- a/packages/@aws-cdk/aws-kinesisfirehose-alpha/lib/processor.ts +++ b/packages/@aws-cdk/aws-kinesisfirehose-alpha/lib/processor.ts @@ -91,8 +91,6 @@ export interface IDataProcessor { * * Implementers should use this method to grant processor invocation permissions to the provided stream and return the * necessary configuration to register as a processor. - * - * @internal */ - _bind(scope: Construct, options: DataProcessorBindOptions): DataProcessorConfig; + bind(scope: Construct, options: DataProcessorBindOptions): DataProcessorConfig; } diff --git a/packages/@aws-cdk/aws-kinesisfirehose-alpha/test/delivery-stream.test.ts b/packages/@aws-cdk/aws-kinesisfirehose-alpha/test/delivery-stream.test.ts index e5c401a507242..8a253966b3158 100644 --- a/packages/@aws-cdk/aws-kinesisfirehose-alpha/test/delivery-stream.test.ts +++ b/packages/@aws-cdk/aws-kinesisfirehose-alpha/test/delivery-stream.test.ts @@ -27,7 +27,7 @@ describe('delivery stream', () => { assumedBy: new iam.ServicePrincipal('firehose.amazonaws.com'), }); mockS3Destination = { - _bind(scope: Construct, _options: firehose.DestinationBindOptions): firehose.DestinationConfig { + bind(scope: Construct, _options: firehose.DestinationBindOptions): firehose.DestinationConfig { dependable = new class extends Construct { constructor(depScope: Construct, id: string) { super(depScope, id); diff --git a/packages/@aws-cdk/aws-kinesisfirehose-alpha/test/integ.delivery-stream.source-stream.ts b/packages/@aws-cdk/aws-kinesisfirehose-alpha/test/integ.delivery-stream.source-stream.ts index f75adb11fdc78..3d2441f2f018a 100644 --- a/packages/@aws-cdk/aws-kinesisfirehose-alpha/test/integ.delivery-stream.source-stream.ts +++ b/packages/@aws-cdk/aws-kinesisfirehose-alpha/test/integ.delivery-stream.source-stream.ts @@ -20,7 +20,7 @@ const role = new iam.Role(stack, 'Role', { }); const mockS3Destination: firehose.IDestination = { - _bind(_scope: constructs.Construct, _options: firehose.DestinationBindOptions): firehose.DestinationConfig { + bind(_scope: constructs.Construct, _options: firehose.DestinationBindOptions): firehose.DestinationConfig { const bucketGrant = bucket.grantReadWrite(role); return { extendedS3DestinationConfiguration: { diff --git a/packages/@aws-cdk/aws-kinesisfirehose-alpha/test/integ.delivery-stream.ts b/packages/@aws-cdk/aws-kinesisfirehose-alpha/test/integ.delivery-stream.ts index dfcc5d9f8f6a0..633e1fc0b5b2d 100644 --- a/packages/@aws-cdk/aws-kinesisfirehose-alpha/test/integ.delivery-stream.ts +++ b/packages/@aws-cdk/aws-kinesisfirehose-alpha/test/integ.delivery-stream.ts @@ -19,7 +19,7 @@ const role = new iam.Role(stack, 'Role', { }); const mockS3Destination: firehose.IDestination = { - _bind(_scope: constructs.Construct, _options: firehose.DestinationBindOptions): firehose.DestinationConfig { + bind(_scope: constructs.Construct, _options: firehose.DestinationBindOptions): firehose.DestinationConfig { const bucketGrant = bucket.grantReadWrite(role); return { extendedS3DestinationConfiguration: { diff --git a/packages/@aws-cdk/aws-kinesisfirehose-alpha/test/integ.kinesis-stream-events-target.ts b/packages/@aws-cdk/aws-kinesisfirehose-alpha/test/integ.kinesis-stream-events-target.ts index 54b90ad642cf0..a3d65c30c589d 100644 --- a/packages/@aws-cdk/aws-kinesisfirehose-alpha/test/integ.kinesis-stream-events-target.ts +++ b/packages/@aws-cdk/aws-kinesisfirehose-alpha/test/integ.kinesis-stream-events-target.ts @@ -21,7 +21,7 @@ const role = new iam.Role(stack, 'Role', { }); const mockS3Destination: firehose.IDestination = { - _bind(_scope: constructs.Construct, _options: firehose.DestinationBindOptions): firehose.DestinationConfig { + bind(_scope: constructs.Construct, _options: firehose.DestinationBindOptions): firehose.DestinationConfig { const bucketGrant = bucket.grantReadWrite(role); return { extendedS3DestinationConfiguration: { diff --git a/packages/@aws-cdk/aws-kinesisfirehose-destinations-alpha/lib/private/helpers.ts b/packages/@aws-cdk/aws-kinesisfirehose-destinations-alpha/lib/private/helpers.ts index 7da0b01d10824..969db751a0283 100644 --- a/packages/@aws-cdk/aws-kinesisfirehose-destinations-alpha/lib/private/helpers.ts +++ b/packages/@aws-cdk/aws-kinesisfirehose-destinations-alpha/lib/private/helpers.ts @@ -115,7 +115,7 @@ function renderDataProcessor( scope: Construct, role: iam.IRole, ): CfnDeliveryStream.ProcessorProperty { - const processorConfig = processor._bind(scope, { role }); + const processorConfig = processor.bind(scope, { role }); const parameters = [{ parameterName: 'RoleArn', parameterValue: role.roleArn }]; parameters.push(processorConfig.processorIdentifier); if (processor.props.bufferInterval) {