Open erlandsen-tech opened 3 weeks ago
import boto3
import sns_extended_client <--- This is imported here but never used
# Low level client
sns = boto3.client('sns')
sns.large_payload_support = 'bucket-name'
# boto SNS.Topic resource
resource = boto3.resource('sns')
topic = resource.Topic('topic-arn')
# rest of code omitted
The same goes for all the examples except the last one.
So just to provide a snippet that actually works; add this to your lambda handler:
import sns_extended_client
sns_extended_client_resource = sns_extended_client.SNSExtendedClientSession().resource(
service_name="sns", region_name="eu-west-1"
)
topic = sns_extended_client_resource.Topic(TOPIC_ARN)
topic.large_payload_support = S3_EXTENDED_PAYLOAD_BUCKET
#... something something create json data or whatever ...
topic.publish(TopicArn=TOPIC_ARN, Message=json_data)
The library is imported, but then just shadowed further down in the code and will never be used.