@@ -0,0 +1,1924 @@
+/*%0A   Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.%0A   This file is licensed under the Apache License, Version 2.0 (the %22License%22).%0A   You may not use this file except in compliance with the License. A copy of%0A   the License is located at%0A    http://aws.amazon.com/apache2.0/%0A   This file is distributed on an %22AS IS%22 BASIS, WITHOUT WARRANTIES OR%0A   CONDITIONS OF ANY KIND, either express or implied. See the License for the%0A   specific language governing permissions and limitations under the License.%0A*/%0A%0A%0Apackage com.example.handlingformsubmission;%0A%0Aimport software.amazon.awssdk.auth.credentials.EnvironmentVariableCredentialsProvider;%0Aimport software.amazon.awssdk.regions.Region;%0Aimport software.amazon.awssdk.services.sns.SnsClient;%0Aimport software.amazon.awssdk.services.sns.model.PublishRequest;%0Aimport software.amazon.awssdk.services.sns.model.PublishResponse;%0Aimport software.amazon.awssdk.services.sns.model.SnsException;%0Aimport org.springframework.stereotype.Component;%0A%0A@Component(%22PublishTextSMS%22)%0Apublic class PublishTextSMS %7B%0A%0A    public void sendMessage(String id) %7B%0A%0A        Region region = Region.US_EAST_1;%0A        SnsClient snsClient = SnsClient.builder()%0A                .region(region)%0A                .credentialsProvider(EnvironmentVariableCredentialsProvider.create())%0A                .build();%0A        String message = %22A new item with ID value %22+ id +%22 was added to the DynamoDB table%22;%0A        String phoneNumber=%2218195765654%22; //Replace with a mobile phone number%0A%0A        try %7B%0A            PublishRequest request = PublishRequest.builder()%0A                    .message(message)%0A                    .phoneNumber(phoneNumber)%0A                    .build();%0A%0A            PublishResponse result = snsClient.publish(request);%0A%0A        %7D catch (SnsException e) %7B%0A%0A            System.err.println(e.awsErrorDetails().errorMessage());%0A            System.exit(1);%0A        %7D%0A    %7D%0A%7D%0A

Create PublishTextSMS.java