Skip to content

Commit

Permalink
Update Kinesis per 2021-12-09 (#1988)
Browse files Browse the repository at this point in the history
Co-authored-by: Scott Speice <scott.speice@experian.com>
  • Loading branch information
glitchindustries and Scott Speice authored Dec 17, 2021
1 parent cb7fb6b commit 462d710
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
12 changes: 11 additions & 1 deletion troposphere/kinesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
# See LICENSE file for full license.

from . import AWSObject, AWSProperty, Tags
from .validators import integer
from .validators import (
integer,
kinesis_stream_mode
)


class StreamEncryption(AWSProperty):
Expand All @@ -14,6 +17,12 @@ class StreamEncryption(AWSProperty):
}


class StreamModeDetails(AWSProperty):
props = {
"StreamMode": (kinesis_stream_mode, True)
}


class Stream(AWSObject):
resource_type = "AWS::Kinesis::Stream"

Expand All @@ -22,6 +31,7 @@ class Stream(AWSObject):
"RetentionPeriodHours": (integer, False),
"ShardCount": (integer, True),
"StreamEncryption": (StreamEncryption, False),
"StreamModeDetails": (StreamModeDetails, False),
"Tags": ((Tags, list), False),
}

Expand Down
7 changes: 7 additions & 0 deletions troposphere/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,3 +708,10 @@ def wafv2_custom_body_response_content_type(content_type):
if content_type not in valid_types:
raise ValueError('ContentType must be one of: "%s"' % (", ".join(valid_types)))
return content_type


def kinesis_stream_mode(mode):
valid_modes = ["ON_DEMAND", "PROVISIONED"]
if mode not in valid_modes:
raise ValueError('ContentType must be one of: "%s"' % (", ".join(valid_modes)))
return mode

0 comments on commit 462d710

Please sign in to comment.