Skip to content

Commit

Permalink
chore(kinesisfirehose-alpha): rename bind method to _bind and mark as…
Browse files Browse the repository at this point in the history
… internal
  • Loading branch information
paulhcsun committed Oct 21, 2024
1 parent 318eae6 commit 206bb8b
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ 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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ export class LambdaFunctionProcessor implements IDataProcessor {
this.props = props;
}

public bind(_scope: Construct, options: DataProcessorBindOptions): DataProcessorConfig {
/**
* @internal
*/
public _bind(_scope: Construct, options: DataProcessorBindOptions): DataProcessorConfig {
this.lambdaFunction.grantInvoke(options.role);

return {
Expand Down
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-kinesisfirehose-alpha/lib/processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ 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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 206bb8b

Please sign in to comment.