3

I am trying to use stage variables, but I always get this error:

{
  "logref": "some_uid",
  "message": "Invalid stage variable value: null.  Please use values with alphanumeric characters and the symbols ' ', -', '.', '_', ':', '/', '?', '&', '=', and ','."
}

My goal is to call SNS from API gateway without the need from the caller to specify the TopicArn and the Message in the query string.

So in the Integration Request I am mapping the query string TopicArn to stageVariables.TopicArn (I have tried '$stageVariables.TopicArn' as well).

And then in the Stage variables section in AWS console I input the Name TopicArn and the Value arn:aws:sns:my_region:my_account_id:test-topic

After I deployed my API I test it from the AWS console and I get this error:

{
  "logref": "some_uid",
  "message": "Invalid stage variable value: null.  Please use values with alphanumeric characters and the symbols ' ', -', '.', '_', ':', '/', '?', '&', '=', and ','."
}

What am I doing wrong, it his achievable?

Matteo
  • 2,256
  • 26
  • 42
  • Same for me. Followed the approach as described here https://stackoverflow.com/a/54846352/1002217 but it looks like it can't find the stage variable... if i try to use the ARN directly as a value in query param it won't be accepted. – mikaint Jul 23 '20 at 06:07
  • 1
    just saw your solution as a comment to the other post. Very nice, worked for me as well. Maybe you should also provide it here as well for others. – mikaint Jul 23 '20 at 06:21
  • @mikaint which answer, the one for static values? Let me know so I will add it here, thanks – Matteo Jul 24 '20 at 00:42

0 Answers0