RammusXu / rammusxu.github.io

My profile
https://rammusxu.github.io/
2 stars 0 forks source link

SQS python #17

Closed RammusXu closed 7 years ago

RammusXu commented 8 years ago
# Get the service resource
sqs = boto3.resource('sqs')

# Create the queue. This returns an SQS.Queue instance
queue = sqs.create_queue(QueueName='test', Attributes={'DelaySeconds': '5'})

# You can now access identifiers and attributes
print(queue.url)
print(queue.attributes.get('DelaySeconds'))

Reference

RammusXu commented 8 years ago

http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html

~/.aws/credentials

[default]
aws_access_key_id=YOUR_ACCESS_KEY_ID
aws_secret_access_key=YOUR_SECRET_ACCESS_KEY

~/.aws/config

[default]
region=us-west-2
RammusXu commented 8 years ago

可以試試看設定可見時間 delete from queue

RammusXu commented 8 years ago

tutorial http://mattharris.org/2015/12/aws-sqs-boto3-basics/