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

API Gateway sage maker end point #687

Open
vikramranabhatt opened this issue Mar 14, 2022 · 0 comments
Open

API Gateway sage maker end point #687

vikramranabhatt opened this issue Mar 14, 2022 · 0 comments

Comments

@vikramranabhatt
Copy link

vikramranabhatt commented Mar 14, 2022

I want to create API Gateway for Sagemaker end point using serverless.yam. Its failing .

An error occurred: ApiGatewayMethod - Role ARN must be specified for AWS integrations (Service: AmazonApiGateway; Status Code: 400; Error Code: BadRequestException; Request ID: cb987b30-1ea1-4877-b6b9-e2817d7462b3; Proxy: null).

looks like my template is wrong...could any one help me with api gateway example

serverless.yaml

> ApiGatewayRestApi:
  Type: AWS::ApiGateway::RestApi
  Properties:
    ApiKeySourceType: HEADER
    Description: An API Gateway with a sagemaker Integration
    EndpointConfiguration:
      Types:
        - EDGE
    Name: Rsage-api

ApiGatewayResource:
  Type: AWS::ApiGateway::Resource
  Properties:
    ParentId: !GetAtt ApiGatewayRestApi.RootResourceId
    PathPart: 'sagemaker'
    RestApiId: !Ref ApiGatewayRestApi

ApiGatewayMethod:
  Type: AWS::ApiGateway::Method
  Properties:
    ApiKeyRequired: false
    AuthorizationType: NONE
    HttpMethod: POST
    Integration:
      ConnectionType: INTERNET
      #Credentials: !GetAtt ApiGatewayIamRole.Arn
      IntegrationHttpMethod: POST
      PassthroughBehavior: WHEN_NO_MATCH
      TimeoutInMillis: 29000
      Type: AWS
      Uri: !Sub "arn:aws:apigateway:${self:provider.region}:runtime.sagemaker:path/endpoints/xgboost-2022-03-08-08-31-11-865/invocations"
    OperationName: 'lambda'
    ResourceId: !Ref ApiGatewayResource
    RestApiId: !Ref ApiGatewayRestApi

ApiGatewayModel:
  Type: AWS::ApiGateway::Model
  Properties:
    ContentType: 'application/json'
    RestApiId: !Ref ApiGatewayRestApi
    Schema: { }

ApiGatewayStage:
  Type: AWS::ApiGateway::Stage
  Properties:
    DeploymentId: !Ref ApiGatewayDeployment
    Description: Lambda API Stage v0
    RestApiId: !Ref ApiGatewayRestApi
    StageName: 'v0'

ApiGatewayDeployment:
  Type: AWS::ApiGateway::Deployment
  DependsOn: ApiGatewayMethod
  Properties:
    Description: RSage API Deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant