You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you'd like to add content types or customize the default templates, you can do so by including your custom [API Gateway request mapping template](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html) in `serverless.yml` like so:
314
314
315
315
```yml
316
+
# Required for using Fn::Sub
317
+
plugins:
318
+
- serverless-cloudformation-sub-variables
319
+
316
320
custom:
317
321
apiGatewayServiceProxies:
318
322
- kinesis:
@@ -344,6 +348,10 @@ Source: [How to connect SNS to Kinesis for cross-account delivery via API Gatewa
344
348
Similar to the [Kinesis](#kinesis-1) support, you can customize the default request mapping templates in `serverless.yml` like so:
345
349
346
350
```yml
351
+
# Required for using Fn::Sub
352
+
plugins:
353
+
- serverless-cloudformation-sub-variables
354
+
347
355
custom:
348
356
apiGatewayServiceProxies:
349
357
- kinesis:
@@ -353,11 +361,9 @@ custom:
353
361
request:
354
362
template:
355
363
application/json:
356
-
'Fn::Join':
357
-
- ''
358
-
- - "Action=Publish&Message=$util.urlEncode('This is a fixed message')&TopicArn=$util.urlEncode('"
359
-
- { Ref: MyTopic }
360
-
- "')"
364
+
Fn::Sub:
365
+
- "Action=Publish&Message=$util.urlEncode('This is a fixed message')&TopicArn=$util.urlEncode('#{MyTopicArn}')"
366
+
- MyTopicArn: { Ref: MyTopic }
361
367
```
362
368
363
369
> It is important that the mapping template will return a valid `application/x-www-form-urlencoded` string
0 commit comments