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

r/aws_kinesis_stream: Test with shard_count > 100 #22090

Merged
merged 1 commit into from
Dec 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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