provider/aws: Adding a test for AWS Kinesis Stream Shard Count
This commit is contained in:
parent
d86caf436b
commit
d63166c025
|
@ -35,6 +35,41 @@ func TestAccAWSKinesisStream_basic(t *testing.T) {
|
|||
})
|
||||
}
|
||||
|
||||
func TestAccAWSKinesisStream_shardCount(t *testing.T) {
|
||||
var stream kinesis.StreamDescription
|
||||
|
||||
ri := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
|
||||
config := fmt.Sprintf(testAccKinesisStreamConfig, ri)
|
||||
updateConfig := fmt.Sprintf(testAccKinesisStreamConfigUpdateShardCount, ri)
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Providers: testAccProviders,
|
||||
CheckDestroy: testAccCheckKinesisStreamDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
resource.TestStep{
|
||||
Config: config,
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckKinesisStreamExists("aws_kinesis_stream.test_stream", &stream),
|
||||
testAccCheckAWSKinesisStreamAttributes(&stream),
|
||||
resource.TestCheckResourceAttr(
|
||||
"aws_kinesis_stream.test_stream", "shard_count", "2"),
|
||||
),
|
||||
},
|
||||
|
||||
resource.TestStep{
|
||||
Config: updateConfig,
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckKinesisStreamExists("aws_kinesis_stream.test_stream", &stream),
|
||||
testAccCheckAWSKinesisStreamAttributes(&stream),
|
||||
resource.TestCheckResourceAttr(
|
||||
"aws_kinesis_stream.test_stream", "shard_count", "4"),
|
||||
),
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
func TestAccAWSKinesisStream_retentionPeriod(t *testing.T) {
|
||||
var stream kinesis.StreamDescription
|
||||
|
||||
|
@ -161,6 +196,16 @@ resource "aws_kinesis_stream" "test_stream" {
|
|||
}
|
||||
`
|
||||
|
||||
var testAccKinesisStreamConfigUpdateShardCount = `
|
||||
resource "aws_kinesis_stream" "test_stream" {
|
||||
name = "terraform-kinesis-test-%d"
|
||||
shard_count = 4
|
||||
tags {
|
||||
Name = "tf-test"
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
var testAccKinesisStreamConfigUpdateRetentionPeriod = `
|
||||
resource "aws_kinesis_stream" "test_stream" {
|
||||
name = "terraform-kinesis-test-%d"
|
||||
|
|
Loading…
Reference in New Issue