AWS App Sync Subscriptions over MQTT is not supported - amazon-web-services

While using AWS AppSync SDK to add subscription its returning this error, but I got the result in AWS console.
errorType: "BadRequestException"
message: "Subscriptions over MQTT is not supported."
I have seen this similar question and tried the answers that doesn't worked for me.
Is there any way to solve this error? looking forward to the suggestions
Thank you

This happens due to de deprecation of MQTT
So instead of configuring
createSubscriptionHandshakeLink as createSubscriptionHandshakeLink(url, httpLink)
you must use createSubscriptionHandshakeLink({ url, region, auth }) or it will result to using MQTT
ref:
https://github.com/awslabs/aws-mobile-appsync-sdk-js/issues/628

Related

AWS push notification not sending | SNS and Pinpoint | Android Studio FCM

I'm unable to receive any of my push notifications sent by either Amazon SNS or Pinpoint. At one point it used to work via the push notification section on AWS however has stopped for some reason. I've tried using pinpoint via a lambda function for it to work but to no avail. I should add also that Pinpoint is my preferred method for sending the push notifications via lambda, as the goal for my project is to have triggered push notifications.
Lambda function using pinpoint to send push notifcation
I'm using Android Studio and I wonder if the problem lies there? as I am using the correct token that my android studio app received so the issue isn't there.
Picture of my token in the android studio
Proof of token used in AWS SNS
Does anyone know what it may be? I would greatly appreciate any help received
Also if anyone knows how to send a notification to all users of my app that would be brilliant.

while installing aws amplify init on terminal .gives error

i am getting this while doing amplify init , so main agenda is to develop authentication through aws-cognito , which is using aws-amplify,
? Do you want to use an AWS profile? Yes
? Please choose the profile you want to use default
init failed
Error: read ECONNRESET
at TLSWrap.onStreamRead (internal/stream_base_commons.js:205:27) {
message: 'read ECONNRESET',
errno: 'ECONNRESET',
code: 'NetworkingError',
syscall: 'read',
region: 'us-east-1',
hostname: 'amplify.us-east-1.amazonaws.com',
retryable: true,
time: 2020-04-16T12:09:59.975Z
You may try the following strategies to eliminate the problem you are facing,
This more of looks like a Network problem as per the logs from your
Terminal, therefore if you have a jittery connection, I would
recommend that you try the same on a stable internet connection.
I will recommend to do an amplify delete in case there is some mis-configuration from the last time you did an amplify init, but the chances of this are very less.
Check your aws environment variables or configuration file maybe the credentials of your aws account are missing. Try doing an aws configure and reset the values of your key,secret, and region.
I hope the above suggestions help you somehow.

Failed to republish to topic in AWS IoT Rule

In AWS IoT core, I set up a rule with a republish action to update a thing's shadow (TestThing's shadow) like this
(I created new IAM role for the action in case you are wondering)
What I was expecting was that the thing's shadow should be updated and nothing should be published to 'testthing/error' when I publish a message to 'testthing/message'. But when I published the following message to 'testthing/message' with AWS IoT MQTT client
{
"state":
{
"reported":
{
"Info":"Hello AWS IoT!"
}
}
}
I got this error from 'testthing/error':
...
"failedAction": "RepublishAction",
"failedResource": "/things/TestThing/shadow/update",
"errorMessage": "Failed to republish to topic. Received Server error. The error code is 403. Message arrived on: testthing/message, Topic: /things/TestThing/shadow/update"
...
If I change the topic to which the message should be republished into 'testthing/destination', everything works fine, no error message was published to 'testthing/error'.
Am I missing something?
$aws/# is a reserved topic.
As per AWS Documentation here:
If you are republishing to a reserved topic, one that begins with $ use $$ instead.
Please replace $ with $$ and try again!
cheers,
ram

Amazon Connect - cannot debug error in Get Customer Input Stage

I am just new to Amazon Connect and Lex and have just starting creating simple projects. I already have created an entire contact flow which uses Lex and Lambda for routing. Problem is in the "Get Customer Input" stage, it seems to always go to the error output and I could not figure out why. I tried to check if there's any way I can find logs for each stages in the contact flow but could not find any.
Can anyone help me solve this issue? I need to see logs to find out the cause of the error.
EDIT: I got the contact flow logs from cloudwatch. See below. I can't find any significant error from it.
{
"Results": "Error",
"ContactId": "<contact-id>",
"ContactFlowId": "<the contact flow id>",
"ContactFlowModuleType": "GetUserInput",
"Timestamp": "2019-07-08T08:27:01.185Z"
}
You might be getting error because you are getting error from your Lex and that is why the flow is going in error.
You can check the logs for connect and Lex in Amazon service - Amazon CloudWatch.
You can also provide details from logs/screenshot what exactly error you are getting, so that I can help.
This might be due to language settings mismatch.
If you're using LexV2 make sure you set the proper Language Attribute as well. Easiest way is using the set Voice block in your Contact Flow, on the very bottom of the block you can enable "set language attribute".
Original answer: https://repost.aws/questions/QUn9bLLnclQxmD_DMBgfB9_Q/amazon-connect-error-using-lex-as-customer-input

How can I opt back in to receive SMS messages via Amazon Pinpoint

As part of some testing that I was doing, I replied STOP to an SMS message that was sent via Amazon's Pinpoint service. I received the acknowledgement that I had been removed from further notifications.
I want to opt back in to receiving those messages, but I can't figure out how to do that. I looked at the Pinpoint documentation and I did not see a way to do it. I looked in the Amazon Pinpoint Console and I did not see a way to remove a number from the blacklist. I have tried the standard terms that other SMS providers use such as UNSTOP, UNBLOCK, and START, but none of those work either. Does anyone have any suggestions. I do not want to contact Amazon support about this unless I have to.
As described here: https://docs.aws.amazon.com/cli/latest/reference/sns/opt-in-phone-number.html
aws sns opt-in-phone-number --phone-number ###-###-####
You can also use AWS Console -> Amazon SNS -> Mobile -> Text Messaging(SMS) section to see a list of opt-out phone numbers that was done through Pinpoint and choose to opt-in these numbers...
AWS Pinpoint has not come up with the APIs to check if the number is opted out or not. You can use the AWS SNS APIs for checking this as well for marking a mobile number as active again.
I've been trying to figure this out as well and I think I have a solution from a set of documentation I found about setting up Pinpoint. Below is python pseudocode; from my understanding we just have to update the "OptOut" status for the endpoint (i.e. the phone number that originally opted out).
# Python pseudo code with comments
import boto 3
import datetime
pinpoint = boto3.Session(**login_kwargs).client("pinpoint")
opt_in_response = pinpoint.update_endpoint(
ApplicationId="<App ID from your project>",
EndpointId="<Endpoint you are updating>", # Same as your phone number?
EndpointRequest={
"Address": "<Phone you are updating>",
"ChannelType": 'SMS',
"OptOut": "NONE", # Change from "ALL" (which is opt-out) to "NONE", opt-in
"EffectiveDate": datetime.datetime.utcnow().isoformat(),
"Attributes": {
"OptInTimestamp": [datetime.datetime.utcnow().isoformat()]
}
}
)
I attempted to follow this documentation https://docs.aws.amazon.com/pinpoint/latest/developerguide/pinpoint-dg.pdf (the relevant stuff starts on page 92), which happens to not be in Python.
I wasn't successful but I'm pretty sure this is how you should be able to opt back in (if anyone who knows node.js can verify this solution that'd be awesome).