Skip to content

Commit c016a9f

Browse files
authored
fix(iot): FirehoseStreamAction is now called FirehosePutRecordAction (#18356)
By #18321 (comment) BREAKING CHANGE: the class `FirehoseStreamAction` has been renamed to `FirehosePutRecordAction` ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent ee95905 commit c016a9f

File tree

6 files changed

+14
-15
lines changed

6 files changed

+14
-15
lines changed

packages/@aws-cdk/aws-iot-actions/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,9 @@ const stream = new firehose.DeliveryStream(this, 'MyStream', {
189189
const topicRule = new iot.TopicRule(this, 'TopicRule', {
190190
sql: iot.IotSql.fromStringAsVer20160323("SELECT * FROM 'device/+/data'"),
191191
actions: [
192-
new actions.FirehoseStreamAction(stream, {
192+
new actions.FirehosePutRecordAction(stream, {
193193
batchMode: true,
194-
recordSeparator: actions.FirehoseStreamRecordSeparator.NEWLINE,
194+
recordSeparator: actions.FirehoseRecordSeparator.NEWLINE,
195195
}),
196196
],
197197
});

packages/@aws-cdk/aws-iot-actions/lib/firehose-stream-action.ts renamed to packages/@aws-cdk/aws-iot-actions/lib/firehose-put-record-action.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { singletonActionRole } from './private/role';
77
/**
88
* Record Separator to be used to separate records.
99
*/
10-
export enum FirehoseStreamRecordSeparator {
10+
export enum FirehoseRecordSeparator {
1111
/**
1212
* Separate by a new line
1313
*/
@@ -32,7 +32,7 @@ export enum FirehoseStreamRecordSeparator {
3232
/**
3333
* Configuration properties of an action for the Kinesis Data Firehose stream.
3434
*/
35-
export interface FirehoseStreamActionProps extends CommonActionProps {
35+
export interface FirehosePutRecordActionProps extends CommonActionProps {
3636
/**
3737
* Whether to deliver the Kinesis Data Firehose stream as a batch by using `PutRecordBatch`.
3838
* When batchMode is true and the rule's SQL statement evaluates to an Array, each Array
@@ -48,14 +48,14 @@ export interface FirehoseStreamActionProps extends CommonActionProps {
4848
*
4949
* @default - none -- the stream does not use a separator
5050
*/
51-
readonly recordSeparator?: FirehoseStreamRecordSeparator;
51+
readonly recordSeparator?: FirehoseRecordSeparator;
5252
}
5353

5454

5555
/**
5656
* The action to put the record from an MQTT message to the Kinesis Data Firehose stream.
5757
*/
58-
export class FirehoseStreamAction implements iot.IAction {
58+
export class FirehosePutRecordAction implements iot.IAction {
5959
private readonly batchMode?: boolean;
6060
private readonly recordSeparator?: string;
6161
private readonly role?: iam.IRole;
@@ -64,7 +64,7 @@ export class FirehoseStreamAction implements iot.IAction {
6464
* @param stream The Kinesis Data Firehose stream to which to put records.
6565
* @param props Optional properties to not use default
6666
*/
67-
constructor(private readonly stream: firehose.IDeliveryStream, props: FirehoseStreamActionProps = {}) {
67+
constructor(private readonly stream: firehose.IDeliveryStream, props: FirehosePutRecordActionProps = {}) {
6868
this.batchMode = props.batchMode;
6969
this.recordSeparator = props.recordSeparator;
7070
this.role = props.role;

packages/@aws-cdk/aws-iot-actions/lib/index.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ export * from './cloudwatch-logs-action';
22
export * from './cloudwatch-put-metric-action';
33
export * from './cloudwatch-set-alarm-state-action';
44
export * from './common-action-props';
5-
export * from './firehose-stream-action';
5+
export * from './firehose-put-record-action';
66
export * from './lambda-function-action';
77
export * from './s3-put-object-action';
88
export * from './sqs-queue-action';
9-

packages/@aws-cdk/aws-iot-actions/test/kinesis-firehose/firehose-stream-action.test.ts renamed to packages/@aws-cdk/aws-iot-actions/test/kinesis-firehose/firehose-put-record-action.test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ test('Default firehose stream action', () => {
1515

1616
// WHEN
1717
topicRule.addAction(
18-
new actions.FirehoseStreamAction(stream),
18+
new actions.FirehosePutRecordAction(stream),
1919
);
2020

2121
// THEN
@@ -77,7 +77,7 @@ test('can set batchMode', () => {
7777

7878
// WHEN
7979
topicRule.addAction(
80-
new actions.FirehoseStreamAction(stream, { batchMode: true }),
80+
new actions.FirehosePutRecordAction(stream, { batchMode: true }),
8181
);
8282

8383
// THEN
@@ -100,7 +100,7 @@ test('can set separotor', () => {
100100

101101
// WHEN
102102
topicRule.addAction(
103-
new actions.FirehoseStreamAction(stream, { recordSeparator: actions.FirehoseStreamRecordSeparator.NEWLINE }),
103+
new actions.FirehosePutRecordAction(stream, { recordSeparator: actions.FirehoseRecordSeparator.NEWLINE }),
104104
);
105105

106106
// THEN
@@ -124,7 +124,7 @@ test('can set role', () => {
124124

125125
// WHEN
126126
topicRule.addAction(
127-
new actions.FirehoseStreamAction(stream, { role }),
127+
new actions.FirehosePutRecordAction(stream, { role }),
128128
);
129129

130130
// THEN

packages/@aws-cdk/aws-iot-actions/test/kinesis-firehose/integ.firehose-stream-action.ts renamed to packages/@aws-cdk/aws-iot-actions/test/kinesis-firehose/integ.firehose-put-record-action.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ class TestStack extends cdk.Stack {
2525
destinations: [new destinations.S3Bucket(bucket)],
2626
});
2727
topicRule.addAction(
28-
new actions.FirehoseStreamAction(stream, {
28+
new actions.FirehosePutRecordAction(stream, {
2929
batchMode: true,
30-
recordSeparator: actions.FirehoseStreamRecordSeparator.NEWLINE,
30+
recordSeparator: actions.FirehoseRecordSeparator.NEWLINE,
3131
}),
3232
);
3333
}

0 commit comments

Comments
 (0)