Last active
August 13, 2020 10:12
-
-
Save datashaman/054f128968311cc7c4a20c51f7bd21ee to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DefinitionBody: | |
swagger: 2.0 | |
info: | |
title: !Ref AWS::StackName | |
paths: | |
/ingest: | |
post: | |
consumes: | |
- application/json | |
produces: | |
- application/json | |
responses: | |
"200": | |
statusCode: "200" | |
description: "OK" | |
x-amazon-apigateway-integration: | |
httpMethod: POST | |
statusCode: 200 | |
type: AWS | |
credentials: !GetAtt SnsPublishRole.Arn | |
uri: !Sub arn:aws:apigateway:${AWS::Region}:sns:path// | |
passthroughBehaviour: NEVER | |
requestParameters: | |
integration.request.header.Content-Type: "'application/x-www-form-urlencoded'" | |
requestTemplates: | |
application/json: !Sub | |
- | | |
Action=Publish## | |
&Version=2010-03-31## | |
&TopicArn=$util.urlEncode('${Topic}')## | |
&Message=$util.urlEncode($input.json('$'))## | |
&MessageAttributes.entry.1.Name=event## | |
&MessageAttributes.entry.1.Value.StringValue=EventReceived## | |
&MessageAttributes.entry.1.Value.DataType=String | |
- Topic: !Ref EventReceived | |
responses: | |
"2\\d{2}": | |
statusCode: "200" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment