Which aws service can be used to send automated notifications to http endpoints?

After you create an Amazon SNS topic and subscribe an endpoint to it, you can publish messages to the topic. When a message is published, Amazon SNS attempts to deliver the message to the subscribed endpoints.

To publish messages to Amazon SNS topics using the AWS Management Console

  1. Sign in to the Amazon SNS console.

  2. In the left navigation pane, choose Topics.

  3. On the Topics page, select a topic, and then choose Publish message.

    The console opens the Publish message to topic page.

  4. In the Message details section, do the following:

    1. (Optional) Enter a message Subject.

    2. For a FIFO topic, enter a Message group ID. Messages in the same message group are delivered in the order that they are published.

    3. For a FIFO topic, enter a Message deduplication ID. This ID is optional if you enabled the Content-based message deduplication setting for the topic.

    4. (Optional) For mobile push notifications, enter a Time to Live (TTL) value in seconds. This is the amount of time that a push notification service—such as Apple Push Notification Service (APNs) or Firebase Cloud Messaging (FCM)—has to deliver the message to the endpoint.

  5. In the Message body section, do one of the following:

    1. Choose Identical payload for all delivery protocols, and then enter a message.

    2. Choose Custom payload for each delivery protocol, and then enter a JSON object to define the message to send for each delivery protocol.

      For more information, see Publishing with platform-specific payload.

  6. In the Message attributes section, add any attributes that you want Amazon SNS to match with the subscription attribute

        public static void pubTopic(SnsClient snsClient, String message, String topicArn) {
    
            try {
                PublishRequest request = PublishRequest.builder()
                    .message(message)
                    .topicArn(topicArn)
                    .build();
    
                PublishResponse result = snsClient.publish(request);
                System.out.println(result.messageId() + " Message sent. Status is " + result.sdkHttpResponse().statusCode());
    
             } catch (SnsException e) {
                System.err.println(e.awsErrorDetails().errorMessage());
                System.exit(1);
             }
        }
    
    
    1 to decide whether the subscribed endpoint is interested in the published message.

    1. For Type, choose an attribute type, such as String.Array.

      For attribute type String.Array, enclose the array in square brackets (

          public static void pubTopic(SnsClient snsClient, String message, String topicArn) {
      
              try {
                  PublishRequest request = PublishRequest.builder()
                      .message(message)
                      .topicArn(topicArn)
                      .build();
      
                  PublishResponse result = snsClient.publish(request);
                  System.out.println(result.messageId() + " Message sent. Status is " + result.sdkHttpResponse().statusCode());
      
               } catch (SnsException e) {
                  System.err.println(e.awsErrorDetails().errorMessage());
                  System.exit(1);
               }
          }
      
      
      2). Within the array, enclose string values in double quotation marks. You don't need quotation marks for numbers or for the keywords
          public static void pubTopic(SnsClient snsClient, String message, String topicArn) {
      
              try {
                  PublishRequest request = PublishRequest.builder()
                      .message(message)
                      .topicArn(topicArn)
                      .build();
      
                  PublishResponse result = snsClient.publish(request);
                  System.out.println(result.messageId() + " Message sent. Status is " + result.sdkHttpResponse().statusCode());
      
               } catch (SnsException e) {
                  System.err.println(e.awsErrorDetails().errorMessage());
                  System.exit(1);
               }
          }
      
      
      3,
          public static void pubTopic(SnsClient snsClient, String message, String topicArn) {
      
              try {
                  PublishRequest request = PublishRequest.builder()
                      .message(message)
                      .topicArn(topicArn)
                      .build();
      
                  PublishResponse result = snsClient.publish(request);
                  System.out.println(result.messageId() + " Message sent. Status is " + result.sdkHttpResponse().statusCode());
      
               } catch (SnsException e) {
                  System.err.println(e.awsErrorDetails().errorMessage());
                  System.exit(1);
               }
          }
      
      
      4, and
          public static void pubTopic(SnsClient snsClient, String message, String topicArn) {
      
              try {
                  PublishRequest request = PublishRequest.builder()
                      .message(message)
                      .topicArn(topicArn)
                      .build();
      
                  PublishResponse result = snsClient.publish(request);
                  System.out.println(result.messageId() + " Message sent. Status is " + result.sdkHttpResponse().statusCode());
      
               } catch (SnsException e) {
                  System.err.println(e.awsErrorDetails().errorMessage());
                  System.exit(1);
               }
          }
      
      
      5.

    2. Enter an attribute Name, such as

          public static void pubTopic(SnsClient snsClient, String message, String topicArn) {
      
              try {
                  PublishRequest request = PublishRequest.builder()
                      .message(message)
                      .topicArn(topicArn)
                      .build();
      
                  PublishResponse result = snsClient.publish(request);
                  System.out.println(result.messageId() + " Message sent. Status is " + result.sdkHttpResponse().statusCode());
      
               } catch (SnsException e) {
                  System.err.println(e.awsErrorDetails().errorMessage());
                  System.exit(1);
               }
          }
      
      
      6.

    3. Enter an attribute Value, such as

          public static void pubTopic(SnsClient snsClient, String message, String topicArn) {
      
              try {
                  PublishRequest request = PublishRequest.builder()
                      .message(message)
                      .topicArn(topicArn)
                      .build();
      
                  PublishResponse result = snsClient.publish(request);
                  System.out.println(result.messageId() + " Message sent. Status is " + result.sdkHttpResponse().statusCode());
      
               } catch (SnsException e) {
                  System.err.println(e.awsErrorDetails().errorMessage());
                  System.exit(1);
               }
          }
      
      
      7.

    If the attribute type is String, String.Array, or Number, Amazon SNS evaluates the message attribute against a subscription's filter policy (if present) before sending the message to the subscription given filter policy scope is not explicitly set to

        public static void pubTopic(SnsClient snsClient, String message, String topicArn) {
    
            try {
                PublishRequest request = PublishRequest.builder()
                    .message(message)
                    .topicArn(topicArn)
                    .build();
    
                PublishResponse result = snsClient.publish(request);
                System.out.println(result.messageId() + " Message sent. Status is " + result.sdkHttpResponse().statusCode());
    
             } catch (SnsException e) {
                System.err.println(e.awsErrorDetails().errorMessage());
                System.exit(1);
             }
        }
    
    
    8.

    For more information, see Amazon SNS message attributes.

  7. Choose Publish message.

    The message is published to the topic, and the console opens the topic's Details page.

To publish a message to a topic using an AWS SDK

To use an AWS SDK, you must configure it with your credentials. For more information, see The shared config and credentials files in the AWS SDKs and Tools Reference Guide.

The following code examples show how to publish messages to an Amazon SNS topic.

.NET

AWS SDK for .NET

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository.

Which AWS services can be used for notification?

Amazon Simple Notification Service (SNS) sends notifications two ways, A2A and A2P. A2A provides high-throughput, push-based, many-to-many messaging between distributed systems, microservices, and event-driven serverless applications.

Which service in AWS can be used to send notifications like email to end users?

Amazon SNS is supported in the AWS Management Console which provides a point-and-click, web-based interface to access and manage Amazon SNS. Using the AWS Management Console, you can create topics, add subscribers, and send notifications – all from your browser.

What kind of message does SNS send to endpoints?

When Amazon SNS sends a notification to a subscribed HTTP or HTTPS endpoint, the POST message sent to the endpoint has a message body that contains a JSON document with the following name-value pairs. The Message value specified when the notification was published to the topic.

Which Amazon service should the solutions architect use to push notifications to users?

Amazon SNS is often used to send out mobile push notification messages directly to mobile apps.