Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable To Set RequestTemplate On api-gateway-sqs Construct #69

Closed
mam8cc opened this issue Sep 16, 2020 · 1 comment
Closed

Unable To Set RequestTemplate On api-gateway-sqs Construct #69

mam8cc opened this issue Sep 16, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@mam8cc
Copy link

mam8cc commented Sep 16, 2020

Attempting to create an API Gateway integrated to an SQS Queue will allow you to set the createRequestTemplate but it appears to not honor the value set in the ApiGatewayToSqs props. You can see here that it is only using the template defined on line 30.

I would like to set the request template because my SQS queue is FIFO and I need to set the MessageGroupId.

Reproduction Steps

import * as cdk from '@aws-cdk/core';
import { ApiGatewayToSqs } from '@aws-solutions-constructs/aws-apigateway-sqs';

export class ShopifyInfraStack extends cdk.Stack {

  constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);

    const apiSqsIntegration = new ApiGatewayToSqs(this, 'sqsApiIntegration', {
      deployDeadLetterQueue: true,
      queueProps: {
        fifo: true
      },
      maxReceiveCount: 10,
      allowCreateOperation: true,
      createRequestTemplate: '"Action=SendMessage&MessageBody=$util.urlEncode(\"$input.body\")&MessageGroupId=$input.json(\"$.fooId\")"',
      apiGatewayProps: {
        deploy: true
      }
    });
  }
}

Error Log

There is no error, and the stack deploy successfully however in the outputted template, the createRequestTemplate is not reflective of my configuration.

  sqsApiIntegrationRestApiPOSTC60EA528:
    Type: AWS::ApiGateway::Method
    Properties:
      ...
      Integration:
        ...
        RequestParameters:
          integration.request.header.Content-Type: "'application/x-www-form-urlencoded'"
        RequestTemplates:
          application/json: Action=SendMessage&MessageBody=$util.urlEncode("$input.body")

Environment

  • CDK CLI Version: 1.63.0 (build 7a68125)
  • CDK Framework Version: 1.63.0
  • AWS Solutions Constructs Version : 1.63.0
  • OS : macOs Catalina 10.15.1
  • Language : TypeScript

Other


This is 🐛 Bug Report

@mam8cc mam8cc added bug Something isn't working needs-triage The issue or PR still needs to be triaged labels Sep 16, 2020
@hnishar hnishar self-assigned this Sep 17, 2020
@hnishar hnishar added in-progress This issue is being actively worked on and removed needs-triage The issue or PR still needs to be triaged labels Sep 17, 2020
@hnishar
Copy link
Contributor

hnishar commented Sep 24, 2020

This has been fixed in v1.64.0

@hnishar hnishar closed this as completed Sep 24, 2020
@hnishar hnishar removed the in-progress This issue is being actively worked on label Sep 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants