Hello how are you
- User
Hello how are you
- Assistant
As an AI language model, I don't have emotions like humans, but I'm fully operational and ready to assist you. How can I help you today?
- User
Please generate a cloudformation template which creates a SQS queue and a SNS topic. The queue shall subscribe to the topic. The topic shall have the necessary permissions to write to the queue.
- Assistant
Sure, here's the CloudFormation JSON template that creates an Amazon SQS queue and an Amazon SNS topic, with the queue subscribing to the topic.
{ "Resources":{ "SqsQueue":{ "Type":"AWS::SQS::Queue", "Properties":{ "QueueName":"MySqsQueue", "VisibilityTimeout":"60", "DelaySeconds":"0", "MaximumMessageSize":"262144", "MessageRetentionPeriod":"345600", "ReceiveMessageWaitTimeSeconds":"20" } }, "SnsTopic":{ "Type":"AWS::SNS::Topic", "Properties":{ "TopicName":"MySnsTopic" } }, "SnsSubscription":{ "Type":"AWS::SNS::Subscription", "Properties":{ "TopicArn":{ "Ref":"SnsTopic" }, "Protocol":"sqs", "Endpoint":{ "Fn::GetAtt":[ "SqsQueue", "Arn" ] } } }, "SqsQueuePolicy":{ "Type":"AWS::SQS::QueuePolicy", "Properties":{ "Queues":[ { "Ref":"SqsQueue" } ], "PolicyDocument":{ "Version":"2012-10-17", "Statement":[ { "Effect":"Allow", "Principal":"*", "Action":"sqs:SendMessage", "Resource":{ "Fn::GetAtt":[ "SqsQueue", "Arn" ] }, "Condition":{ "ArnEquals":{ "aws:SourceArn":{ "Ref":"SnsTopic" } } } } ] } } } } }
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.