cloudformation-cli icon indicating copy to clipboard operation
cloudformation-cli copied to clipboard

ApiGatewayV2 ResponseParameters inconsistency

Open nnew2 opened this issue 2 months ago • 0 comments

Hello,

The following fails to deploy with error: Properties validation failed for resource CoolIntegration with message: [#/ResponseParameters/200: extraneous key [remove:header.x-powered-by] is not permitted]

However, creating the ResponseParameters from AWS Console works. Note that the RequestParameters can be created using CloudFormation just fine.

JSON of successful ResponseParameter when created in the AWS Console

$ aws apigatewayv2 get-integration   --api-id xxxxx   --integration-id xxxxx   --region eu-central-1   --output json --profile xxxx
{
    "ConnectionId": "xxxxx",
    "ConnectionType": "VPC_LINK",
    "Description": "API Gateway Integration",
    "IntegrationId": "xxxxx",
    "IntegrationMethod": "ANY",
    "IntegrationType": "HTTP_PROXY",
    "IntegrationUri": "xxxxx",
    "PayloadFormatVersion": "1.0",
    "RequestParameters": {
        "append:header.X-Service": "CoolService"
    },
    "ResponseParameters": {
        "200": {
            "remove:header.x-powered-by": "''"
        }
    },
    "TimeoutInMillis": 30000
}

Failing YAML

CoolIntegration:
  Type: AWS::ApiGatewayV2::Integration
  Properties:
    Description: API Gateway Integration
    ApiId: !ImportValue x:y
    ConnectionType: VPC_LINK
    ConnectionId: !ImportValue x:y
    IntegrationType: HTTP_PROXY
    IntegrationMethod: ANY
    IntegrationUri: !ImportValue x:y
    PayloadFormatVersion: "1.0"
    RequestParameters:
      "append:header.X-Service": "CoolService"
    ResponseParameters:
      "200":
        remove:header.x-powered-by: "''"

nnew2 avatar Oct 23 '25 16:10 nnew2