@@ -2,7 +2,6 @@ package kinesis
2
2
3
3
import (
4
4
"log"
5
- "os"
6
5
"time"
7
6
8
7
"github.com/aws/aws-sdk-go/aws"
@@ -115,17 +114,11 @@ func (k *KinesisOutput) Description() string {
115
114
return "Configuration for the AWS Kinesis output."
116
115
}
117
116
118
- func checkstream (l []* string , s string ) bool {
119
- // Check if the StreamName exists in the slice returned from the ListStreams API request.
120
- for _ , stream := range l {
121
- if * stream == s {
122
- return true
123
- }
117
+ func (k * KinesisOutput ) Connect () error {
118
+ if k .Partition == nil {
119
+ log .Print ("E! kinesis : Deprecated paritionkey configuration in use, please consider using outputs.kinesis.partition" )
124
120
}
125
- return false
126
- }
127
121
128
- func (k * KinesisOutput ) Connect () error {
129
122
// We attempt first to create a session to Kinesis using an IAMS role, if that fails it will fall through to using
130
123
// environment variables, and then Shared Credentials.
131
124
if k .Debug {
@@ -145,29 +138,10 @@ func (k *KinesisOutput) Connect() error {
145
138
configProvider := credentialConfig .Credentials ()
146
139
svc := kinesis .New (configProvider )
147
140
148
- KinesisParams := & kinesis.ListStreamsInput {
149
- Limit : aws .Int64 (100 ),
150
- }
151
-
152
- resp , err := svc .ListStreams (KinesisParams )
153
-
154
- if err != nil {
155
- log .Printf ("E! kinesis: Error in ListSteams API call : %+v \n " , err )
156
- }
157
-
158
- if checkstream (resp .StreamNames , k .StreamName ) {
159
- if k .Debug {
160
- log .Printf ("E! kinesis: Stream Exists" )
161
- }
162
- k .svc = svc
163
- return nil
164
- } else {
165
- log .Printf ("E! kinesis : You have configured a StreamName %+v which does not exist. exiting." , k .StreamName )
166
- os .Exit (1 )
167
- }
168
- if k .Partition == nil {
169
- log .Print ("E! kinesis : Deprecated paritionkey configuration in use, please consider using outputs.kinesis.partition" )
170
- }
141
+ _ , err := svc .DescribeStreamSummary (& kinesis.DescribeStreamSummaryInput {
142
+ StreamName : aws .String (k .StreamName ),
143
+ })
144
+ k .svc = svc
171
145
return err
172
146
}
173
147
0 commit comments