Skip to content

Commit

Permalink
kinesis stream removal policy
Browse files Browse the repository at this point in the history
Signed-off-by: Francis <colifran@amazon.com>
  • Loading branch information
colifran committed May 1, 2024
1 parent 6b0fb5c commit 2420212
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/aws-cdk-lib/aws-kinesis/lib/stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { CfnStream } from './kinesis.generated';
import * as cloudwatch from '../../aws-cloudwatch';
import * as iam from '../../aws-iam';
import * as kms from '../../aws-kms';
import { ArnFormat, Aws, CfnCondition, Duration, Fn, IResolvable, IResource, Resource, Stack, Token } from '../../core';
import { ArnFormat, Aws, CfnCondition, Duration, Fn, IResolvable, IResource, RemovalPolicy, Resource, Stack, Token } from '../../core';

const READ_OPERATIONS = [
'kinesis:DescribeStreamSummary',
Expand Down Expand Up @@ -710,6 +710,13 @@ export interface StreamProps {
* @default StreamMode.PROVISIONED
*/
readonly streamMode?: StreamMode;

/**
* Policy to apply when the stream is removed from the stack.
*
* @default RemovalPolicy.RETAIN
*/
readonly removalPolicy?: RemovalPolicy;
}

/**
Expand Down Expand Up @@ -788,6 +795,7 @@ export class Stream extends StreamBase {
}
: undefined),
});
this.stream.applyRemovalPolicy(props.removalPolicy);

this.streamArn = this.getResourceArnAttribute(this.stream.attrArn, {
service: 'kinesis',
Expand Down

0 comments on commit 2420212

Please sign in to comment.