snippets_py
Integration
New integration from credential
aws_sqs_client = yepcode.integration.aws_sqs("credential-slug")
New integration from plain authentication data
import boto3
session = boto3.Session(
aws_access_key_id="accessKeyId",
aws_secret_access_key="secretAccessKey",
region_name="region"
)
aws_sqs_client = session.client("sqs")
List Queues
List queues
response = aws_sqs_client.list_queues()
for queue_url in response.get('QueueUrls', []):
print(queue_url)
Send Message
Send message
aws_sqs_client.send_message(
QueueUrl="the-queue-url",
MessageBody="the-message-body"
)
Receive Messages
Receive messages
aws_sqs_client.receive_message(
QueueUrl="the-queue-url",
MaxNumberOfMessages=10
)
for message in response.get('Messages', []):
print(message)