amazon web services - Integrate API Gateway with SNS using Cloudformation -
i'm trying integrate api gateway method sns topic using cloudformation, can't figure out how uri
property should like.
for connecting lambda looks like:
"integration": { "integrationhttpmethod": "post", "type": "aws", "uri": { "fn::join": [ "", [ "arn:aws:apigateway:", { "ref": "aws::region" }, ":lambda:path/2015-03-31/functions/", { "fn::getatt": [ "somelambdafunction", "arn" ] }, "/invocations" ] ] }
what equivalent sns like?
an integration template topic, subject , message set request parameter this:
apigatewaygetmethod: type: aws::apigateway::method properties: authorizationtype: none httpmethod: requestparameters: method.request.querystring.message: false method.request.querystring.subject: false method.request.querystring.topic: false integration: type: aws credentials: fn::getatt: [ gatewayrole, arn ] uri: fn::join: - "" - - "arn:aws:apigateway:" - ref: aws::region - ":sns:action/publish" integrationhttpmethod: requestparameters: integration.request.querystring.topicarn: "method.request.querystring.topic" integration.request.querystring.subject: "method.request.querystring.subject" integration.request.querystring.message: "method.request.querystring.message" integrationresponses: - statuscode: 200 responsetemplates: application/json: '{"status":"ok"}' methodresponses: - statuscode: 200 resourceid: fn::getatt: [ apigatewayrestapi , rootresourceid ] restapiid: !ref apigatewayrestapi
this implementation can called following syntax:
https://abc123456.execute-api.eu-central-1.amazonaws.com/x ?topic=arn:aws:sns:eu-central-1:111111:sampletopic &message=samplemesage &subject=samplesubject
Comments
Post a Comment