FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
examples/python-lambda/src/notify.py at main · baselime/examples · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
baselime
/
examples
Public
Notifications
You must be signed in to change notification settings
Fork
4
Star
5
Code
Issues
0
Pull requests
1
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
examples
/
python-lambda
/
src
/
notify.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
48 lines (41 loc) · 984 Bytes
Breadcrumbs
examples
/
python-lambda
/
src
/
notify.py
Copy path
File metadata and controls
48 lines (41 loc) · 984 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import
boto3
import
json
import
os
kinesis
=
boto3
.
client
(
'kinesis'
)
s3
=
boto3
.
client
(
's3'
)
queue
=
boto3
.
client
(
'sqs'
)
events
=
boto3
.
client
(
'events'
)
BUS
=
os
.
environ
.
get
(
"EVENTS"
)
BUCKET
=
os
.
environ
.
get
(
"BUCKET"
)
QUEUE
=
os
.
environ
.
get
(
"QUEUE"
)
STREAM
=
os
.
environ
.
get
(
"STREAM"
)
def
handler
(
event
,
context
):
print
(
event
)
events
.
put_events
(
Entries
=
[
{
'Source'
:
'your_source'
,
'DetailType'
:
'your_detail_typeing'
,
'Detail'
:
json
.
dumps
(
event
),
'EventBusName'
:
BUS
,
},
]
)
s3
.
put_object
(
Bucket
=
BUCKET
,
Key
=
'your_key'
,
Body
=
json
.
dumps
(
event
),
)
s3
.
get_object
(
Bucket
=
BUCKET
,
Key
=
'your_key'
,
)
queue
.
send_message
(
QueueUrl
=
QUEUE
,
MessageBody
=
json
.
dumps
(
event
),
)
kinesis
.
put_record
(
StreamName
=
STREAM
,
Data
=
json
.
dumps
(
event
),
PartitionKey
=
'your_partition_key'
,
)
Back
|
FazBrowse Home
|
New Git URL