Skip to content

Commit

Permalink
Merge pull request #22090 from hashicorp/t-aws_kinesis_stream-large-s…
Browse files Browse the repository at this point in the history
…hard_count

r/aws_kinesis_stream: Test with `shard_count` > 100
  • Loading branch information
ewbankkit authored Dec 7, 2021
2 parents 5fc93b3 + 960358e commit 8ea0288
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion internal/service/kinesis/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,8 @@ func FindStreamByName(conn *kinesis.Kinesis, name string) (*kinesis.StreamDescri
}

if output == nil {
output = page.StreamDescription
output = &kinesis.StreamDescription{}
*output = *page.StreamDescription
} else {
output.Shards = append(output.Shards, page.StreamDescription.Shards...)
}
Expand Down
14 changes: 7 additions & 7 deletions internal/service/kinesis/stream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,10 @@ func TestAccKinesisStream_shardCount(t *testing.T) {
CheckDestroy: testAccCheckKinesisStreamDestroy,
Steps: []resource.TestStep{
{
Config: testAccKinesisStreamConfig(rName),
Config: testAccKinesisStreamConfigShardCount(rName, 128),
Check: resource.ComposeTestCheckFunc(
testAccCheckKinesisStreamExists(resourceName, &stream),
resource.TestCheckResourceAttr(resourceName, "shard_count", "2"),
resource.TestCheckResourceAttr(resourceName, "shard_count", "128"),
),
},
{
Expand All @@ -222,11 +222,11 @@ func TestAccKinesisStream_shardCount(t *testing.T) {
ImportStateVerifyIgnore: []string{"enforce_consumer_deletion"},
},
{
Config: testAccKinesisStreamConfigUpdateShardCount(rName),
Config: testAccKinesisStreamConfigShardCount(rName, 96),
Check: resource.ComposeTestCheckFunc(
testAccCheckKinesisStreamExists(resourceName, &updatedStream),
testCheckStreamNotDestroyed(),
resource.TestCheckResourceAttr(resourceName, "shard_count", "4"),
resource.TestCheckResourceAttr(resourceName, "shard_count", "96"),
),
},
},
Expand Down Expand Up @@ -710,13 +710,13 @@ POLICY
`, rName)
}

func testAccKinesisStreamConfigUpdateShardCount(rName string) string {
func testAccKinesisStreamConfigShardCount(rName string, shardCount int) string {
return fmt.Sprintf(`
resource "aws_kinesis_stream" "test" {
name = %[1]q
shard_count = 4
shard_count = %[2]d
}
`, rName)
`, rName, shardCount)
}

func testAccKinesisStreamConfigUpdateRetentionPeriod(rName string) string {
Expand Down

0 comments on commit 8ea0288

Please sign in to comment.