Skip to content

Instantly share code, notes, and snippets.

@vikasbajaj
Created May 24, 2021 11:08
Show Gist options
  • Save vikasbajaj/99a8de0a094431ff8317c02ad5fe5516 to your computer and use it in GitHub Desktop.
Save vikasbajaj/99a8de0a094431ff8317c02ad5fe5516 to your computer and use it in GitHub Desktop.
#!/usr/bin/python3
import requests
import datetime
import time
import threading
import random
# replace URL string with Invoke URL (APIGW V2 --> Invoke URL)
url = "https://xxxxxxxxxxxxxxxxxxxxxxxxx.amazonaws.com/beta"
for i in range(10000):
# generating a random partition key for Kinesis Data Stream.
partition_key = "partition-{0}".format(random.randint(1, 1000))
# building payload with "data" and "id" (partition key)
myobj = {"data": "message from pixel", "id": partition_key}
#time.sleep(1)
x = requests.post(url, json = myobj)
print(x.text)
@vikasbajaj
Copy link
Author

Test client to send data to APIGW which further sends data to KDS ===> KDF ====> S3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment