[英]How to pass request parameter to httpintegration for Api Gateway using CDK python
I have an issues while passing我在通过时遇到问题
request_parameters = {"method.request.header.User":"context.authorizer.User"}
Into HttpIntegation:进入 HttpIntegration:
httpintegration = _apigw.HttpIntegration(url_auth + '/logout', proxy=True, options=request_parameters({"integration.request.header.User":"$context.authorizer.User"}))
I got:我有:
TypeError: 'dict' object is not callable Subprocess exited with error 1 Using: cdk python.
TypeError: 'dict' object is not callable Subprocess exited with error 1 using: cdk python.
Please refer to the Python example below.请参考下面的 Python 示例。 I suppose the IntegrationOptions class needs to be used.
我想需要使用IntegrationOptions class。
CDK and its documentation are not reliable and there are practically no usable examples with so many defects. CDK 及其文档不可靠,几乎没有可用的示例有这么多缺陷。 I am afraid CDK is not the level for general use.
恐怕CDK不是通用的级别。
cdk_api_method: aws_apigateway.Method = cdk_api_resource.add_method(
http_method=str.upper(verb),
integration=aws_apigateway.HttpIntegration(
url=url,
http_method=str.upper(verb),
proxy=True,
options=aws_apigateway.IntegrationOptions(
request_parameters=method_parameter_set['integration_request_parameters']
if 'integration_request_parameters' in method_parameter_set else None
)
)
)
"integration_request_parameters": {
"integration.request.header.{}".format(HTTP_HEADER_X_VALIDATION_CLIENT_NAME): "'{}'".format(HTTP_HEADER_X_VALIDATION_CLIENT_VALUE)
},
So what exactly is this method_parameter_set?那么这个method_parameter_set究竟是什么?
Thanks谢谢
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.