Giter VIP home page Giter VIP logo

Comments (3)

Haga14 avatar Haga14 commented on August 10, 2024 1

I made a stupid mistake.

I wanted to do the integration with a get request given it is just a mock, so I changed it to a get but the method settings are for a post and that was causing the issue. It worked fine once I changed it back to a post.

You're very diligent and helpful with this! Thank you <3

from cloudformation-templates.

nickolashkraus avatar nickolashkraus commented on August 10, 2024
$ cd NickolasHKraus/cloudformation-templates
$ aws cloudformation validate-template \
--template-body file://api-gateway-mock-integration/template.yaml

{
    "Parameters": [],
    "Description": "AWS API Gateway with a Mock Integration"
}
$ aws cloudformation deploy \
--stack-name mock-api \
--template-file api-gateway-mock-integration/template.yaml


Waiting for changeset to be created..
Waiting for stack create/update to complete
Successfully created/updated stack - mock-api
$ API_GATEWAY_ID=$(aws apigateway get-rest-apis --query 'items[?name==`mock-api`].id' | grep -o -E "[a-z0-9]+")
$ http -v POST \
https://$API_GATEWAY_ID.execute-api.us-east-1.amazonaws.com/v0/mock \
Content-Type:application/json \
statusCode:=200

POST /v0/mock HTTP/1.1
Accept: application/json, */*;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 19
Content-Type: application/json
Host: swbxg3y917.execute-api.us-east-1.amazonaws.com
User-Agent: HTTPie/2.3.0

{
    "statusCode": 200
}


HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 17
Content-Type: application/json
Date: Mon, 15 Feb 2021 17:55:04 GMT
Via: 1.1 f3fda5ca9ebf687c46ab909cf14e0bae.cloudfront.net (CloudFront)
X-Amz-Cf-Id: 2uS3CyjI_0JBEFsLK054QwXVCUbLR-kqz0mH6ZXn93T8WrXNExloXw==
X-Amz-Cf-Pop: ATL56-C2
X-Cache: Miss from cloudfront
x-amz-apigw-id: azFK4FyKIAMFYZg=
x-amzn-RequestId: 302a256e-557d-439d-bfae-9b120fa1b08f

{
    "message": "OK"
}

from cloudformation-templates.

nickolashkraus avatar nickolashkraus commented on August 10, 2024

Above is me deploying the AWS API Gateway with a Mock Integration.

It works. Start from my template, then make changes.

Being unable to see your CloudFormation template, I can not know what your issue is.

from cloudformation-templates.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.