我正在尝试使用python在aws apigateway中创建一个资源及其集成。我正在使用boto3软件包。这是我尝试过的代码
import boto3
import config
session = boto3.session.Session(config.AWS_ACCESS_KEY_ID, config.AWS_SECRET_ACCESS_KEY)
client = session.client('apigateway', region_name=config.AWS_REGION)
api_endpoint = input("\n\tEnter the API endpoint: \n")
response = client.create_resource(
restApiId=config.REST_API_ID,
parentId=config.PARENT_RESOURCE,
pathPart=api_endpoint
)
resource_id = response["id"]
response2 = client.put_integration(
restApiId=config.REST_API_ID,
resourceId=resource_id,
httpMethod='ANY',
type='HTTP_PROXY',
uri=url,
integrationHttpMethod="ANY",
connectionType='VPC_LINK',
)
但是我总是得到botocore.errorfactory.NotFoundException:调用PutIntegration操作时发生错误(NotFoundException):指定的方法标识符无效
我尝试过http方法GET、POST、PUT。已成功创建资源。put_集成方法工作不正常
目前没有回答
相关问题 更多 >
编程相关推荐