Cleaned up example / debug service + made it clear that credentials aren't real
@@ -24,10 +24,10 @@ class ExampleAWSSNSSQSService(tomodachi.Service):
# Some options can be specified to define credentials, used ports, hostnames, access log, etc.
options = {
"aws_sns_sqs.region_name": "eu-west-1", # specify AWS region (example: 'eu-west-1')
- "aws_sns_sqs.aws_access_key_id": "AKIAXNTIENCJIY2STOCI", # specify AWS access key (example: 'AKIAXNTIENCJIY2STOCI')
- "aws_sns_sqs.aws_secret_access_key": "f7sha92hNotarealsecretkeyn29ShnSYQi3nzgA", # specify AWS secret key (example: 'f7sha92hNotarealsecretkeyn29ShnSYQi3nzgA')
- "aws_endpoint_urls.sns": "http://localhost:4567", # For example 'http://localhost:4575' if localstack is used for testing
- "aws_endpoint_urls.sqs": "http://localhost:4567", # For example 'http://localhost:4576' if localstack is used for testing
+ "aws_sns_sqs.aws_access_key_id": "", # specify AWS access key (example: 'AKIAXNTIENCJIY2STOCI') - this is not real credentials
+ "aws_sns_sqs.aws_secret_access_key": "", # specify AWS secret key (example: 'f7sha92hNotarealsecretkeyn29ShnSYQi3nzgA') - this is not real credentials
+ "aws_endpoint_urls.sns": "", # For example 'http://localhost:4566' (or 4567, port may vary) if localstack is used for testing
+ "aws_endpoint_urls.sqs": "", # For example 'http://localhost:4566' (or 4567, port may vary) if localstack is used for testing
}
@aws_sns_sqs("example-route1", queue_name="queue-1")
@@ -42,10 +42,6 @@ class ExampleAWSSNSSQSService(tomodachi.Service):
async def route2(self, data: Any) -> None:
self.log('Received data (function: route2) - "{}"'.format(data))
- @aws_sns_sqs("example-route4", queue_name="queue-4")
- async def dlq(self, data: Any) -> None:
- self.log('Received data (function: dlq) - "{}"'.format(data))
-
async def _started_service(self) -> None:
async def publish(data: Any, topic: str) -> None:
self.log('Publish data "{}"'.format(data))
