Iam cloudformation update, singificant cloudformation refactoring (#3218)
* IAM User Cloudformation Enhancements: update, delete, getatt. * AWS::IAM::Policy Support * Added unit tests for AWS:IAM:Policy for roles and groups. Fixed bug related to groups. * AWS:IAM:AccessKey CloudFormation support. * Refactor of CloudFormation parsing.py methods to simplify and standardize how they call to the models. Adjusted some models accordingly. * Further model CloudFormation support changes to align with revised CloudFormation logic. Mostly avoidance of getting resoure name from properties. * Support for Kinesis Stream RetentionPeriodHours param. * Kinesis Stream Cloudformation Tag Support. * Added omitted 'region' param to boto3.client() calls in new tests. Co-authored-by: Joseph Weitekamp <jweite@amazon.com>
This commit is contained in:
parent
3b06ce689e
commit
49d92861c0
25 changed files with 1912 additions and 318 deletions
|
|
@ -73,6 +73,12 @@ Resources:
|
|||
Properties:
|
||||
Name: MyStream
|
||||
ShardCount: 4
|
||||
RetentionPeriodHours: 48
|
||||
Tags:
|
||||
- Key: TagKey1
|
||||
Value: TagValue1
|
||||
- Key: TagKey2
|
||||
Value: TagValue2
|
||||
""".strip()
|
||||
|
||||
cf_conn.create_stack(StackName=stack_name, TemplateBody=template)
|
||||
|
|
@ -83,6 +89,14 @@ Resources:
|
|||
stream_description = kinesis_conn.describe_stream(StreamName="MyStream")[
|
||||
"StreamDescription"
|
||||
]
|
||||
stream_description["RetentionPeriodHours"].should.equal(48)
|
||||
|
||||
tags = kinesis_conn.list_tags_for_stream(StreamName="MyStream")["Tags"]
|
||||
tag1_value = [tag for tag in tags if tag["Key"] == "TagKey1"][0]["Value"]
|
||||
tag2_value = [tag for tag in tags if tag["Key"] == "TagKey2"][0]["Value"]
|
||||
tag1_value.should.equal("TagValue1")
|
||||
tag2_value.should.equal("TagValue2")
|
||||
|
||||
shards_provisioned = len(
|
||||
[
|
||||
shard
|
||||
|
|
@ -98,12 +112,27 @@ Resources:
|
|||
Type: AWS::Kinesis::Stream
|
||||
Properties:
|
||||
ShardCount: 6
|
||||
RetentionPeriodHours: 24
|
||||
Tags:
|
||||
- Key: TagKey1
|
||||
Value: TagValue1a
|
||||
- Key: TagKey2
|
||||
Value: TagValue2a
|
||||
|
||||
""".strip()
|
||||
cf_conn.update_stack(StackName=stack_name, TemplateBody=template)
|
||||
|
||||
stream_description = kinesis_conn.describe_stream(StreamName="MyStream")[
|
||||
"StreamDescription"
|
||||
]
|
||||
stream_description["RetentionPeriodHours"].should.equal(24)
|
||||
|
||||
tags = kinesis_conn.list_tags_for_stream(StreamName="MyStream")["Tags"]
|
||||
tag1_value = [tag for tag in tags if tag["Key"] == "TagKey1"][0]["Value"]
|
||||
tag2_value = [tag for tag in tags if tag["Key"] == "TagKey2"][0]["Value"]
|
||||
tag1_value.should.equal("TagValue1a")
|
||||
tag2_value.should.equal("TagValue2a")
|
||||
|
||||
shards_provisioned = len(
|
||||
[
|
||||
shard
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue