Skip to content

Instantly share code, notes, and snippets.

@weizhou2273
Created August 9, 2017 03:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weizhou2273/d8acf0be04c3f00147ece11ebab4079b to your computer and use it in GitHub Desktop.
Save weizhou2273/d8acf0be04c3f00147ece11ebab4079b to your computer and use it in GitHub Desktop.
import boto3
from moto import mock_kinesis
import credentials
import sys
from botocore.exceptions import ClientError
aws_key_id = credentials.aws['key_id']
aws_key = credentials.aws['key']
def delete_stream(client, stream_name):
try:
return client.delete_delivery_stream(DeliveryStreamName=stream_name)
print 'Successfully delete kinesis stream: {}'.format(stream_name)
except:
print 'Kinesis {} does not exist'.format(stream_name)
def main(stream_name):
client = boto3.client('firehose', region_name='us-east-1',
aws_access_key_id = aws_key_id,
aws_secret_access_key= aws_key
) # the region may not be needed
delete_stream(client,stream_name)
if __name__ == '__main__':
main(sys.argv[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment