通过api网关访问ec2到cloudformation

时间:2018-12-05 22:21:41

标签: amazon-ec2 integration amazon-cloudformation aws-api-gateway

请帮助我

我如何使用cloudformation通过api-gateway描述实例es2的端点

我有ec2模板:

AppNode:
  Type: AWS::EC2::Instance
  Properties:
    InstanceType: t2.micro
    ImageId:  "ami-09f0b8b3e41191524"
    KeyName: "ec2_access_my_acc.pem"
    BlockDeviceMappings:
    - DeviceName: "/dev/sdm"
      Ebs:
        VolumeType: "io1"
        Iops: "200"
        DeleteOnTermination: "false"
        VolumeSize: "8"
  SecurityGroups:
    - !Ref AppNodeSG

我有一个模板,可以通过sagger来描述api-gateway:

     /pet:
        post:
          tags:
            - pet
          summary: Add a new pet to the store
          description: ''
          operationId: addPet
          parameters:
            - in: body
              name: body
              description: Pet object that needs to be added to the 
            store
              required: true
              schema:
                $ref: '#/definitions/Pet'
          responses:
            '405':
              description: Invalid input
          x-amazon-apigateway-integration:
            consumes:
                - "application/json"
            produces:
                - "application/json"
            responses:
              default:
                statusCode: '200'
            passthroughBehavior: when_no_match
            httpMethod: POST
            type: aws_proxy
            uri: ??????

所有这些都在单个cloudformation文件中描述。 我应该用什么代替?????可以通过端点/pet

访问ec2

0 个答案:

没有答案