Skip to content

Handle Output Transformations #97

@andrewhertog

Description

@andrewhertog

This is a Feature Proposal

Description

For feature proposals:

  • What is the use case that should be solved. The more detail you describe this in the easier it is to understand for us.
  • If there is additional config how would it look

API Gateway allows users to modify the response body and headers based on content from the response from lambda, or the step functions. In the case of the step functions the output always appears to be:
{ "executionArn": "arn:aws:states:us-east-1:111111111111:execution:Name:ID", "startDate": epochTimeStamp }

I would like to be able to suppress this output and change the http response code to 201 or 204.

Activity

horike37

horike37 commented on Jan 3, 2018

@horike37
Collaborator

Thank you for the proposal @andrewhertog 👍
Sounds a good idea, but you cannot implement the feature since there is a restriction on AWS end.
The output body is generated automatically on AWS side, so we are not really sure how to customize the response code.

We would love to get any feedback how to implement it 😄

xonstone

xonstone commented on Aug 2, 2018

@xonstone

Perhaps you try like you did with IntegrationRequest? If I add this to the resources this seems to work

    ApiGatewayMethodSubscriptionBrandVarPost:
      Properties:
        Integration:
            IntegrationResponses:
              - StatusCode: 200
                SelectionPattern: '[1-5]\d\d'
                ResponseTemplates:
                  application/json: '{"rules":[]}'

With ApiGatewayMethodSubscriptionBrandVarPost being defined als the stepfunction http event

IssueHuntBot

IssueHuntBot commented on Dec 6, 2018

@IssueHuntBot

@issuehuntfest has funded $20.00 to this issue. See it on IssueHunt

kotowick

kotowick commented on Jul 30, 2019

@kotowick

@horike37 @xonstone Has this gone anywhere? I need to modify the Integration Response as well.. had no luck so far figuring it out.

EDIT: okay, got it to work, LOL

  ApiGatewayMethodVersionPost:
    Type: AWS::ApiGateway::Method
    Properties:
      Integration:
        IntegrationResponses:
          - StatusCode: 200
            ResponseTemplates:
              application/json: '{"key":"value"}'
      ResourceId:
        Ref: ApiGatewayResourceVersion
      RestApiId:
        Ref: ApiGatewayRestApi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @horike37@kotowick@andrewhertog@xonstone@IssueHuntBot

        Issue actions

          Handle Output Transformations · Issue #97 · serverless-operations/serverless-step-functions