title: AWS SAM Gateway API inherit Gateway Response not working
body: <p>Its seems my GatewayResponses conf its only apply to /Prod gateway API, /Prod/gcp doesn’t inherit the GatewayResponses configuration, as follow:</p>
  <pre><code>Post to : sa-east-1.amazonaws.com/Prod/gcp response : {&quot;message&quot;:&quot;Forbidden&quot;}
  
  Post to : sa-east-1.amazonaws.com/Prod response : { &quot;message&quot;: &quot;Method Not Allowed&quot; }
  </code></pre>
  <p>How do i setup response to both endPoints ?</p>
  <p>My SAM template :</p>
  <pre><code>Resources:
    ServerlessHttpApi:
      Type: AWS::Serverless::Api
      Properties:
        StageName: Prod
        Auth:
          ApiKeyRequired: true
        GatewayResponses:
          AUTHORIZER_FAILURE:
            ResponseTemplates:
              &quot;application/json&quot;: {&quot;message&quot;: &quot;Invalid API Token&quot;}
          MISSING_AUTHENTICATION_TOKEN:
            ResponseTemplates:
              &quot;application/json&quot;: '{ &quot;message&quot;: &quot;Method Not Allowed&quot; }'
  
    ApiKey:
      Type: AWS::ApiGateway::ApiKey
      DependsOn: [ApiUsagePlan]
      Properties:
        Name: !Join [&quot;-&quot;, [&quot;gcp-origin&quot;, !Ref Environment]]
        Description: &quot;CloudFormation API Key V1&quot;
        Enabled: true
        GenerateDistinctId: false
        Value: dsad23f412efe1
        StageKeys:
          - RestApiId: !Ref ServerlessHttpApi
            StageName: !Ref Environment
  
    ApiUsagePlan:
      Type: &quot;AWS::ApiGateway::UsagePlan&quot;
      DependsOn:
        - ServerlessHttpApiProdStage
      Properties:
        ApiStages:
          - ApiId: !Ref ServerlessHttpApi
            Stage: !Ref Environment
        Description: !Join [&quot;&quot;, [&quot;gcp-origin&quot;, !Ref Environment, &quot;usage plan&quot;]]
        UsagePlanName: !Join [&quot;&quot;, [&quot;gcp-origin&quot;, !Ref Environment,&quot;-usage-plan&quot;]]
  
    ApiUsagePlanKey:
      Type: &quot;AWS::ApiGateway::UsagePlanKey&quot;
      DependsOn:
        - ServerlessHttpApi
      Properties:
        KeyId: !Ref ApiKey
        KeyType: API_KEY
        UsagePlanId: !Ref ApiUsagePlan
  
    OrigindFunction:
      Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
      Properties:
        CodeUri: src/
        Handler: app.lambda_handler
        Runtime: python3.8
        Architectures:
          - x86_64
        Events:
          APItest:
            Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api
            Properties:
              RestApiId: !Ref ServerlessHttpApi
              Path: /gcp
              Method: post
  </code></pre>