211 questions
0
votes
0
answers
26
views
Unable to transform request AWS Gateway VTL
I have the following pulumi go code which uses AWS Integration to start a StepFunction.
func DealRequestTemplate(stateMachineArn pulumi.StringInput) pulumi.StringInput {
return pulumi.Sprintf(`#...
0
votes
0
answers
67
views
Custom report generation using VTL and Excel
I am attempting to generate custom reports for a program I am working on. I am a systems engineer using Cameo Systems Modeler and would like to generate a report capturing the changes made between ...
0
votes
1
answer
52
views
How to map custom header into body request?
I'm working with AWS Api Gateway integrated with SQS.
I would like to catch a header from the request to the Api Gateway and map it to the body, so it becomes part of the message the SQS will recieve.
...
0
votes
0
answers
38
views
AwsIntegration write to DynamoDB SerializationException
I have the following code which takes a POST input and writes the data in a DynamoDB table.
It works if I don't add the validation to check if the key:value pair exists.
Here is the code:
const ...
0
votes
1
answer
144
views
Cameo VTL Tags for Requirements
I am trying to write a VTL script that pulls requirement attributes from cameo. However, some of them that have drop downs are giving me trouble. Does anyone know how to specify such properties, such ...
1
vote
0
answers
92
views
AWS API Gateway VTL not handling Map type as JSON
I'm trying to account for dynamic objects coming into an endpoint and using a mapping template to transform it to the proper outout. However, the serialization is a but whacky causing the below error. ...
1
vote
1
answer
91
views
How to get Velocity to output a LF character to a CSV file
I am usng VTL to output a CSV file from Cameo to be read into Excel. In order to output multiple lines into the same Excel cell, I need to insert a Line Feed (LF) character. I have read that I should ...
1
vote
0
answers
90
views
How to validate query parameters passed to AWS API gateway?
I have an API deployed to REST API gateway.
My endpoint is https://<gateway-id>.execute-api.<region>.amazonaws.com/<stage>/items?pageSize=10. This endpoint is integrated directly to ...
1
vote
1
answer
284
views
How to get recent entries from Dynamo DB
We have a table in Dynamo DB, attributes to be saved are as below.
ProcessId - kept this as partition key, unique for each entry
CreatedDate(time of insertion)
Filename
other random attributes
We ...
0
votes
0
answers
333
views
API Gateway and mapping template with path and body parameters
There are lots of questions about the mapping templates but I couldn't find resolution to my problem.
I have a api endpoint path PUT /foo/bar/{clientNumber} and the body is
{
"progress": ...
0
votes
0
answers
115
views
Why is my resolver query function not returning items from dynamodb that has an sk value above 9999
I tried my best to make it make sense as much as possible with the knowledge I have, I am trying to learn AWS Appsync + DynamoDB and VTL. Thanks
I have a simple query like this using VTL:
{
"...
1
vote
1
answer
535
views
VTL Mapping Template To Convert Encoded Form Data Into JSON Object For AWS Step Function
How to convert application/x-www-form-urlencoded data coming via POST request into API gateway into a JSON object so you may send said object to Step Functions without first sending to Lambda for pre-...
0
votes
1
answer
498
views
How can i convert string value from path param to int in Mapping templates of aws api gateway
I try to using api gateway and query data direct to dynamo db.
I has epoch time in path param and i tried to minus epoch by one day to query data in dynamodb but it not work. I tried convert by ...
0
votes
1
answer
188
views
I get conditional exception even though the request meets condition in AppSync
Overview
I am quite new to AppSync.
Issue
I could not limit PutItem command even though I set a condition in resolver.
Query
mutation MyMutation {
createTodo(input: {description: "test", ...
0
votes
2
answers
76
views
How to retain value of field in JS
I have one multi-select field whose values are coming from one table which has the following data.
Desc | Code
----------------
India | IN
Australia | AUS
Other | OTH
Requirement: In ...
0
votes
1
answer
602
views
Why does AWS AppSync only directly support VTL (Velocity Template Language) for Resolvers?
It seems that you can write Javascript, but only by adding a new Lambda function which adds cost and complexity of the app. I am just curious to know why this is the case, as VTL seems to be much less ...
1
vote
0
answers
245
views
Writing a custom resolver for appsync query
I want to add a layer of security to my app (Amplify using appsync) so that only contacts who are part of a specific company can see cases that are a part of that company. My idea is that I query the ...
0
votes
1
answer
93
views
Issue with handling jsonb columns in appsync mutations
I use appsync with aurora serverless postgres as the datasource in my project, I need to insert or update a row in a table which contain a jsonb column, but always having an issue in inserting it.
My ...
1
vote
1
answer
569
views
Appsync VTL resolvers assigning null to a an object
I extended the default resolvers I received from Amplify/Appsync for one of my models.
I saved my code as Mutation.updateMovement.preUpdate.1.req.vtl, and here's my VTL file:
#set( $muscleGroups = $...
1
vote
1
answer
567
views
VTL adds whitespaces to string
I am using mapping template in AWS API Gateway methods Integration response.
I found that it adds unwanted whitespaces to the return string. I have read Velocity references and tried all trimming and ...
0
votes
1
answer
257
views
How to get the unicode of a character in Apache Velocity (VTL)
Im trying to obtain the Unicode(code) of a character in VTL.
For example I would like to get the number 902 from the character Ά
The analogue in JS would be:
'Ά'.charCodeAt(0)
902
Similarly the char ...
0
votes
0
answers
531
views
AWS Api Gateway VTL Merge Json Object
Trying to merge the principalId from Lambda Authorizer into the payload that will be sent to Event Bridge.
So far I've gotten close by transforming to map and re-creating the Json object. The problem ...
1
vote
1
answer
1k
views
AWS API Gateway Mapping Templates - VTL complications with escaping for eventbridge
Brief:
I have an API Gateway(V1-RestAPI) that sends events to EventBrdige on HTTP calls.
I would like to put an event into EventBridge using the basic template of API Gateway - Method Request ...
0
votes
1
answer
264
views
VTL Velocity Template Language - Problems with type casting
I have written the VTL below to check to see if variables(attributes) I am getting from my PIM system are not blank. If they are set them to zero. Then mathematically add the two variables.
The ...
0
votes
1
answer
980
views
AWS AppSync - formatting hardcoded JSON data in response mapping template
I need a GraphQL query returning hardcoded informations as JSON response.
In the AppSync GraphQL schema, I added the following query:
type Query {
getHealthCheck: AWSJSON
}
My response mapping ...