Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws_kinesis : Kinesis does not include streamMode Provisioned in CFN Template #31293

Closed
1 task done
Exter-dg opened this issue Sep 3, 2024 · 6 comments
Closed
1 task done
Assignees
Labels
@aws-cdk/aws-kinesis Related to Amazon Kinesis bug This issue is a bug. p3 potential-regression Marking this issue as a potential regression to be checked by team member

Comments

@Exter-dg
Copy link

Exter-dg commented Sep 3, 2024

Describe the bug

The Kinesis Stream documentation says that the default value of streamMode is Provisioned. But the cloudformation template omits this field in the latest version. It was set to Provisioned explicitly in previous versions - https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kinesis.Stream.html#streammode

This was not an issue earlier in 1.204.0 as streamMode was set to Provisioned in the CDK Code itself - https://github.com/aws/aws-cdk/blob/9752ed225c82982d8b443f7c6a47f47979458217/packages/%40aws-cdk/aws-kinesis/lib/stream.ts#L759C44-L759C67

But currently, it is set to undefined. While migrating from 1.204.0 to latest, I noticed that StreamMode was being removed from my Cloudformation template (diff). Even though the documentation states that it will be Provisioned by default.

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

1.204.0

Expected Behavior

StreamMode should be set to Provisioned by default as mentioned in the docs

Current Behavior

StreamMode is undefined and omitted from Cloudformation Template

Reproduction Steps

const myStream = new kinesis.Stream(this, "MyFirstStream", {
      streamName: "myStreamName",
      shardCount: 1,
      retentionPeriod: cdk.Duration.hours(retentionPeriodInDays * 24),
    });

Possible Solution

Set default value of streammode to provisioned in the code

Additional Information/Context

No response

CDK CLI Version

2.108.1

Framework Version

No response

Node.js Version

v22.1.0

OS

MacOs

Language

TypeScript

Language Version

No response

Other information

No response

@Exter-dg Exter-dg added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 3, 2024
@github-actions github-actions bot added @aws-cdk/aws-kinesis Related to Amazon Kinesis potential-regression Marking this issue as a potential regression to be checked by team member labels Sep 3, 2024
@Exter-dg
Copy link
Author

Exter-dg commented Sep 3, 2024

I believe this was removed as part of this issue and the commit associated with it: #21829.

If that's the case, isn't the documentation incorrect to state that streamMode will be set to Provisioned by default?

@ashishdhingra ashishdhingra self-assigned this Sep 3, 2024
@ashishdhingra
Copy link
Contributor

@Exter-dg Good morning. Thanks for opening the issue. The documentation just indicates that the property streamMode is not optional and if the value is not specified, then CloudFormation by default considers value as StreamMode.PROVISIONED. The issue #21829 (and associated PR #24994) that you linked just removes the redundant initialization of the streamMode property. I do not see it as a breaking change since the behavior in CloudFormation is unchanged and documentation correctly reflects this behavior.

Thanks,
Ashish

@ashishdhingra ashishdhingra added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Sep 3, 2024
@pahud
Copy link
Contributor

pahud commented Sep 4, 2024

I believe this was previously a bug that got fixed in #24994

In that bug, when props.streamMode is undefined, it was previously explicit set as Provisioned under StreamModeDetails, which was not required.

The fix made it implicitly set as Provisioned by CFN with StreamModeDetails undefined. The behavior should be the same but if you npx cdk synth you should see this:

   Type: AWS::Kinesis::Stream
    Properties:
      Name: myStreamName
      RetentionPeriodHours: 24
      ShardCount: 1
      StreamEncryption:
        Fn::If:
          - AwsCdkKinesisEncryptedStreamsUnsupportedRegions
          - Ref: AWS::NoValue
          - EncryptionType: KMS
            KeyId: alias/aws/kinesis

The StreamModeDetails would be undefined as fixed in #24994 but the streamMode should be implicitly Provisioned.

Given StreamModeDetails is having Update requires: No interruption as described in the CFN doc. This should not cause any resource replacement.

@ashishdhingra
Copy link
Contributor

@Exter-dg Please review guidance above and confirm if we are good to close the issue.

Thanks,
Ashish

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Sep 4, 2024
@Exter-dg
Copy link
Author

Exter-dg commented Sep 4, 2024

Thanks @ashishdhingra @pahud, This makes things clearer for me. Closing this issue.

@Exter-dg Exter-dg closed this as completed Sep 4, 2024
Copy link

github-actions bot commented Sep 4, 2024

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
@aws-cdk/aws-kinesis Related to Amazon Kinesis bug This issue is a bug. p3 potential-regression Marking this issue as a potential regression to be checked by team member
Projects
None yet
Development

No branches or pull requests

3 participants