0

Hello and thanks in advance for the help, Im trying to connect my serverless file to an existing API Rest in AWS but when I make the deploy it fails with the message: CREATE_FAILED: ApiGatewayResourceOtherversion (AWS::ApiGateway::Resource) Resource handler returned message: "Invalid Resource identifier specified

Here is the configuration in my serverless file and the API in the cloud

service: test-api-2

frameworkVersion: '3'

provider:
  name: aws
  region: us-east-1
  runtime: python3.8
  apiGateway: 
    restApiId: 7o3h7b2zy5
    restApiRootResourceId: "/second"



functions:
  hello_oscar:
    handler: test-api/handler.hello_oscar
    events:
        # every Monday at 03:15 AM
        - schedule: cron(15 3 ? * MON *)
        #- sqs: arn:aws:sqs:region:XXXXXX:MyFirstQueue
    package:
      include:
        - test-api/**
  get:
    handler:  hexa/application/get/get.get_information
    memorySize: 128
    description: Test function
    events:
    - http:
        path: /hola
        method: GET
        cors: true
    package:
      include:
        - hexa/**
  other_version:
    handler: other_version/use_other.another_version
    layers:
      - xxxxxxxxx
    runtime: python3.7
    description: Uses other version of python3.7
    events:
      - http:
          path: /other_version
          method: POST
          cors: true
    package:
      include:
        - other_version/**
  diferente:
    handler: other_version/use_other.another_version
    layers:
      - xxxxxxxxxxxxxx
    runtime: python3.8

enter image description here

1 Answer 1

2

In the example serverless.yml, where you have the restApiRootResourceId property set to /second, you should have it set to the root resource id, which is shown in your screen shot as bt6nd8xw4l

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.