You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reference implementation of scenario and actions in C++: #4767
Service actions
Service actions can either be pulled out as individual functions or can be incorporated into the scenario, but each service action must be included as an excerpt in the SOS output.
SNS Actions
CreateTopic
Subscribe
Publish
Unsubscribe
DeleteTopic
SQS Actions
CreateQueue
GetQueueAttributes
SetQueueAttributes
ReceiveMessage
DeleteMessageBatch
DeleteQueue
Hello Service
The Hello Service example should demonstrate how to set up the client and make an example call using the SDK.
General info for Hello Service example snippets:
This section of the MVP should be a streamlined, simple example with enough detail to be as close to “copy/paste” runnable as possible. This example may include namespaces and other setup in order to focus on getting the user up and running with the new service.
Sample output:
Hello Amazon SNS! You have 1 topic in your account.
Here are your topics ARNs.
* arn:aws:sns:us-east-1:123456789012:good_news.fifo
Hello SNS
Initialize the client and call ListTopics to list the event topics. List topics is a paginated response.
Hello SQS
Initialize the client and call ListQueues to list the SQS queues. List queues is a paginated response.
Scenario
README
This is a workflow scenario. As such, the READMEs should be standardized.
This is the C++ reference README
Implementation
A scenario runs at a command prompt and prints output to the user on the result of each service action. Because of the choices in this workflow scenario, it must be run interactively.
Publish and subscribe with topics and queues.
There are 3 options for topic configuration. Allow the user to select from these 3 options.
Non-FIFO topic.
FIFO topic with content-based deduplication.
FIFO topic without deduplication
Create a topic. (CreateTopic)
Append “.fifo” to the name, if FIFO topics were selected.
If it is a FIFO topic, set the ""FifoTopic" attribute to "true".
if the content-based deduplication was selected set the "ContentBasedDeduplication" attribute to "true".
Create an SQS queue. (CreateQueue)
Append “.fifo” to the name, if FIFO topics were selected.
If FIFO was selected, set the "FifoQueue" to true.
Get the SQS queue ARN attribute using GetQueueAttributes.
Attach an IAM policy to the queue using SetQueueAttributes.
Subscribe the SQS queue to the SNS topic using SNS Subscribe
Set the topic ARN in the request.
Set the protocol to “sqs”.
Set the queue ARN to the ARN of the queue just created.
If this is a FIFO topic, give the option to apply a filter.
In the C++ reference application, the filter is an attribute filter. Set with the “FilterPolicy” attribute.
Here is an example filter JSON.
{ "tone": ["cheerful","serious"] }
Repeat steps 3 - 6 for the second queue.
Publish a message to the topic. (Publish)
Ask the user for a message body.
If this is a FIFO topic, set the message Group ID (user input optional, but giving a user the choice allows them to explore behavior, although I think it is hard to show an effect it this case).
If this is a FIFO topic and content-based deduplication is not enabled, a deduplication ID must be entered, (giving the user the choice does allow them to see the impact of shared deduplication IDs).
If this is a FIFO topic and any of the subscriptions are filtered, ask the user if they would like to add an attribute for filtering.
Repeat publish a message (step 11) until the user says no.
Display the messages in both queues using SQS ReceiveMessage.
The message output should include at least the body and the attributes. For C++, the attributes were included in the body method.
Delete the received message using SQS DeleteMessageBatch
Delete the unsubscribe and delete the queues. (Unsubscribe) (DeleteQueue)
shepazon
added
Swift
This issue relates to the AWS SDK for Swift
Task
A general update to the code base for language clarification, missing actions, tests, etc.
labels
Feb 4, 2025
SNS documentation references:
SQS documentation references:
Reference implementation of scenario and actions in C++: #4767
Service actions
Service actions can either be pulled out as individual functions or can be incorporated into the scenario, but each service action must be included as an excerpt in the SOS output.
SNS Actions
SQS Actions
Hello Service
The Hello Service example should demonstrate how to set up the client and make an example call using the SDK.
General info for Hello Service example snippets:
This section of the MVP should be a streamlined, simple example with enough detail to be as close to “copy/paste” runnable as possible. This example may include namespaces and other setup in order to focus on getting the user up and running with the new service.
Sample output:
Hello SNS
Initialize the client and call ListTopics to list the event topics. List topics is a paginated response.
Hello SQS
Initialize the client and call ListQueues to list the SQS queues. List queues is a paginated response.
Scenario
README
This is a workflow scenario. As such, the READMEs should be standardized.
This is the C++ reference README
Implementation
A scenario runs at a command prompt and prints output to the user on the result of each service action. Because of the choices in this workflow scenario, it must be run interactively.
Publish and subscribe with topics and queues.
There are 3 options for topic configuration. Allow the user to select from these 3 options.
Create a topic. (CreateTopic)
Create an SQS queue. (CreateQueue)
Get the SQS queue ARN attribute using GetQueueAttributes.
Attach an IAM policy to the queue using SetQueueAttributes.
{
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "sns.amazonaws.com"
},
"Action": "sqs:SendMessage",
"Resource": "arn:aws:sqs:us-east-1:111111111:",
"Condition": {
"ArnEquals": {
"aws:SourceArn": "arn:aws:sns:us-east-1:111111111:"
}
}
}
]
}
Subscribe the SQS queue to the SNS topic using SNS Subscribe
In the C++ reference application, the filter is an attribute filter. Set with the “FilterPolicy” attribute.
Here is an example filter JSON.
Repeat steps 3 - 6 for the second queue.
Publish a message to the topic. (Publish)
Repeat publish a message (step 11) until the user says no.
Display the messages in both queues using SQS ReceiveMessage.
Delete the received message using SQS DeleteMessageBatch
Delete the unsubscribe and delete the queues. (Unsubscribe) (DeleteQueue)
Delete the topic. (DeleteTopic)
See the attached sample output from the C++ MVP.
Metadata
In sns_metadata.yaml:
sns_Hello
sns_CreateTopic
sns_Subscribe_Queue
sns_Subscribe_Filtered
sns_Publish
sns_Publish_WithAttribute
sns_Unsubscribe
sns_DeleteTopic
In sqs_metadata.yaml:
sqs_Hello
sqs_CreateQueue
sqs_GetQueueAttributes
sqs_SetQueueAttributes
sqs_ReceiveMessage
sqs_DeleteMessageBatch
sqs_DeleteQueue
The text was updated successfully, but these errors were encountered: