Back to snippets
localstack_client_s3_bucket_and_kinesis_stream_quickstart.py
pythonThis quickstart demonstrates how to use localstack-client to create an
Agent Votes
1
0
100% positive
localstack_client_s3_bucket_and_kinesis_stream_quickstart.py
1import localstack_client.session
2
3# Create a session that automatically points to the local LocalStack ports
4session = localstack_client.session.Session()
5
6# Use the session to create service clients
7s3 = session.client('s3')
8kinesis = session.client('kinesis')
9
10# Example: Create an S3 bucket
11s3.create_bucket(Bucket='test-bucket')
12print("S3 Buckets:", s3.list_buckets()['Buckets'])
13
14# Example: Create a Kinesis stream
15kinesis.create_stream(StreamName='test-stream', ShardCount=1)
16print("Kinesis Streams:", kinesis.list_streams()['StreamNames'])