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 add more than 1 responses to apigw.AwsIntegration #1608

Closed
jameszh opened this issue Jan 24, 2019 · 0 comments · Fixed by #1636
Closed

Unable to add more than 1 responses to apigw.AwsIntegration #1608

jameszh opened this issue Jan 24, 2019 · 0 comments · Fixed by #1636
Assignees
Labels
@aws-cdk/aws-apigateway Related to Amazon API Gateway feature-request A feature should be added or improved.

Comments

@jameszh
Copy link

jameszh commented Jan 24, 2019

SelectionPattern is in the options block see aws-cdk doc as opposed to
in the integrationResponses cloudformation doc,

In the following code example, the syntax is correct, but it doesn't work as expected.

const successIntegration = new apigw.AwsIntegration({
    service: 'states',
    action: 'SendTaskSuccess',
    options: {
        credentialsRole: apigwRole,
        passthroughBehavior: apigw.PassthroughBehavior.WhenNoTemplates,
        requestTemplates: {
            "application/json": "{\n   \"output\": \"{ \\\"result\\\": \\\"Confirmed succeed\\\" }\",\n   \"taskToken\": \"$input.params('taskToken')\"\n}"
        },
        integrationResponses: [

            {
                statusCode: "200",
                responseTemplates: {"application/json": "{\n \"result\": \"It is a success.\"\n }"}
            },
            {
                statusCode: "503",
                responseTemplates: {"application/json": "{\n \"result\": \"Invalid request.\"\n }"}
            }
        ],
        selectionPattern: "200"
    }
});
@rix0rrr rix0rrr added feature-request A feature should be added or improved. @aws-cdk/aws-apigateway Related to Amazon API Gateway gap labels Jan 24, 2019
RomainMuller added a commit that referenced this issue Jan 30, 2019
The property was modeled in the wrong place, rendering it unusable.
Moved it to the correct location instead, and added a validation test.

Fixes #1608
@RomainMuller RomainMuller self-assigned this Jan 30, 2019
RomainMuller added a commit that referenced this issue Feb 4, 2019
The property was modeled in the wrong place, rendering it unusable.
Moved it to the correct location instead, and added a validation test.

Fixes #1608
moofish32 pushed a commit to moofish32/aws-cdk that referenced this issue Feb 5, 2019
The property was modeled in the wrong place, rendering it unusable.
Moved it to the correct location instead, and added a validation test.

Fixes aws#1608
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-apigateway Related to Amazon API Gateway feature-request A feature should be added or improved.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants