mirror of
https://github.com/hastagAB/Awesome-Python-Scripts.git
synced 2024-11-27 22:11:07 +00:00
Add files via upload
This commit is contained in:
parent
fe26fd64ba
commit
7e99fa2ca8
28
aws-sns-text/README.md
Normal file
28
aws-sns-text/README.md
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
Hello! Thank you for using aws-sns-text.py!
|
||||||
|
This script should be used to send a text message using the AWS SNS service.
|
||||||
|
|
||||||
|
BEFORE USING
|
||||||
|
1. In AWS IAM, create a user that has "AmazonSNSFullAcces" privileges
|
||||||
|
2. Be sure your environment satisfies the reqirements listed in the requirements.txt file
|
||||||
|
|
||||||
|
USAGE INSTRUCTIONS
|
||||||
|
1. Navigate to your folder containing aws-sns-text.py
|
||||||
|
2. type "python aws-sns-text.py" to launch the program
|
||||||
|
3. Enter the key ID obtained through the AWS IAM service
|
||||||
|
4. Enter the key secret obtained through the AWS IAM service
|
||||||
|
5. Enter the AWS region where your IAM credentials were created
|
||||||
|
6. Enter the phone number you wish to send the text
|
||||||
|
7. Enter the message you wish to send
|
||||||
|
|
||||||
|
Your console output should resemble the following:
|
||||||
|
Enter AWS key ID: SD78GHMW56BFRWQ3
|
||||||
|
Enter AWS key secret: skjef789sdfJOSD9893^&ww90$nweq
|
||||||
|
Enter AWS region: us-east-1
|
||||||
|
Enter phone number: +16248973287
|
||||||
|
Enter message: hello world!
|
||||||
|
|
||||||
|
If all fields are entered correctly, the message will send successfully!
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
25
aws-sns-text/aws-sns-text.py
Normal file
25
aws-sns-text/aws-sns-text.py
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
#Send a text using AWS sns
|
||||||
|
import boto3
|
||||||
|
|
||||||
|
#Retrieve information from the user
|
||||||
|
key_ID = raw_input("Enter AWS key ID: ")
|
||||||
|
key_secret = raw_input("Enter AWS key secret: ")
|
||||||
|
region = raw_input("Enter AWS region: ")
|
||||||
|
phone = raw_input("Enter phone number: ")
|
||||||
|
message = raw_input("Enter message: ")
|
||||||
|
|
||||||
|
#create the client
|
||||||
|
client = boto3.client(
|
||||||
|
"sns",
|
||||||
|
aws_access_key_id=key_ID,
|
||||||
|
aws_secret_access_key=key_secret,
|
||||||
|
region_name=region
|
||||||
|
)
|
||||||
|
|
||||||
|
# Send your sms message.
|
||||||
|
client.publish(
|
||||||
|
PhoneNumber=phone,
|
||||||
|
Message=message
|
||||||
|
)
|
||||||
|
|
||||||
|
|
9
aws-sns-text/requirements.txt
Normal file
9
aws-sns-text/requirements.txt
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
boto3==1.10.48
|
||||||
|
botocore==1.13.48
|
||||||
|
docutils==0.15.2
|
||||||
|
futures==3.3.0
|
||||||
|
jmespath==0.9.4
|
||||||
|
python-dateutil==2.8.1
|
||||||
|
s3transfer==0.2.1
|
||||||
|
six==1.13.0
|
||||||
|
urllib3==1.25.7
|
Loading…
Reference in New Issue
Block a user