sparse-intern-71089
03/29/2021, 11:43 PMlittle-cartoon-10569
03/29/2021, 11:44 PMshy-bird-55689
03/29/2021, 11:47 PMlittle-cartoon-10569
03/29/2021, 11:48 PMlittle-cartoon-10569
03/29/2021, 11:49 PMshy-bird-55689
03/29/2021, 11:54 PMapi_gateway = apigateway.RestApi(
resource_name='api-gateway',
body="""swagger: "2.0"
info:
version: "2021-03-29T15:07:58Z"
title: "marv"
basePath: "/dev"
schemes:
- "https"
paths:
/test:
post:
responses: {}
x-amazon-apigateway-integration:
uri: "REDACTED"
httpMethod: "POST"
passthroughBehavior: "when_no_match"
type: "aws_proxy"""
)
api_gateway_deployment = apigateway.Deployment(
resource_name='api-gateway-deployment',
rest_api=api_gateway.id,
opts=pulumi.ResourceOptions(depends_on=[api_gateway])
)
api_gateway_stage = apigateway.Stage(
resource_name='marv-api-gateway-stage',
stage_name='dev',
rest_api=api_gateway.id,
deployment=api_gateway_deployment.id
)
little-cartoon-10569
03/30/2021, 12:31 AMtype: "aws_proxy"""
supposed to have only 3 double-quotes? There's here-doc opener up on the body
line, and a string opener on the line in question.. seems like there should be 4 double-quotes?shy-bird-55689
03/30/2021, 8:46 AMlittle-cartoon-10569
03/30/2021, 7:41 PMshy-bird-55689
03/30/2021, 9:00 PMwith open(r'api.yaml') as file:
openapi_spec = yaml.load(file, Loader=yaml.FullLoader)
and then updating the creation of the RestAPI resource
api_gateway = apigateway.RestApi(
resource_name='api-gateway',
body=yaml.dump(openapi_spec)
)
little-cartoon-10569
03/30/2021, 9:00 PMshy-bird-55689
03/30/2021, 9:00 PM